Skip to content

Can the compilation flags -fsanitize-coverage=trace-pc-guard and -fprofile-instr-generate -fcoverage-mapping be used together? #1742

Answered by vanhauser-thc
blu3sh0rk asked this question in Q&A
Discussion options

You must be logged in to vote

you give no context so I can only speculate what you want to achieve and what your setup is :)

you cannot not use -fsanitize-coverage=trace-pc-guard directly. If you do you will see:

[!] WARNING: Found '-fsanitize-coverage=trace-pc-guard' - stripping!

however just set AFL_LLVM_INSTRUMENT=LLVM-NATIVE and it does that behind the scenes.

I think it is possible to use this together with -fprofile-instr-generate -fcoverage-mapping. If you do that for the binary for fuzzing it will obviously run slower because of that.
do you should have two binaries, one for fuzzing, and a second comiled with coverage mappings to obtain coverage information which you can when you need it.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@blu3sh0rk
Comment options

@vanhauser-thc
Comment options

Answer selected by blu3sh0rk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants