-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
capturing stack backtrace becomes slower and sometimes segfaults on Apple Silicon #104388
Comments
@rustbot label +A-LLVM +T-compiler |
We also observed that DWARF region increased significantly between the toolchain update:
Which may relate to the slower backtrace, but I still have no idea why it will segfault sometimes... |
I also had an idea that it may be related to the debuginfo=unpacked stabilization, but it turned out that |
segfault backtrace:
|
The latest nightly (2022-11-14) will still produce this segfault. It's somehow very easy to reproduce over the codebase, but some simple changes in the codebase (e.g., add a println before capturing backtrace) will make it magically work again. Maybe related: #47551? |
@rustbot label +A-LLVM +I-crash |
maybe related: https://bugzilla.mozilla.org/show_bug.cgi?id=1782160 |
Can be workaround by using rust-lld or LLVM 15 lld (brew install llvm@15)
So it looks like a bug with macOS's bundled linker?
|
Guess it's due to e2b52ff |
The segfault is a NPE |
This is wrong. risingwavelabs/risingwave@5e0b9d8 with homebrew's llvm15's lld segfaults with the same reason. |
Besides, I tested all 3 settings of |
I experience exactly the same issue in apollographql/router#5358
|
huuuh, that is very weird if it's faulting on a null pointer inside libunwind... |
Sorry for not having a MCVE for this issue. I'm still constructing it. For now I have to refer to a large codebase to reproduce the issue.
Basically, after we upgrade from nightly-2022-07-29 to nightly-2022-10-16, we found two things:
This issue is stably reproducible on some specific commits of our project with some specific way of compiling, so I guess it's probably not related to incremental compile. I guess it would be more likely to be a problem with the LLVM 15 upgrade in August or the std::backtrace::Backtrace stabilization.
Reproduce 1
On this commit: risingwavelabs/risingwave@227e9e5
In another terminal, use psql (Postgres's client) to connect to the program:
The program will immediately segfault in Backtrace::capture.
Interestingly, if we use
cargo build -p risingwave_cmd_all && ./target/debug/risingwave playground
, it works. The commit following the buggy commit risingwavelabs/risingwave@604a0a5 also magically resolves the issue with some random code change.Reproduce 2
On this commit: risingwavelabs/risingwave@484b9ab
In another terminal:
compute-node will also immediately segfault when capturing a backtrace.
Thanks for investigating into this!
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: