-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
capturing stack backtrace becomes slower and sometimes segfaults on Apple Silicon #104388
Copy link
Copy link
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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