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

Release build for armv7 fails with SIGILL #52424

Closed
glebpom opened this issue Jul 16, 2018 · 5 comments
Closed

Release build for armv7 fails with SIGILL #52424

glebpom opened this issue Jul 16, 2018 · 5 comments
Labels
C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-musl Target: The musl libc

Comments

@glebpom
Copy link

glebpom commented Jul 16, 2018

Hi!

I'm working on a project with armv7 target. There are different binaries produced from the same codebase. I'm observing a strange behavior with one of the binaries only in release build - an "Illegal instruction" error. Debug build and other binaries (debug and release) work well.

gdb output:

(gdb) run
Starting program: /home/pi/lanlord
thread panicked while processing panic. aborting.

Program received signal SIGILL, Illegal instruction.
0x004569d4 in new_v1 () at /checkout/src/libcore/fmt/mod.rs:346
346	/checkout/src/libcore/fmt/mod.rs: No such file or directory.
(gdb) bt
#0  0x004569d4 in new_v1 () at /checkout/src/libcore/fmt/mod.rs:346
#1  std::panicking::rust_panic_with_hook::ha5eff468dabed44e () at libstd/panicking.rs:445
#2  0x00458d40 in std::panicking::begin_panic_fmt::h127c95263e9d91e1 () at libstd/panicking.rs:350
#3  0x00458d08 in rust_begin_unwind () at libstd/panicking.rs:328
#4  0x00478068 in core::panicking::panic_fmt::h61b193aee9efb823 () at libcore/panicking.rs:71
#5  0x00461d44 in core::result::unwrap_failed::h7903c94ac7c61055 () at /checkout/src/libcore/macros.rs:26
#6  0x004687a8 in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::h4b43a500d36f0788 () at libcore/result.rs:809
#7  0x00456c2c in with<std::thread::Thread,closure> () at libstd/sys_common/thread_info.rs:26
#8  current_thread () at libstd/sys_common/thread_info.rs:39
#9  default_hook () at libstd/panicking.rs:197
#10 std::panicking::rust_panic_with_hook::ha5eff468dabed44e () at libstd/panicking.rs:463
#11 0x00458d40 in std::panicking::begin_panic_fmt::h127c95263e9d91e1 () at libstd/panicking.rs:350
#12 0x00458d08 in rust_begin_unwind () at libstd/panicking.rs:328
#13 0x00478068 in core::panicking::panic_fmt::h61b193aee9efb823 () at libcore/panicking.rs:71
#14 0x00461d44 in core::result::unwrap_failed::h7903c94ac7c61055 () at /checkout/src/libcore/macros.rs:26
#15 0x004687a8 in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::h4b43a500d36f0788 () at libcore/result.rs:809
#16 0x00456c2c in with<std::thread::Thread,closure> () at libstd/sys_common/thread_info.rs:26
#17 current_thread () at libstd/sys_common/thread_info.rs:39
#18 default_hook () at libstd/panicking.rs:197
#19 std::panicking::rust_panic_with_hook::ha5eff468dabed44e () at libstd/panicking.rs:463
#20 0x00456948 in std::panicking::begin_panic::h4910a9b8cb3bd811 () at libstd/panicking.rs:397
#21 0x0046826c in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::h71395f6ddd67275a () at libstd/sys_common/thread_info.rs:47
#22 0x000a5784 in main ()
(gdb) quit

https://github.com/rust-lang/rust/blob/1.27.0/src/libstd/sys_common/thread_info.rs#L47

@glebpom glebpom changed the title Release build for armv7 fails with SIGILLL Release build for armv7 fails with SIGILL Jul 16, 2018
@kennytm kennytm added O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state C-bug Category: This is a bug. labels Jul 16, 2018
@kennytm
Copy link
Member

kennytm commented Jul 16, 2018

Hi, could you post the entire target triple (armv7-???-???), and the Rust version (output of rustc -vV)?

Would using Rust nightly (which contains a fix for #48967) solve the problem?

@glebpom
Copy link
Author

glebpom commented Jul 16, 2018

Hi, the target is armv7-unknown-linux-musleabihf, rust version is 1.27.0 from rustup.

I tried the latest nightly, and it fails with another error:

(gdb) run
Starting program: /home/pi/lanlord

Program received signal SIGSEGV, Segmentation fault.
clone<std::thread::Inner> () at /checkout/src/liballoc/sync.rs:718
718	/checkout/src/liballoc/sync.rs: No such file or directory.
(gdb) bt
#0  clone<std::thread::Inner> () at /checkout/src/liballoc/sync.rs:718
#1  clone () at libstd/thread/mod.rs:1001
#2  {{closure}} () at libstd/sys_common/thread_info.rs:39
#3  {{closure}}<std::thread::Thread,closure> () at libstd/sys_common/thread_info.rs:33
#4  _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::try_with::h12e294fc1498f32b ()
    at libstd/thread/local.rs:294
#5  0x003d796c in std::panicking::rust_panic_with_hook::h2e0e3adddefcec58 ()
    at libstd/sys_common/thread_info.rs:26
#6  0x003d7674 in std::panicking::begin_panic::h024edfc32ac8659c ()
    at libstd/panicking.rs:409
#7  0x003e5da8 in {{closure}} () at libstd/sys_common/thread_info.rs:47
#8  try_with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure,()> () at libstd/thread/local.rs:294
#9  _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::hd042109b71d60bfc ()
    at libstd/thread/local.rs:248
#10 0x004d67f0 in main ()

@kennytm kennytm added the O-musl Target: The musl libc label Jul 16, 2018
@glebpom
Copy link
Author

glebpom commented Jul 16, 2018

I disabled LTO and it helped. Will also try to upgrade musl to the latest version, and try with lto enabled

@sanxiyn
Copy link
Member

sanxiyn commented Mar 19, 2019

Can you try again? As far as I can tell, there is no way for anyone other than the reporter to reproduce the issue, so it is hard to make any progress.

@glebpom
Copy link
Author

glebpom commented Mar 19, 2019

I think it's no longer reproducible.

@sanxiyn sanxiyn closed this as completed Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-musl Target: The musl libc
Projects
None yet
Development

No branches or pull requests

3 participants