binutils: Fix fuzz_strings achieving 0% coverage #14782
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix binutils
fuzz_stringsfuzzer which was achieving 0% coverage due to missing initialization.Main Change
Fix missing global variable initialization in
fuzz_strings.cThe harness was not initializing important global variables, most importantly
string_min(minimum string length to print) which defaults to 0. This causesstringsto get stuck in an endless loop printing zero-length strings, likely explaining the 0% coverage.Further Changes
abort()inbfd/xsym.c- When--enable-targets=allis set,bfd_sym_read_header_v34()callsabort()for unimplemented v3.4/v3.5 xSYM format support, killing the fuzzer on malformed xSYM files. Replaced withreturn -1to fall back to internal error handling.Testing
24h test run coverage results:
Related
@DavidKorczynski - Sorry for the ping: The old seed corpus for strings was removed in #6717. What was the reasoning behind that? Was this AFL-specific, or is this still relevant now? Thanks!