Skip to content

More minor fuzzing cleanups - #818

Open
vathpela wants to merge 3 commits into
rhboot:mainfrom
vathpela:fuzz-cleanups-3
Open

More minor fuzzing cleanups#818
vathpela wants to merge 3 commits into
rhboot:mainfrom
vathpela:fuzz-cleanups-3

Conversation

@vathpela

Copy link
Copy Markdown
Member

No description provided.

@vathpela
vathpela marked this pull request as ready for review July 23, 2026 19:45
Comment thread include/fuzz.mk
$(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" ../$@ \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good. Can you submit a PR for that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Comment thread Makefile
vathpela added 3 commits July 27, 2026 14:51
"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>
@rhboot rhboot deleted a comment from codecov Bot Jul 27, 2026
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

Successfully merging this pull request may close these issues.

2 participants