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

Cannot find code addresses starting from version 0.14.1 #542

Closed ThibsG closed 3 years ago

ThibsG commented 4 years ago

First of all, thanks for this amazing tool that helps getting better code :wink:

I've been running following command line in our CI: cargo tarpaulin --force-clean -v -f -t 7200 --out Xml --ignore-tests --exclude-files resources/*

Getting this error:

...
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x156c3e8
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x17eeb77
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x17eec3f
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x18b6ea2
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x17e9694
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x17f6064
[DEBUG tarpaulin] Instrumentation address clash, ignoring 0x17eec8c
[ERROR tarpaulin] Failed to get test coverage! Error: Failed to run tests: ERROR: Tarpaulin cannot find code addresses 
check that pie is disabled for your linker. If linking with gcc try adding -C link-args=-no-pie to your rust flags
Error: "Failed to get test coverage! Error: Failed to run tests: ERROR: Tarpaulin cannot find code addresses 
check that pie is disabled for your linker. If linking with gcc try adding -C link-args=-no-pie to your rust flags"

After investigating, running with version 0.14.0 is fine, but running >=0.14.1 is not.

I am not so worried about Instrumentation address clash, though it doesn't appear in 0.14.0.

This is a closed source project so I can't share the code, and it's pretty big, not sure i'll be able to minimize it. Anyway feel free to ask me if you need more info or if I can run some tests

xd009642 commented 4 years ago

I wouldn't be too worried about the instrumentation clash. An instruction can be anywhere in a word, but instrumentation points need to be word aligned. So that just shows you have two recognised instructions in one word. The 0.14.0 to 0.14.1 issue is strange... I don't see anything in the changelog that could contribute to that :thinking:

I'm working on some big changes right now which will impact linker based things though so when I've got it to a point where it looks like it's all working for me I'll ping you and ask you to test it out. There's a reasonable chance it could sort this out :+1:

ThibsG commented 4 years ago

Nice! I'll stay tuned, thank you

ThibsG commented 3 years ago

Upgrading to version 0.15.0 solved this issue. Thanks a lot :wink: