Repository navigation
[beta] armv7-unknown-linux-gnueabihf bootstrap SIGILL #41291
Description
Activity
(side note: on the beta branch I have also applied #41152, or else you have to configure with an explicit
--buildto get armv7.)I tried to build a debug nightly, but it can't link to
panicin stage0's librustc_const_math:= note: /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o: In function `core::num::{{impl}}::overflowing_neg': /root/rust-nightly/src/libcore/num/mod.rs:1092: undefined reference to `core::panicking::panic::hcd3f9134398a073e' /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o: In function `core::num::{{impl}}::overflowing_shl': /root/rust-nightly/src/libcore/num/mod.rs:1124: undefined reference to `core::panicking::panic::hcd3f9134398a073e' /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o: In function `core::num::{{impl}}::overflowing_shr': /root/rust-nightly/src/libcore/num/mod.rs:1155: undefined reference to `core::panicking::panic::hcd3f9134398a073e' /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o: In function `core::num::{{impl}}::overflowing_shl': /root/rust-nightly/src/libcore/num/mod.rs:2245: undefined reference to `core::panicking::panic::hcd3f9134398a073e' /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o: In function `core::num::{{impl}}::overflowing_shr': /root/rust-nightly/src/libcore/num/mod.rs:2277: undefined reference to `core::panicking::panic::hcd3f9134398a073e' /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0-rustc/armv7-unknown-linux-gnueabihf/debug/deps/rustc_const_math-3be4e5551d2ff493.0.o:/root/rust-nightly/src/libcore/num/mod.rs:1092: more undefined references to `core::panicking::panic::hcd3f9134398a073e' follow collect2: error: ld returned 1 exit statusLooking at it, it seems SIGILL is expected because of the
intriinsics::abort(). The questions are then, why did it panic in the first place and why did the default hook panic?Here is where the default hook is panicking.
Yes, I agree the SIGILL is just a symptom of the nested panics, not something to fix in itself.
While I couldn't get a debug build, I got a release build with debuginfo. Here's a better backtrace from running
stage1/bin/rustc -Vv:#0 std::panicking::rust_panic_with_hook (msg=..., file_line=<optimized out>) at /root/rust-nightly/src/libstd/panicking.rs:536 #1 0xb6e63924 in std::panicking::begin_panic<collections::string::String> (msg=..., file_line=0xbeffeb94) at /root/rust-nightly/src/libstd/panicking.rs:511 #2 0xb6e638d4 in std::panicking::begin_panic_fmt (msg=<optimized out>, file_line=0x0) at /root/rust-nightly/src/libstd/panicking.rs:495 #3 0xb6e63880 in std::panicking::rust_begin_panic (msg=..., file=..., line=859) at /root/rust-nightly/src/libstd/panicking.rs:471 #4 0xb6e7b910 in core::panicking::panic_fmt (fmt=..., file_line=<optimized out>) at /root/rust-nightly/src/libcore/panicking.rs:69 #5 0xb6e3cafc in core::result::unwrap_failed<core::cell::BorrowMutError> (msg=..., error=...) at /root/rust-nightly/src/libcore/macros.rs:29 #6 0xb6e58340 in core::result::Result<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>, core::cell::BorrowMutError>::expect<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,core::cell::BorrowMutError> (msg=..., self=...) at /root/rust-nightly/src/libcore/result.rs:761 #7 core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>::borrow_mut<core::option::Option<std::sys_common::thread_info::ThreadInfo>> (self=<optimized out>) at /root/rust-nightly/src/libcore/cell.rs:736 #8 std::sys_common::thread_info::{{impl}}::with::{{closure}}<std::thread::Thread,closure> (c=<optimized out>) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:32 #9 0xb6e6332c in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>>::with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure,core::option::Option<std::thread::Thread>> (self=<optimized out>, f=...) at /root/rust-nightly/src/libstd/thread/local.rs:253 #10 std::sys_common::thread_info::ThreadInfo::with<std::thread::Thread,closure> (f=...) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:30 #11 std::sys_common::thread_info::current_thread () at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:43 #12 std::panicking::default_hook (info=<optimized out>) at /root/rust-nightly/src/libstd/panicking.rs:341 #13 0xb6e63ab8 in std::panicking::rust_panic_with_hook (msg=..., file_line=<optimized out>) at /root/rust-nightly/src/libstd/panicking.rs:549 #14 0xb6e63924 in std::panicking::begin_panic<collections::string::String> (msg=..., file_line=0xbeffed84) at /root/rust-nightly/src/libstd/panicking.rs:511 #15 0xb6e638d4 in std::panicking::begin_panic_fmt (msg=<optimized out>, file_line=0x0) at /root/rust-nightly/src/libstd/panicking.rs:495 #16 0xb6e63880 in std::panicking::rust_begin_panic (msg=..., file=..., line=859) at /root/rust-nightly/src/libstd/panicking.rs:471 #17 0xb6e7b910 in core::panicking::panic_fmt (fmt=..., file_line=<optimized out>) at /root/rust-nightly/src/libcore/panicking.rs:69 #18 0xb6e3cafc in core::result::unwrap_failed<core::cell::BorrowMutError> (msg=..., error=...) at /root/rust-nightly/src/libcore/macros.rs:29 #19 0xb6e58340 in core::result::Result<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>, core::cell::BorrowMutError>::expect<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,core::cell::BorrowMutError> (msg=..., self=...) at /root/rust-nightly/src/libcore/result.rs:761 #20 core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>::borrow_mut<core::option::Option<std::sys_common::thread_info::ThreadInfo>> (self=<optimized out>) at /root/rust-nightly/src/libcore/cell.rs:736 #21 std::sys_common::thread_info::{{impl}}::with::{{closure}}<std::thread::Thread,closure> (c=<optimized out>) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:32 #22 0xb6e6332c in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>>::with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure,core::option::Option<std::thread::Thread>> (self=<optimized out>, f=...) at /root/rust-nightly/src/libstd/thread/local.rs:253 #23 std::sys_common::thread_info::ThreadInfo::with<std::thread::Thread,closure> (f=...) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:30 #24 std::sys_common::thread_info::current_thread () at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:43 #25 std::panicking::default_hook (info=<optimized out>) at /root/rust-nightly/src/libstd/panicking.rs:341 #26 0xb6e63ab8 in std::panicking::rust_panic_with_hook (msg=..., file_line=<optimized out>) at /root/rust-nightly/src/libstd/panicking.rs:549 #27 0xb6e63924 in std::panicking::begin_panic<collections::string::String> (msg=..., file_line=0xbeffef74) at /root/rust-nightly/src/libstd/panicking.rs:511 #28 0xb6e638d4 in std::panicking::begin_panic_fmt (msg=<optimized out>, file_line=0x0) at /root/rust-nightly/src/libstd/panicking.rs:495 #29 0xb6e63880 in std::panicking::rust_begin_panic (msg=..., file=..., line=859) at /root/rust-nightly/src/libstd/panicking.rs:471 #30 0xb6e7b910 in core::panicking::panic_fmt (fmt=..., file_line=<optimized out>) at /root/rust-nightly/src/libcore/panicking.rs:69 #31 0xb6e3cafc in core::result::unwrap_failed<core::cell::BorrowMutError> (msg=..., error=...) at /root/rust-nightly/src/libcore/macros.rs:29 #32 0xb6e64678 in core::result::Result<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>, core::cell::BorrowMutError>::expect<core::cell::RefMut<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,core::cell::BorrowMutError> (self=..., msg=...) at /root/rust-nightly/src/libcore/result.rs:761 #33 core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>::borrow_mut<core::option::Option<std::sys_common::thread_info::ThreadInfo>> (self=<optimized out>) at /root/rust-nightly/src/libcore/cell.rs:736 #34 std::sys_common::thread_info::set::{{closure}} (c=<optimized out>) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:52 #35 std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>>::with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure,()> (self=<optimized out>, f=...) at /root/rust-nightly/src/libstd/thread/local.rs:253 #36 std::sys_common::thread_info::set (stack_guard=..., thread=...) at /root/rust-nightly/src/libstd/sys_common/thread_info.rs:52 #37 std::rt::lang_start (main=<optimized out>, argc=<optimized out>, argv=<optimized out>) at /root/rust-nightly/src/libstd/rt.rs:51 #38 0xb6c6a73c in __libc_start_main () from /lib/libc.so.6 #39 0x7f5556f8 in _start ()So the first panic comes from the failed
borrow_mut()at frame#33called from here. The line right before got a sharedborrow()-- maybe something isn't marking this released properly?Then the nested panics come from
thread_info::current_thread()trying to read this same brokenTHREAD_INFO, with frames#21and#8also trying toborrow_mut()here.@arielb1 While it does sound the same, unfortunately no, this is with the rust-bundled LLVM, including your fix. :/
That said, there must be something local going wrong, as the official (cross-build) armv7 compiler seems to work fine, at least with the same simple reproducer, e.g.
rustc +nightly -Vv.I'm going to try a fresh build on a fresh system with absolutely no local LLVM present...
So -- that worked, both beta and nightly. I'll make sure to update our distro LLVM patches.
What tripped me up on nightly was that stage0 is still 1.17.0-beta.2, which doesn't have the LLVM fix. I bumped that to beta.3, and then it worked. This doesn't affect the official nightly builds because only the host compiler goes through stages, and AIUI the cross-compiled targets only use the host stage2. But doing a native arm compile, the bugged stage0 gave me an unusable stage1.
On beta, I don't know what happened before. I think perhaps somewhere when I was jumping between local and rust-llvm and testing different branches, I must have gotten a build of the still-broken rust-llvm, with a timestamp such that rustbuild didn't think it needed rebuilding on the fixed sources. I still have that build directory tarballed here, so I may poke at it when I get a free moment.
So we should update 1.18's stage0?
- added a commit that references this issue
on Apr 18, 2017 OK, see #41369 to bump stage0.
- added 6 commits that reference this issue
on Apr 18, 2017
While bootstrapping on Fedora 25 armv7l, I'm hitting a SIGILL when some beta-compiled programs are actually executed. This is with a purely default
./configure, no external LLVM or anything.On beta (exactly ca3d118), I get a little ways into stage1, and then build scripts SIGILL, apparently from double-panics. I reckon that the stable stage0 builds a stage1 compiler that's fine, then that stage1 starts building things that don't even need to execute until we get to a build script. Then:
So I also tried the master branch (exactly 43ef63d), and that fails as soon as it executes
rustcat the start of stage1. Here it seems that the downloaded beta stage0 compiler builds all of its stuff fine, which presumably includes executing some builds scripts like above. But the stage1rustcit creates seems to be bad:I traced through with gdb, and it's not actually
bootstrap/debug/rustccrashing, rather thestage1/bin/rustcthat it execs into. Here's the backtrace:That looks like a triple panic!
The actual SIGILL is delivered for a
udfinstruction: