Feature request: Catch segfault and show stacktrace in result #3413
Replies: 1 comment
-
|
Thanks. This is somewhat tricky -- is your use case CI or local? I think the first step here would be writing a little script or library which does this (on Linux/glibc and macOS this is probably an LD_PRELOAD shim that injects a signal handler), and passing it in as either a wrapper script or I had Claude build a prototype that seems to work on Linux, though I haven't looked at the code at all; feel free to take it from there or start from scratch. Anything that eventually ships with nextest will probably need to be pure Rust so |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
When writing unit tests for FFI or unsafe code, it can often be the case that the test will fail not with a panic, but with a segfault. In this case, the logs don't provide much information, only giving a single line "(test aborted with signal 11: SIGSEGV)", requiring more in-depth investigation to debug the issue. It'd be nice if cargo nextest could give a bit more information to allow a first level of investigation.
Proposal
It'd be nice for cargo-nextest to catch sigsegv signals that happen in the child process, and print a stacktrace of the crashing thread.
Alternatives
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions