Closed jonas-schievink closed 5 years ago
Thanks for the report, and this definitely looks bad! Would it be possible to perhaps make a docker image to reproduce this? I can't reproduce this locally, and it's likely related to system differences like glibc or C compilers perhaps?
We couldn't reproduce this on an Ubuntu machine either (I'm running Arch Linux). I'll look into it.
However, on my machine this appears to have fixed itself after the newest nightly (rustc 1.33.0-nightly (d22fa2d87 2019-01-08)
), while the one before that still reliably crashes (rustc 1.33.0-nightly (8e2063d02 2019-01-07)
). The commits between the 2 nightlies suggest that this might've been fixed by you in https://github.com/rust-lang/rust/pull/57429, does that sound possible? The other merges don't look suspicious.
I'll try to pinpoint the Rust version that introduced this behaviour now.
So after lots of bisecting I found out that this is apparently only happening when linking with LLD (which I had symlinked as ld
a while ago to speed up compilation). I guess I'll close this and try to report this upstream somehow.
Interesting! I actually think there's two bugs here, one is probably with LLD but one is definitely still with libbacktrace here because no matter what the debuginfo looks like it shouldn't segfault.
Would you be willing to help me out get a reproduction for this for this repository to still try to fix the segfault?
Sure, I made a Docker reproducer anyway: https://github.com/jonas-schievink/lldbug/
(additionally this might also be a bug in rustc's/LLVM's debuginfo handling)
I'm gonna close this in favor of https://github.com/rust-lang/backtrace-rs/issues/189 since I think that's basically the only viable way to fix this.
Hi @alexcrichton , is this issue actually fixed? I'm experiencing same issue on MacOS even after I set feature "gimli-symbolize"
.
Here is a minimum reproduce example https://github.com/Chronostasys/backtracebug .
Hi @alexcrichton , is this issue actually fixed? I'm experiencing same issue on MacOS even after I set
feature "gimli-symbolize"
.Here is a minimum reproduce example https://github.com/Chronostasys/backtracebug .
More info: seems the crash only happens on mac with arm64 target.
Reproduction
cargo new --bin segfault
Cargo.toml
main.rs
Running it, setting
RUST_BACKTRACE=1
to make failure obtain a backtrace:Removing the
extern crate rustls;
makes the crash disappear.Replacing
rmp_serde::from_slice::<()>(&[128])
with"abc".parse::<u8>()
yields 2 garbage backtraces:This also fixes itself when removing
rustls
.GDB
Running GDB via
env RUST_BACKTRACE=1 gdb target/debug/ta-client
For some reason an invalid pointer is passed to
CStr::from_ptr
(no null pointer, though).This might very well be a bug in rustc/LLVM, but could also be located in (lib)backtrace like the backtrace indicates, so I'm opening the issue here.
Toolchain versions
On stable, it produces a garbled stacktrace instead of a crash.