tests: internal: fuzzers: avoid destroying active input fuzzer tasks#11850
Conversation
8e12f39 to
b11e8a0
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughInput fuzzer malloc-failure injection is limited to OSS-Fuzz builds; a third fuzz-derived input buffer is allocated with null-checks; cleanup skips destroying in-use tasks/chunks; the function returns 0 after stopping and destroying the Fluent Bit context. ChangesInput fuzzer stability improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/internal/fuzzers/input_fuzzer.c`:
- Around line 75-77: When checking the result of the third allocation
(input_buffer3 == NULL) you must free previously allocated buffers to avoid
leaks; update the error path that currently returns 0 to call
free(input_buffer1) and free(input_buffer2) (matching the pattern used in the
other allocation-failure blocks) before returning, ensuring all three buffers
are freed on any allocation failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 69ffd30a-da59-4a57-9633-c769a56d89dd
📒 Files selected for processing (1)
tests/internal/fuzzers/input_fuzzer.c
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
b11e8a0 to
c175746
Compare
Fix the input fuzzer teardown path so it does not force-destroy tasks or chunks that are still owned by the engine.
The OSS-Fuzz crash was caused by the harness destroying active tasks while output completion events were still pending. That cleared the task map entry, and the engine later dereferenced the missing task from
handle_output_event().This keeps the forced cleanup limited to idle test tasks with no users, retries, or routes, and skips chunks still attached to a task.
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit