xd009642 / tarpaulin

A code coverage tool for Rust projects
https://crates.io/crates/cargo-tarpaulin
Apache License 2.0
2.5k stars 180 forks source link

Non-fatal signals treated as fatal #1390

Open dfoxfranke opened 1 year ago

dfoxfranke commented 1 year ago

I'm trying to use tarpaulin to get a coverage report for my crate hw-exception. This crate is designed for, among other things, handling and recovering from segfaults. Unsurprisingly, it has tests which segfault, and then recover. Tarpaulin, however, panics as soon as ptrace notifies it of the segfault, without seeing whether the program being traced is going to handle the signal. It is therefore unable to give me a useful coverage report.

xd009642 commented 1 year ago

If you run with --engine=llvm you may circumvent a lot of complexity with handling signals. Provided this isn't another edge case llvm coverage fails to handle.

dfoxfranke commented 1 year ago

Thanks, that did the job. Feel free to close this issue or to leave it open if you care to address the ptrace engine.

xd009642 commented 1 year ago

Good to hear :+1:

I'll keep it open for now to remind me to investigate, if it proves too tricky to do with ptrace I'll close it later on as a won't fix and just recommend people use --engine llvm