Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Failed to load coverage / book Coverage page specifies the wrong binary path for tutorial. #41

Open
cameronelliott opened this issue Jan 28, 2024 · 0 comments

Comments

@cameronelliott
Copy link

Again, thanks to the creators of both the fuzzer and the book. They are both great.

I ran through this tutorial on two systems: https://rust-fuzz.github.io/book/cargo-fuzz/coverage.html

While using the rust-url project for the coverage tutorial.

On both systems, this command from the tutorial was failing:
$ cargo cov -- show fuzz/target/<target triple>/release/my_compiler \ --format=html \ -instr-profile=fuzz/coverage/my_compiler/coverage.profdata \ > index.html

with the error:
error: Failed to load coverage: 'fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_1': No coverage data found

If you run ls **/fuzz_target_1 You will see there are two binaries.

ls output:

[...]
-rwxrwxr-x 2 c c 22474312 Jan 27 16:57 fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_1*
-rwxrwxr-x 2 c c 22787384 Jan 27 16:58 target/x86_64-unknown-linux-gnu/coverage/x86_64-unknown-linux-gnu/release/fuzz_target_1

Using the first path, as per the rust-fuzz coverage tutorial will result in the error:
error: Failed to load coverage: 'fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_1': No coverage data found

using the second path, under target fixed the issue for me on both macos and linux.

the coverage page tutorial should be fixed
I suggest the coverage page tutorial be hardcoded to the rust-url example also

please let me know if a PR is desired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant