Bug 240099 - lang/rust: build failed with SIGSEGV: invalid memory reference
Summary: lang/rust: build failed with SIGSEGV: invalid memory reference
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-25 13:30 UTC by iron.udjin
Modified: 2019-09-08 13:39 UTC (History)
0 users

See Also:
tobik: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2019-08-25 13:30:37 UTC
Hello,

I'm trying to build rust-1.37.0 on 12.0-STABLE r351477 and got:

...
   Compiling syntax_pos v0.0.0 (/usr/ports/lang/rust/work/rustc-1.37.0-src/src/libsyntax_pos)
   Compiling rustc_errors v0.0.0 (/usr/ports/lang/rust/work/rustc-1.37.0-src/src/librustc_errors)
   Compiling fmt_macros v0.0.0 (/usr/ports/lang/rust/work/rustc-1.37.0-src/src/libfmt_macros)
error: Could not compile `rustc_errors`.

Caused by:
  process didn't exit successfully: `/usr/ports/lang/rust/work/rustc-1.37.0-src/build/bootstrap/debug/rustc --edition=2018 --crate-name rustc_errors src/librustc_errors/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=462f917bf7af97bf -C extra-filename=-462f917bf7af97bf --out-dir /usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -L dependency=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps -L dependency=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/release/deps --extern annotate_snippets=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libannotate_snippets-21309ad59417079c.rlib --extern atty=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libatty-74c1d8e01172cf79.rlib --extern log=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/liblog-aaae1f3793c69196.rlib --extern rustc_cratesio_shim=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/librustc_cratesio_shim-35743d30de251cd3.so --extern rustc_data_structures=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/librustc_data_structures-27b829d9a8662ce5.so --extern serialize=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libserialize-d1d5b874fc8c9ee2.so --extern serialize=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libserialize-d1d5b874fc8c9ee2.rlib --extern syntax_pos=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libsyntax_pos-c54fb334711156e0.so --extern termcolor=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libtermcolor-353ba7bc4183fdce.rlib --extern unicode_width=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libunicode_width-cfb6bcaec9cbee54.rlib` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: Could not compile `rustc_target`.

Caused by:
  process didn't exit successfully: `/usr/ports/lang/rust/work/rustc-1.37.0-src/build/bootstrap/debug/rustc --edition=2018 --crate-name rustc_target src/librustc_target/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=0e9920e7fad9583b -C extra-filename=-0e9920e7fad9583b --out-dir /usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -L dependency=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps -L dependency=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/release/deps --extern bitflags=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libbitflags-ff801711d1e4cc72.rlib --extern log=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/liblog-aaae1f3793c69196.rlib --extern rustc_cratesio_shim=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/librustc_cratesio_shim-35743d30de251cd3.so --extern rustc_data_structures=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/librustc_data_structures-27b829d9a8662ce5.so --extern serialize=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libserialize-d1d5b874fc8c9ee2.so --extern serialize=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libserialize-d1d5b874fc8c9ee2.rlib --extern syntax_pos=/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0-rustc/x86_64-unknown-freebsd/release/deps/libsyntax_pos-c54fb334711156e0.so` (signal: 11, SIGSEGV: invalid memory reference)
command did not execute successfully: "/usr/ports/lang/rust/work/rustc-1.37.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "--target" "x86_64-unknown-freebsd" "-j" "16" "--release" "--frozen" "--features" "" "--manifest-path" "/usr/ports/lang/rust/work/rustc-1.37.0-src/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
Traceback (most recent call last):
  File "/usr/ports/lang/rust/work/rustc-1.37.0-src/x.py", line 11, in <module>
    bootstrap.main()
  File "/usr/ports/lang/rust/work/rustc-1.37.0-src/src/bootstrap/bootstrap.py", line 847, in main
    bootstrap(help_triggered)
  File "/usr/ports/lang/rust/work/rustc-1.37.0-src/src/bootstrap/bootstrap.py", line 833, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/usr/ports/lang/rust/work/rustc-1.37.0-src/src/bootstrap/bootstrap.py", line 141, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/ports/lang/rust/work/rustc-1.37.0-src/build/bootstrap/debug/bootstrap build --verbose --config ./config.toml --jobs 16
*** Error code 1

Please let me know in case you'll need any additional info.
Comment 1 Tobias Kortkamp freebsd_committer 2019-09-08 12:41:09 UTC
Since we have not gotten any other reports like this, and Rust 1.37.0 builds
fine on the cluster, do you have any customization in your kernel config or
make.conf?
Comment 2 iron.udjin 2019-09-08 12:59:24 UTC
(In reply to Tobias Kortkamp from comment #1)
In my make.conf I have only:

CFLAGS+= -O2 -pipe -march=native -mtune=native

My kernel config pretty standard. I have only disabled unused devices. Here is it: https://pastebin.com/VeiR7DSg
Comment 3 Tobias Kortkamp freebsd_committer 2019-09-08 13:02:29 UTC
> CFLAGS+= -O2 -pipe -march=native -mtune=native

Can you retry without that?
Comment 4 iron.udjin 2019-09-08 13:39:29 UTC
(In reply to Tobias Kortkamp from comment #3)
Got the same result.