Merged
Conversation
fmeum
reviewed
Nov 5, 2025
src/main/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentor.kt
Show resolved
Hide resolved
231fcbc to
f31e023
Compare
Using ClassWriter without ClassReader in asm, seems to produce
corrupted bytecode for nested records and records with annotated fields.
Prior to this fix, a segfault was triggered for nested records that
use Jazzer annotations when Jazzer was trying to access data on record
components, when trying to create a record mutator.
In addition, for non-nested records with annotated fields as for example:
record Address(byte @WithLength(max=10) [] data) {}
no suitable mutator could be found.
f31e023 to
4d18863
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the TraceDataFlowInstrumentor that could cause segfaults when instrumenting classes with nested records, and adds a regression test to prevent this issue from recurring.
- Fixed
ClassWriterinitialization to passClassReaderfor proper constant pool reuse - Added regression test for fuzzing classes with nested record types
- Configured test with Java 17 support (required for records)
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentor.kt | Fixed ClassWriter initialization to pass ClassReader for improved compatibility with complex class structures like nested records |
| tests/src/test/java/com/example/NestedRecordFuzzer.java | Added regression test to verify correct instrumentation of fuzz test classes containing nested records |
| tests/BUILD.bazel | Added build configuration for NestedRecordFuzzer test with Java 17 support and appropriate dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
simonresch
approved these changes
Nov 11, 2025
Contributor
simonresch
left a comment
There was a problem hiding this comment.
Very good find!
As discussed: Let's merge this and continue to reduce the ASM and/or JVM bug independently.
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.
Using ClassWriter without ClassReader in asm, seems to produce
corrupted bytecode for nested records and records with annotated fields.
Prior to this fix, a segfault was triggered for nested records that
use Jazzer annotations when Jazzer was trying to access data on record
components, when trying to create a record mutator.
In addition, for non-nested records with annotated fields as for example:
record Address(byte @WithLength(max=10) [] data) {}no suitable mutator could be found.