More minor fuzzing cleanups - #818
Conversation
d58b2a2 to
d467999
Compare
| $(fuzzers) :: fuzz-% : test.c fuzz-%.c $(fuzz-%_FILES) | ||
| $(CC) $(CFLAGS) -o $@ $(sort $^ $(wildcard $*.c) $(fuzz-$*_FILES)) libefi-test.a -lefivar | ||
| mkdir -p $@-corpus | ||
| cd $@-corpus ; LLVM_PROFILE_FILE="$@.profraw" ../$@ \ |
There was a problem hiding this comment.
Since you're already doing extra cleanup:
issue (non-blocking): write one profile per fuzz worker
The fuzzer starts 24 workers with -jobs=24, but they all write to the
same LLVM_PROFILE_FILE. Their exit-time profile writes can race or overwrite
one another, so the resulting coverage data is incomplete or unreliable.
LLVM supports %p for per-process filenames:
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#id4
Could we use LLVM_PROFILE_FILE="$@.%p.profraw", merge the shards with
llvm-profdata merge, then remove them after a successful merge? My understanding is that cov-analysis doesn't use these files, but llvm-cov does, and it would be nice to have correct results.
There was a problem hiding this comment.
That sounds good. Can you submit a PR for that?
"make fuzz-clean" is trying to remove valgrind files that fuzz no longer generates, as well as log files that are no longer in the top-level directory. This removes the valgrind bits and fixes the directory. Signed-off-by: Peter Jones <pjones@redhat.com>
During some testing I noticed "make clean" when cross-building for Aarch64 included gcc complaining about "-mstrict-align", which is weird because aarch64-linux-gnu-gcc supports that just fine. Turns out it's because the test makefile is always using 'gcc', and that means it's calling 'gcc $(ARCH_CFLAGS) ... -print-file-name=include-fixed' to figure out compiler arguments that don't matter for the clean target. Since we don't actually have any support for using the cross-compiler to build test or fuzz targets, as we would have no way to run them, this will always happen and it'll always be dumb. This change makes it so Instead we just don't descend into those makefiles if we're just cleaning and not actually building/running the tests or fuzzers. Signed-off-by: Peter Jones <pjones@redhat.com>
Currently there are three top-level "make fuzz" targets aside from our individual fuzzers: "fuzz", "fuzz-lto", and "fuzz-coverage". The last two were copy pasted from "make test" rules, and they make no sense here. Additionally, the "make fuzz" rule itself makes no sense as given, since it'll try to run all the fuzzers, one at a time, each with no time limit. This patch removes the two dumb rules and adds a 60-second limit to the main rule. Signed-off-by: Peter Jones <pjones@redhat.com>
d467999 to
de2b4e0
Compare
No description provided.