-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Segfault in _Unwind_Backtrace
when using compiler-rt
#93360
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
Comments
Unwinding from Rust into C++ is complex (might even be UB today, I'm not 100% sure, it was blocked in Rust 1.33 but then re-allowed soon after with large safety warnings) - https://github.com/rust-lang/project-ffi-unwind/blob/master/faq.md and related pages might tell you more about the current state of the world. The presence of the zero terminator suggests this isn't the same issue as #47551 though it might be worth checking that it's at the end of the section and hasn't been inserted in the wrong place (seems unlikely but should be easy to check). |
As a result, we have decided to quit using compiler-rt and llvm's libunwind. Though, I am still looking forward for solutions! |
Triage: Can this still be reproduced with latest versions of everything? If yes, please provide detailed step by step instructions on how to reproduce in a fresh docker container. |
Based on https://doc.rust-lang.org/nomicon/unwinding.html unwinding across FFI boundary into another language is at present not supported.
Please feel free to reopen if this is about Rust code unwinding into Rust. |
The error was similar as #47551, but it was not exactly the same.
To make sure full LLVM env on Linux, I tried something like:
and used it as the linker.

Everything is working except that the program crashes in unwinding progress.
I have already posted a related thread at LLVM's discourse (please refer this link for more inspections on eh_frame sections): https://llvm.discourse.group/t/segfault-in-libunwind-during-cpu-profiling/5806. But given #47551, I think
rustc
can also be a cause of the problem.I have already switched back to shared linkage as it is shown in the script above, but the problem persists, just in different frames.
Versions
LLVM
13.0.0
Rust
nightly-2021-04-15
The text was updated successfully, but these errors were encountered: