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

`--follow-exec` gives Instrumentation address clash and segfault #1153

Open mokhaled2992 opened 1 year ago

mokhaled2992 commented 1 year ago

I have a test binary that starts the main binary and tests its APIs. When I run tarpaulin with --follow-exec as follows

cargo tarpaulin --follow-exec --out Xml  --profile coverage --bin tests-bin --verbose

I get a segfault and the verbose output shows the following message

Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104eb5a
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104c927
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104f9d4
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x105103f
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104c554
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104c611
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104c7f2
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104febf
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104d914
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104fcda
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104ca3f
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1050df2
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1050e5a
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1051f14
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104ed3f
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x10521bf
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104fa91
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1050c11
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1051cd4
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x1051f72
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x10520a7
Dec 02 13:05:15.538 DEBUG cargo_tarpaulin::statemachine::linux: Instrumentation address clash, ignoring 0x104ec27
xd009642 commented 1 year ago

So one solution is --engine llvm that said I still aim to fix the issues with ptrace and follow-exec, they're just not the easiest things to debug