Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust 1.41.0 not being built (signal: 11, SIGSEGV: invalid memory reference) #338

Closed
Alzimzim opened this issue Feb 1, 2020 · 10 comments
Closed

Comments

@Alzimzim
Copy link

Alzimzim commented Feb 1, 2020

rust-lang/rust#68731

    error: could not compile `compiler_builtins`.
Caused by:
  process didn't exit successfully: `/builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/rustc --crate-name compiler_builtins /builddir/build/BUILD/rustc-1.41.0-src/vendor/compiler_builtins/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C debuginfo=0 --cfg 'feature="c"' --cfg 'feature="cc"' --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' -C metadata=63fa04c7efa65202 -C extra-filename=-63fa04c7efa65202 --out-dir /builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps --target i686-unknown-linux-gnu -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/release/deps --extern core=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps/librustc_std_workspace_core-b3405ae5969d0864.rmeta --cap-lints allow -Clink-arg=-Wl,-z,relro,-z,now -Zexternal-macro-backtrace -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -Zsave-analysis -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/build/compiler_builtins-c8b2c93ec2279576/out --cfg 'feature="unstable"' --cfg '__absvdi2="optimized-c"' --cfg '__absvsi2="optimized-c"' --cfg '__absvti2="optimized-c"' --cfg '__addvdi3="optimized-c"' --cfg '__addvsi3="optimized-c"' --cfg '__addvti3="optimized-c"' --cfg '__ashldi3="optimized-c"' --cfg '__ashrdi3="optimized-c"' --cfg '__clzdi2="optimized-c"' --cfg '__clzsi2="optimized-c"' --cfg '__clzti2="optimized-c"' --cfg '__cmpdi2="optimized-c"' --cfg '__cmpti2="optimized-c"' --cfg '__ctzdi2="optimized-c"' --cfg '__ctzsi2="optimized-c"' --cfg '__ctzti2="optimized-c"' --cfg '__divdc3="optimized-c"' --cfg '__divdi3="optimized-c"' --cfg '__divsc3="optimized-c"' --cfg '__divxc3="optimized-c"' --cfg '__extendhfsf2="optimized-c"' --cfg '__ffsti2="optimized-c"' --cfg '__floatdidf="optimized-c"' --cfg '__floatdisf="optimized-c"' --cfg '__floatdixf="optimized-c"' --cfg '__floatundidf="optimized-c"' --cfg '__floatundisf="optimized-c"' --cfg '__floatundixf="optimized-c"' --cfg '__int_util="optimized-c"' --cfg '__lshrdi3="optimized-c"' --cfg '__moddi3="optimized-c"' --cfg '__muldc3="optimized-c"' --cfg '__muldi3="optimized-c"' --cfg '__mulsc3="optimized-c"' --cfg '__mulvdi3="optimized-c"' --cfg '__mulvsi3="optimized-c"' --cfg '__mulvti3="optimized-c"' --cfg '__mulxc3="optimized-c"' --cfg '__negdf2="optimized-c"' --cfg '__negdi2="optimized-c"' --cfg '__negsf2="optimized-c"' --cfg '__negti2="optimized-c"' --cfg '__negvdi2="optimized-c"' --cfg '__negvsi2="optimized-c"' --cfg '__negvti2="optimized-c"' --cfg '__paritydi2="optimized-c"' --cfg '__paritysi2="optimized-c"' --cfg '__parityti2="optimized-c"' --cfg '__popcountdi2="optimized-c"' --cfg '__popcountsi2="optimized-c"' --cfg '__popcountti2="optimized-c"' --cfg '__powixf2="optimized-c"' --cfg '__subvdi3="optimized-c"' --cfg '__subvsi3="optimized-c"' --cfg '__subvti3="optimized-c"' --cfg '__truncdfhf2="optimized-c"' --cfg '__truncdfsf2="optimized-c"' --cfg '__truncsfhf2="optimized-c"' --cfg '__ucmpdi2="optimized-c"' --cfg '__ucmpti2="optimized-c"' --cfg '__udivdi3="optimized-c"' --cfg '__umoddi3="optimized-c"' --cfg 'apple_versioning="optimized-c"' -l static=compiler-rt` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/builddir/build/BUILD/rust-1.40.0-i686-unknown-linux-gnu/usr/bin/cargo" "build" "-Zconfig-profile" "--target" "i686-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--frozen" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/builddir/build/BUILD/rustc-1.41.0-src/src/libtest/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: /builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/bootstrap build
@bjorn3
Copy link
Member

bjorn3 commented Feb 1, 2020

Could you please run the failed command (the rustc command) in a debugger and post the backtrace?

For example:

$ gdb /builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/rustc --crate-name compiler_builtins /builddir/build/BUILD/rustc-1.41.0-src/vendor/compiler_builtins/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C debuginfo=0 --cfg 'feature="c"' --cfg 'feature="cc"' --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' -C metadata=63fa04c7efa65202 -C extra-filename=-63fa04c7efa65202 --out-dir /builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps --target i686-unknown-linux-gnu -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/release/deps --extern core=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps/librustc_std_workspace_core-b3405ae5969d0864.rmeta --cap-lints allow -Clink-arg=-Wl,-z,relro,-z,now -Zexternal-macro-backtrace -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -Zsave-analysis -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/build/compiler_builtins-c8b2c93ec2279576/out --cfg 'feature="unstable"' --cfg '__absvdi2="optimized-c"' --cfg '__absvsi2="optimized-c"' --cfg '__absvti2="optimized-c"' --cfg '__addvdi3="optimized-c"' --cfg '__addvsi3="optimized-c"' --cfg '__addvti3="optimized-c"' --cfg '__ashldi3="optimized-c"' --cfg '__ashrdi3="optimized-c"' --cfg '__clzdi2="optimized-c"' --cfg '__clzsi2="optimized-c"' --cfg '__clzti2="optimized-c"' --cfg '__cmpdi2="optimized-c"' --cfg '__cmpti2="optimized-c"' --cfg '__ctzdi2="optimized-c"' --cfg '__ctzsi2="optimized-c"' --cfg '__ctzti2="optimized-c"' --cfg '__divdc3="optimized-c"' --cfg '__divdi3="optimized-c"' --cfg '__divsc3="optimized-c"' --cfg '__divxc3="optimized-c"' --cfg '__extendhfsf2="optimized-c"' --cfg '__ffsti2="optimized-c"' --cfg '__floatdidf="optimized-c"' --cfg '__floatdisf="optimized-c"' --cfg '__floatdixf="optimized-c"' --cfg '__floatundidf="optimized-c"' --cfg '__floatundisf="optimized-c"' --cfg '__floatundixf="optimized-c"' --cfg '__int_util="optimized-c"' --cfg '__lshrdi3="optimized-c"' --cfg '__moddi3="optimized-c"' --cfg '__muldc3="optimized-c"' --cfg '__muldi3="optimized-c"' --cfg '__mulsc3="optimized-c"' --cfg '__mulvdi3="optimized-c"' --cfg '__mulvsi3="optimized-c"' --cfg '__mulvti3="optimized-c"' --cfg '__mulxc3="optimized-c"' --cfg '__negdf2="optimized-c"' --cfg '__negdi2="optimized-c"' --cfg '__negsf2="optimized-c"' --cfg '__negti2="optimized-c"' --cfg '__negvdi2="optimized-c"' --cfg '__negvsi2="optimized-c"' --cfg '__negvti2="optimized-c"' --cfg '__paritydi2="optimized-c"' --cfg '__paritysi2="optimized-c"' --cfg '__parityti2="optimized-c"' --cfg '__popcountdi2="optimized-c"' --cfg '__popcountsi2="optimized-c"' --cfg '__popcountti2="optimized-c"' --cfg '__powixf2="optimized-c"' --cfg '__subvdi3="optimized-c"' --cfg '__subvsi3="optimized-c"' --cfg '__subvti3="optimized-c"' --cfg '__truncdfhf2="optimized-c"' --cfg '__truncdfsf2="optimized-c"' --cfg '__truncsfhf2="optimized-c"' --cfg '__ucmpdi2="optimized-c"' --cfg '__ucmpti2="optimized-c"' --cfg '__udivdi3="optimized-c"' --cfg '__umoddi3="optimized-c"' --cfg 'apple_versioning="optimized-c"' -l static=compiler-rt
(gdb) run
(gdb) bt
(gdb) quit

@Alzimzim
Copy link
Author

Alzimzim commented Feb 1, 2020

GNU gdb (GDB) 8.0.1-1 ()
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/rustc...done.
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/rustc.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) run
Starting program: /builddir/build/BUILD/rustc-1.41.0-src/build/bootstrap/debug/rustc --crate-name compiler_builtins /builddir/build/BUILD/rustc-1.41.0-src/vendor/compiler_builtins/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C debuginfo=0 --cfg feature=\"c\" --cfg feature=\"cc\" --cfg feature=\"compiler-builtins\" --cfg feature=\"core\" --cfg feature=\"default\" --cfg feature=\"rustc-dep-of-std\" -C metadata=63fa04c7efa65202 -C extra-filename=-63fa04c7efa65202 --out-dir /builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps --target i686-unknown-linux-gnu -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps -L dependency=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/release/deps --extern core=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/deps/librustc_std_workspace_core-b3405ae5969d0864.rmeta --cap-lints allow -Clink-arg=-Wl,-z,relro,-z,now -Zexternal-macro-backtrace -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -Zsave-analysis -Cprefer-dynamic -Zbinary-dep-depinfo -L native=/builddir/build/BUILD/rustc-1.41.0-src/build/i686-unknown-linux-gnu/stage1-std/i686-unknown-linux-gnu/release/build/compiler_builtins-c8b2c93ec2279576/out --cfg feature=\"unstable\" --cfg __absvdi2=\"optimized-c\" --cfg __absvsi2=\"optimized-c\" --cfg __absvti2=\"optimized-c\" --cfg __addvdi3=\"optimized-c\" --cfg __addvsi3=\"optimized-c\" --cfg __addvti3=\"optimized-c\" --cfg __ashldi3=\"optimized-c\" --cfg __ashrdi3=\"optimized-c\" --cfg __clzdi2=\"optimized-c\" --cfg __clzsi2=\"optimized-c\" --cfg __clzti2=\"optimized-c\" --cfg __cmpdi2=\"optimized-c\" --cfg __cmpti2=\"optimized-c\" --cfg __ctzdi2=\"optimized-c\" --cfg __ctzsi2=\"optimized-c\" --cfg __ctzti2=\"optimized-c\" --cfg __divdc3=\"optimized-c\" --cfg __divdi3=\"optimized-c\" --cfg __divsc3=\"optimized-c\" --cfg __divxc3=\"optimized-c\" --cfg __extendhfsf2=\"optimized-c\" --cfg __ffsti2=\"optimized-c\" --cfg __floatdidf=\"optimized-c\" --cfg __floatdisf=\"optimized-c\" --cfg __floatdixf=\"optimized-c\" --cfg __floatundidf=\"optimized-c\" --cfg __floatundisf=\"optimized-c\" --cfg __floatundixf=\"optimized-c\" --cfg __int_util=\"optimized-c\" --cfg __lshrdi3=\"optimized-c\" --cfg __moddi3=\"optimized-c\" --cfg __muldc3=\"optimized-c\" --cfg __muldi3=\"optimized-c\" --cfg __mulsc3=\"optimized-c\" --cfg __mulvdi3=\"optimized-c\" --cfg __mulvsi3=\"optimized-c\" --cfg __mulvti3=\"optimized-c\" --cfg __mulxc3=\"optimized-c\" --cfg __negdf2=\"optimized-c\" --cfg __negdi2=\"optimized-c\" --cfg __negsf2=\"optimized-c\" --cfg __negti2=\"optimized-c\" --cfg __negvdi2=\"optimized-c\" --cfg __negvsi2=\"optimized-c\" --cfg __negvti2=\"optimized-c\" --cfg __paritydi2=\"optimized-c\" --cfg __paritysi2=\"optimized-c\" --cfg __parityti2=\"optimized-c\" --cfg __popcountdi2=\"optimized-c\" --cfg __popcountsi2=\"optimized-c\" --cfg __popcountti2=\"optimized-c\" --cfg __powixf2=\"optimized-c\" --cfg __subvdi3=\"optimized-c\" --cfg __subvsi3=\"optimized-c\" --cfg __subvti3=\"optimized-c\" --cfg __truncdfhf2=\"optimized-c\" --cfg __truncdfsf2=\"optimized-c\" --cfg __truncsfhf2=\"optimized-c\" --cfg __ucmpdi2=\"optimized-c\" --cfg __ucmpti2=\"optimized-c\" --cfg __udivdi3=\"optimized-c\" --cfg __umoddi3=\"optimized-c\" --cfg apple_versioning=\"optimized-c\" -l static=compiler-rt
Missing separate debuginfo for /lib/ld-linux.so.2
Try: urpmf /usr/lib/debug/.build-id/0a/db173ed1765ceba8401dbb286f6ed3b3f66066.debug
Missing separate debuginfo for /lib/libdl.so.2
Try: urpmf /usr/lib/debug/.build-id/60/32b7594a09ea0b325514b9d75517b2619eee0c.debug
Missing separate debuginfo for /lib/i686/librt.so.1
Try: urpmf /usr/lib/debug/.build-id/ba/ec09e7aeccccf3ac8be1b0a8d3f068f6f556e8.debug
Missing separate debuginfo for /lib/i686/libpthread.so.0
Try: urpmf /usr/lib/debug/.build-id/e2/bb064e174e706b663a0c47ee93986a7c4365df.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i686/libthread_db.so.1".
Missing separate debuginfo for /lib/libgcc_s.so.1
Try: urpmf /usr/lib/debug/.build-id/b9/0779c22856369bd946045fbcf695df754aa316.debug
Missing separate debuginfo for /lib/i686/libc.so.6
Try: urpmf /usr/lib/debug/.build-id/c4/ed0f7c2562fa8309ca7f420b4a342a14295156.debug
Missing separate debuginfo for /lib/i686/libm.so.6
Try: urpmf /usr/lib/debug/.build-id/49/2a00ac5010761fd90c25aa9e1ccdac892a2526.debug
thread 'main' panicked at 'RUSTC_STAGE was not set: NotPresent', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[Inferior 1 (process 55) exited with code 0145]
(gdb) bt
No stack.
(gdb) quit
-bash-4.4# 

rpm-buildroot.tar.gz

Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=1797127

@bjorn3
Copy link
Member

bjorn3 commented Feb 1, 2020

I missed that you were compiling rustc. Could you please run ./x.py build -vv to show the actual command line of the real rustc and then run that one in a debugger?

@mikhailnov
Copy link

@bjorn3 I think it may be quicker for you to download rpm-buildroot.tar.gz by the link above, chroot into /var/lib/mock*/rosa*/root inside it and see what you want

@bjorn3
Copy link
Member

bjorn3 commented Feb 1, 2020

I just read the linked fedora bug report and saw a backtrace there. The SIGSEGV happens in LLVM, which I don't know much about it's internals.

@cuviper
Copy link
Member

cuviper commented Feb 1, 2020

Please note, I've already identified the likely LLVM fix in that Fedora bug report. It's also fine with LLVM 9.

@mikhailnov
Copy link

@cuviper me and @Alzimzim can confirm that there is no crash with llvm9

@cuviper
Copy link
Member

cuviper commented Feb 1, 2020

So the solution is to patch your LLVM, as I intend to do in Fedora 30. It's not really a bug in compiler-builtins -- it just started using functionality that's broken in older LLVM.

@mikhailnov
Copy link

Cherry-picking that commit to llvm8 has fixed buillding rust 1.41.0 i686. https://abf.io/import/llvm/commit/44b794ab9fc86a3a0ffa4878aea96443a33fbb37

Thanks for bibisecting.

@tgross35
Copy link
Contributor

It sounds like this has since been resolved, closing

@tgross35 tgross35 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants