Skip to content

[beta] armv7-unknown-linux-gnueabihf bootstrap SIGILL #41291

Closed
@cuviper

Description

@cuviper

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:

Copying stage1 compiler (armv7-unknown-linux-gnueabihf)
Building stage1 std artifacts (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf)
    Finished release [optimized] target(s) in 0.1 secs
Copying stage1 std from stage1 (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf / armv7-unknown-linux-gnueabihf)
Building stage1 test artifacts (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf)
    Finished release [optimized] target(s) in 0.0 secs
Copying stage1 test from stage1 (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf / armv7-unknown-linux-gnueabihf)
Building stage1 compiler artifacts (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf)
   Compiling rustdoc v0.0.0 (file:///root/rust/src/librustdoc)
   Compiling flate v0.0.0 (file:///root/rust/src/libflate)
   Compiling rustc_llvm v0.0.0 (file:///root/rust/src/librustc_llvm)
   Compiling syntax v0.0.0 (file:///root/rust/src/libsyntax)
error: failed to run custom build command for `rustdoc v0.0.0 (file:///root/rust/src/librustdoc)`
process didn't exit successfully: `/root/rust/build/armv7-unknown-linux-gnueabihf/stage1-rustc/release/build/rustdoc-d21a2a025c4fade3/build-script-build` (signal: 4, SIGILL: illegal instruction)
--- stderr
thread panicked while processing panic. aborting.

Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `flate v0.0.0 (file:///root/rust/src/libflate)`
process didn't exit successfully: `/root/rust/build/armv7-unknown-linux-gnueabihf/stage1-rustc/release/build/flate-45efc5f9b5c983fe/build-script-build` (signal: 4, SIGILL: illegal instruction)
--- stderr
thread panicked while processing panic. aborting.

Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `rustc_llvm v0.0.0 (file:///root/rust/src/librustc_llvm)`
process didn't exit successfully: `/root/rust/build/armv7-unknown-linux-gnueabihf/stage1-rustc/release/build/rustc_llvm-95b19f11b71e673a/build-script-build` (signal: 4, SIGILL: illegal instruction)
--- stderr
thread panicked while processing panic. aborting.

Build failed, waiting for other jobs to finish...

So I also tried the master branch (exactly 43ef63d), and that fails as soon as it executes rustc at 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 stage1 rustc it creates seems to be bad:

Copying stage0 rustc from stage0 (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf / armv7-unknown-linux-gnueabihf)
executing step Step { name: "librustc", stage: 0, host: "armv7-unknown-linux-gnueabihf", target: "armv7-unknown-linux-gnueabihf" }
executing step Step { name: "rustc", stage: 1, host: "armv7-unknown-linux-gnueabihf", target: "armv7-unknown-linux-gnueabihf" }
Copying stage1 compiler (armv7-unknown-linux-gnueabihf)
executing step Step { name: "startup-objects", stage: 1, host: "armv7-unknown-linux-gnueabihf", target: "armv7-unknown-linux-gnueabihf" }
executing step Step { name: "build-crate-std", stage: 1, host: "armv7-unknown-linux-gnueabihf", target: "armv7-unknown-linux-gnueabihf" }
Building stage1 std artifacts (armv7-unknown-linux-gnueabihf -> armv7-unknown-linux-gnueabihf)
running: "/root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0/bin/cargo" "build" "-j" "4" "--target" "armv7-unknown-linux-gnueabihf" "-v" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/root/rust-nightly/src/libstd/Cargo.toml"
error: process didn't exit successfully: `/root/rust-nightly/build/bootstrap/debug/rustc -vV` (signal: 4, SIGILL: illegal instruction)
--- stderr
thread panicked while processing panic. aborting.



command did not execute successfully: "/root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage0/bin/cargo" "build" "-j" "4" "--target" "armv7-unknown-linux-gnueabihf" "-v" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/root/rust-nightly/src/libstd/Cargo.toml"
expected success, got: exit code: 101

I traced through with gdb, and it's not actually bootstrap/debug/rustc crashing, rather the stage1/bin/rustc that it execs into. Here's the backtrace:

#0  0xb6e65e00 in std::panicking::rust_panic_with_hook::hcf91b7c3478664b3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#1  0xb6e65d30 in std::panicking::begin_panic::h8a671f9e65f4cf12 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#2  0xb6e65ce4 in std::panicking::begin_panic_fmt::h9f922d1d569b2ea6 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#3  0xb6e65c94 in rust_begin_unwind () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#4  0xb6e7d7f4 in core::panicking::panic_fmt::h9106bacc40a4f5cd () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#5  0xb6e3fa7c in core::result::unwrap_failed::h8d064d4d03caecd3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#6  0xb6e5ab10 in std::sys_common::thread_info::ThreadInfo::with::_$u7b$$u7b$closure$u7d$$u7d$::haa3976f926a1414d () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#7  0xb6e65750 in std::panicking::default_hook::hd83360e73457e19b () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#8  0xb6e65ebc in std::panicking::rust_panic_with_hook::hcf91b7c3478664b3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#9  0xb6e65d30 in std::panicking::begin_panic::h8a671f9e65f4cf12 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#10 0xb6e65ce4 in std::panicking::begin_panic_fmt::h9f922d1d569b2ea6 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#11 0xb6e65c94 in rust_begin_unwind () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#12 0xb6e7d7f4 in core::panicking::panic_fmt::h9106bacc40a4f5cd () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#13 0xb6e3fa7c in core::result::unwrap_failed::h8d064d4d03caecd3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#14 0xb6e5ab10 in std::sys_common::thread_info::ThreadInfo::with::_$u7b$$u7b$closure$u7d$$u7d$::haa3976f926a1414d () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#15 0xb6e65750 in std::panicking::default_hook::hd83360e73457e19b () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#16 0xb6e65ebc in std::panicking::rust_panic_with_hook::hcf91b7c3478664b3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#17 0xb6e65d30 in std::panicking::begin_panic::h8a671f9e65f4cf12 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#18 0xb6e65ce4 in std::panicking::begin_panic_fmt::h9f922d1d569b2ea6 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#19 0xb6e65c94 in rust_begin_unwind () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#20 0xb6e7d7f4 in core::panicking::panic_fmt::h9106bacc40a4f5cd () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#21 0xb6e3fa7c in core::result::unwrap_failed::h8d064d4d03caecd3 () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#22 0xb6e66a6c in std::rt::lang_start::h0d05e03c29910bbb () from /root/rust-nightly/build/armv7-unknown-linux-gnueabihf/stage1/bin/../lib/libstd-8ba26b786e55861e.so
#23 0xb6c6d73c in __libc_start_main () from /lib/libc.so.6
#24 0x7f5556f8 in _start ()

That looks like a triple panic!

The actual SIGILL is delivered for a udf instruction:

Dump of assembler code for function _ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E:
   0xb6e65d78 <+0>:     push    {r4, r5, r6, r7, r8, r9, r11, lr}
   0xb6e65d7c <+4>:     sub     sp, sp, #72     ; 0x48
   0xb6e65d80 <+8>:     mov     r8, r0
   0xb6e65d84 <+12>:    ldr     r0, [pc, #544]  ; 0xb6e65fac <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+564>
   0xb6e65d88 <+16>:    ldr     r7, [r2]
   0xb6e65d8c <+20>:    ldmib   r2, {r4, r5}
   0xb6e65d90 <+24>:    mov     r9, r1
   0xb6e65d94 <+28>:    add     r0, pc, r0
   0xb6e65d98 <+32>:    bl      0xb6e3d8c8 <__tls_get_addr@plt>
   0xb6e65d9c <+36>:    ldr     r0, [r0]
   0xb6e65da0 <+40>:    cmp     r0, #0
   0xb6e65da4 <+44>:    beq     0xb6e65e04 <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+140>
   0xb6e65da8 <+48>:    ldr     r0, [pc, #512]  ; 0xb6e65fb0 <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+568>
   0xb6e65dac <+52>:    add     r0, pc, r0
   0xb6e65db0 <+56>:    bl      0xb6e3d8c8 <__tls_get_addr@plt>
   0xb6e65db4 <+60>:    ldr     r1, [r0, #4]
   0xb6e65db8 <+64>:    add     r6, r1, #1
   0xb6e65dbc <+68>:    str     r6, [r0, #4]
   0xb6e65dc0 <+72>:    cmp     r6, #2
   0xb6e65dc4 <+76>:    bls     0xb6e65e24 <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+172>
   0xb6e65dc8 <+80>:    ldr     r0, [pc, #484]  ; 0xb6e65fb4 <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+572>
   0xb6e65dcc <+84>:    ldr     r1, [pc, #484]  ; 0xb6e65fb8 <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+576>
   0xb6e65dd0 <+88>:    add     r0, pc, r0
   0xb6e65dd4 <+92>:    add     r1, pc, r1
   0xb6e65dd8 <+96>:    str     r0, [sp, #4]
   0xb6e65ddc <+100>:   mov     r0, #1
   0xb6e65de0 <+104>:   str     r0, [sp, #8]
   0xb6e65de4 <+108>:   mov     r0, #0
   0xb6e65de8 <+112>:   str     r0, [sp, #16]
   0xb6e65dec <+116>:   str     r0, [sp, #12]
   0xb6e65df0 <+120>:   str     r1, [sp, #20]
   0xb6e65df4 <+124>:   str     r0, [sp, #24]
   0xb6e65df8 <+128>:   add     r0, sp, #4
   0xb6e65dfc <+132>:   bl      0xb6e5ae8c <_ZN3std10sys_common4util10dumb_print17h91e4eccb0a94ba40E>
=> 0xb6e65e00 <+136>:   udf     #65006  ; 0xfdee
   0xb6e65e04 <+140>:   ldr     r0, [pc, #432]  ; 0xb6e65fbc <_ZN3std9panicking20rust_panic_with_hook17hcf91b7c3478664b3E+580>
   0xb6e65e08 <+144>:   add     r0, pc, r0
   0xb6e65e0c <+148>:   bl      0xb6e3d8c8 <__tls_get_addr@plt>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions