-
Notifications
You must be signed in to change notification settings - Fork 255
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
Segmentation Fault on Linux when rustls is present #150
Comments
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 ( 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 |
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 #189 since I think that's basically the only viable way to fix this. |
Fix build error when using the 'webgl_backtrace' feature This patch fixes a build error that happens when building with `--features webgl_backtrace`. However, while working on this I've noticed that calling `Backtrace::new()` instantly causes a segmentation fault. This didn't happen with the example code of [the package](https://crates.io/crates/backtrace) though, so I wasn't sure where to report this (maybe related: [backtrace-rs/#150](rust-lang/backtrace-rs#150), [backtrace-rs/#189](rust-lang/backtrace-rs#189)). cc @alexcrichton @jdm --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ - [x] These changes fix an issue that happens with a compile time feature not tested by the CI <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23966) <!-- Reviewable:end -->
Hi @alexcrichton , is this issue actually fixed? I'm experiencing same issue on MacOS even after I set 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.
The text was updated successfully, but these errors were encountered: