fix: clear last finding before starting a fuzzing run#944
Merged
Conversation
florianGla
approved these changes
Aug 12, 2025
81607c0 to
e2955c7
Compare
a699b98 to
33555ab
Compare
Marcono1234
reviewed
Aug 13, 2025
src/test/java/com/code_intelligence/jazzer/junit/FuzzingAfterRegressionCrashTest.java
Show resolved
Hide resolved
Marcono1234
reviewed
Aug 14, 2025
examples/junit/src/test/java/com/example/FuzzTestWithCrashTest.java
Outdated
Show resolved
Hide resolved
373876e to
de8e474
Compare
Prior to this commit, if last input in regression mode resulted in a finding, the first fuzzer input (null bytes) always produced a finding and a crashfile with 0 bytes. This commit clears last finding before starting the fuzzing run
de8e474 to
cc1923f
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where empty crashfiles (0 bytes) were incorrectly generated when the last input in regression mode resulted in a finding. The fix clears the last finding state before starting a fuzzing run to prevent false positives.
Key changes:
- Added logic to clear the last finding before fuzzing starts
- Created comprehensive test coverage to verify the fix
- Excluded the new test class from existing regression tests to avoid interference
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| FuzzTestExtensions.java | Added code to clear last finding state before fuzzing |
| FuzzingAfterRegressionCrashTest.java | New test class to verify the fix works correctly |
| BUILD.bazel | Added build configuration for the new test |
| RegressionTestTest.java | Excluded new test class to prevent interference |
| FuzzTestWithCrashTest.java | New example test class that triggers the bug scenario |
| crash | Test input file that causes a crash for regression testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/java/com/code_intelligence/jazzer/junit/FuzzTestExtensions.java
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/junit/FuzzTestExtensions.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prior to this PR, if last input in regression mode resulted in a finding, the first fuzzer input (null bytes) always resulted in a finding too and a crashfile with 0 bytes was always created.