-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Segfault compiling libc on armv7-unknown-linux-gnueabihf #62896
Comments
@jonas-schievink this is also a regression with respect to stable Rust, so we probably need to avoid shipping a beta with this issue. |
Can you obtain backtrace using gdb or lldb? |
cc @nikic, this might also be fallout from the LLVM update |
@mati865 is there a guide I can use for this? |
and paste the output. |
|
cc @nikic - suspicious that this was reported right after the llvm 9 upgrade |
@fenhl
|
|
Report from compiler-team pre-triage: It seems like a good next step would be to bisect the regression to a specific nightly or (better) PR. The cargo-bisect-rustc tool may be of use here! |
I'm going to need some help with that because it just said “regression in nightly-2019-07-25” which is obviously wrong. Doing some further testing, it seems the segfault doesn't occur every time $ while command sleep 5; do cargo clean; if cargo check --release |& grep SIGSEGV; then echo segfault; else echo no segfault; fi; done
segfault
no segfault
segfault
segfault
segfault
segfault
segfault
segfault
segfault
segfault
segfault
no segfault |
@fenhl can you manually test if the nightlies before the one from 2019-07-21 also have this issue ? Nailing the first nightly with this problem would be very helpful. |
So we have the winner: #62592 |
The most suspicious winner. We should give a “bravest dev of the quarter”
award to whoever updates the LLVM version. Alex would often get this award,
but this time it would be @nikic and i’d Bet Alex would love to not have to
do this kind of thing and instead only work on the wasm stuff that interest
them. Or maybe we should have an LLVM working group whose job is to
regularly keep rustc following the latest LLVM trunk so that bugs in LLVM
upstream are discovered quickly as they happen. Idk.
|
Typically SIGSEGV indicates an LLVM assertion firing. Would be great if a reproduction was attempted with rustc that has LLVM assertions enabled. Furthermore the backtraces posted above are for cargo, not for the rustc process it spawns. Would be nice to see a backtrace from rustc with LLVM assertions enabled. |
@nagisa The stack trace in #62896 (comment) indicates a segfault during |
@nagisa I don't really know how to use plain rustc, but I'd be happy to help if instructions are provided. |
@nikic from what I can tell that backtrace is taken after the process broke on a signal other than |
@stefson The LLVM fork of rustc at https://github.com/rust-lang/llvm-project. The same as the one used in CI. |
Pkgsrc changes: * Adapt to the move of the implementation of random numbers. * Remove patch which is no longer relevant (Signals.inc) * Cross-build currently fails due to the still unresolved rust-lang/rust#62558, so bootstrap kits for 1.38.0 have to be built natively, and will follow shortly. * Bump bootstrap requirements to 1.37.0 except for armv7-unknown-netbsd-eabihf which I've neither managed to cross-build nor build natively. Upstream changes: Version 1.38.0 (2019-09-26) ========================== Language -------- - [The `#[global_allocator]` attribute can now be used in submodules.][62735] - [The `#[deprecated]` attribute can now be used on macros.][62042] Compiler -------- - [Added pipelined compilation support to `rustc`.][62766] This will improve compilation times in some cases. For further information please refer to the [_"Evaluating pipelined rustc compilation"_][pipeline-internals] thread. - [Added tier 3\* support for the `aarch64-uwp-windows-msvc`, `i686-uwp-windows-gnu`, `i686-uwp-windows-msvc`, `x86_64-uwp-windows-gnu`, and `x86_64-uwp-windows-msvc` targets.][60260] - [Added tier 3 support for the `armv7-unknown-linux-gnueabi` and `armv7-unknown-linux-musleabi` targets.][63107] - [Added tier 3 support for the `hexagon-unknown-linux-musl` target.][62814] - [Added tier 3 support for the `riscv32i-unknown-none-elf` target.][62784] \* Refer to Rust's [platform support page][forge-platform-support] for more information on Rust's tiered platform support. Libraries --------- - [`ascii::EscapeDefault` now implements `Clone` and `Display`.][63421] - [Derive macros for prelude traits (e.g. `Clone`, `Debug`, `Hash`) are now available at the same path as the trait.][63056] (e.g. The `Clone` derive macro is available at `std::clone::Clone`). This also makes all built-in macros available in `std`/`core` root. e.g. `std::include_bytes!`. - [`str::Chars` now implements `Debug`.][63000] - [`slice::{concat, connect, join}` now accepts `&[T]` in addition to `&T`.][62528] - [`*const T` and `*mut T` now implement `marker::Unpin`.][62583] - [`Arc<[T]>` and `Rc<[T]>` now implement `FromIterator<T>`.][61953] - [Added euclidean remainder and division operations (`div_euclid`, `rem_euclid`) to all numeric primitives.][61884] Additionally `checked`, `overflowing`, and `wrapping` versions are available for all integer primitives. - [`thread::AccessError` now implements `Clone`, `Copy`, `Eq`, `Error`, and `PartialEq`.][61491] - [`iter::{StepBy, Peekable, Take}` now implement `DoubleEndedIterator`.][61457] Stabilized APIs --------------- - [`<*const T>::cast`] - [`<*mut T>::cast`] - [`Duration::as_secs_f32`] - [`Duration::as_secs_f64`] - [`Duration::div_duration_f32`] - [`Duration::div_duration_f64`] - [`Duration::div_f32`] - [`Duration::div_f64`] - [`Duration::from_secs_f32`] - [`Duration::from_secs_f64`] - [`Duration::mul_f32`] - [`Duration::mul_f64`] - [`any::type_name`] Cargo ----- - [Added pipelined compilation support to `cargo`.][cargo/7143] - [You can now pass the `--features` option multiple times to enable multiple features.][cargo/7084] Misc ---- - [`rustc` will now warn about some incorrect uses of `mem::{uninitialized, zeroed}` that are known to cause undefined behaviour.][63346] Compatibility Notes ------------------- - Unfortunately the [`x86_64-unknown-uefi` platform can not be built][62785] with rustc 1.39.0. - The [`armv7-unknown-linux-gnueabihf` platform is also known to have issues][62896] for certain crates such as libc. [60260]: rust-lang/rust#60260 [61457]: rust-lang/rust#61457 [61491]: rust-lang/rust#61491 [61884]: rust-lang/rust#61884 [61953]: rust-lang/rust#61953 [62042]: rust-lang/rust#62042 [62528]: rust-lang/rust#62528 [62583]: rust-lang/rust#62583 [62735]: rust-lang/rust#62735 [62766]: rust-lang/rust#62766 [62784]: rust-lang/rust#62784 [62785]: rust-lang/rust#62785 [62814]: rust-lang/rust#62814 [62896]: rust-lang/rust#62896 [63000]: rust-lang/rust#63000 [63056]: rust-lang/rust#63056 [63107]: rust-lang/rust#63107 [63346]: rust-lang/rust#63346 [63421]: rust-lang/rust#63421 [cargo/7084]: rust-lang/cargo#7084 [cargo/7143]: rust-lang/cargo#7143 [`<*const T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast [`<*mut T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast [`Duration::as_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f32 [`Duration::as_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f64 [`Duration::div_duration_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f32 [`Duration::div_duration_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f64 [`Duration::div_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f32 [`Duration::div_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f64 [`Duration::from_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f32 [`Duration::from_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f64 [`Duration::mul_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f32 [`Duration::mul_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f64 [`any::type_name`]: https://doc.rust-lang.org/std/any/fn.type_name.html [forge-platform-support]: https://forge.rust-lang.org/platform-support.html [pipeline-internals]: https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199
…excrichton Upgrade GCC to 8.3.0, glibc to 1.17.0 and crosstool-ng to 1.24.0 for dist-armv7-linux rust-lang#62896 was caused by the usage of the GCC 5.2.0 toolchain, which was released back in 2015 and may have bugs affecting LLVM 9. This PR upgrade GCC to 8.3.0 from 5.2.0, glibc from 1.16.0 to 1.17.0 and crosstool-ng to 1.24.0 only for dist-armv7-linux. Fixes rust-lang#62896 r? @alexcrichton
Confirmed the PR fixes the issue:
|
are the side tools like clippy and rustfmt likely to also build in the next nightly now? |
It is another issue. |
…crichton Upgrade GCC to 8.3.0, glibc to 1.17.0 and crosstool-ng to 1.24.0 for dist-armv7-linux rust-lang#62896 was caused by the usage of the GCC 5.2.0 toolchain, which was released back in 2015 and may have bugs affecting LLVM 9. This PR upgrade GCC to 8.3.0 from 5.2.0, glibc from 1.16.0 to 1.17.0 and crosstool-ng to 1.24.0 only for dist-armv7-linux. Fixes rust-lang#62896 r? @alexcrichton
Today, there are some issues identified in the rust toolchain. This is the recommended workaround from below issues: Spotifyd/spotifyd#425 rust-lang/rust#62896 (comment)
Just had this pop up for me on both stable (1.40.0) and nightly (1.42.0 f6449ba23 2020-01-21) with my Raspberry Pi Zero W (arm-unknown-linux-gnueabihf) and was able to reproduce with the steps described. setting |
Also running into this on Raspberry Pi 4 via Balena.io builds. Can confirm that setting |
I can also still reproduce this on latest stable (1.43.1) with the same SIGSEGV. |
I just reproduced this with
|
@pnkfelix I think this should be either reopened or |
I tried to reproduce this with rustc-1.44.1 on armv7-unknown-linux-gnueabihf, and it did I used reproducer from the initial posting. If you need people to confirm the breakage, please offer a reproducer |
Also include the codgen-units=1 workaround for a rustc segfault when building this crate in release mode. Some details here: rust-lang/rust#62896
I'm still getting this on x86_64-unknown-linux-musl. It particularly fails when the code tries to create an http client of any sort, for example (s3 rusoto client, elasticsearch client) I created a small project to actually re-produce this issue:
as you can see, I locked it down to a specific nightly version ( but you can feel free to change it to any, I tried many versions. main.rs:
and the cargo.toml file
I'm not really sure what could possibly be the reason is, it something to do with |
@sabirmgd This is unlikely to have the same cause given that this issue is an architecture specific miscompilation and you are on a different architecture. Can you open a new issue? |
Originally reported as rust-lang/libc#1441 but I was asked to report this here.
Steps to reproduce
Output:
Workaround
Run the
cargo check
command withRUSTFLAGS='-Ccodegen-units=1'
or add the following to the Cargo.toml:The text was updated successfully, but these errors were encountered: