Skip to content

Fix(SyncFromBrokerStage): report actual corpus_size in NewTestcase events#3756

Merged
domenukk merged 2 commits intoAFLplusplus:mainfrom
0xmuon:sync-broker
Apr 7, 2026
Merged

Fix(SyncFromBrokerStage): report actual corpus_size in NewTestcase events#3756
domenukk merged 2 commits intoAFLplusplus:mainfrom
0xmuon:sync-broker

Conversation

@0xmuon
Copy link
Copy Markdown
Contributor

@0xmuon 0xmuon commented Mar 15, 2026

Description

I investigated how Event::NewTestcase { corpus_size, etc} is produced in fuzzer/mod.rs and consumed by the broker in events/simple.rs (via update_corpus_size on the client stats). In that path, corpus_size is clearly treated as clients current corpus size, not as a placeholder.
also to find behavior of SyncFromBrokerStage, I built and ran a custom multiclient fuzzer (sync_broker_test, which uses SyncFromBrokerStage) with --cores 0,1,2. I then set corpus_size set to both 0 and state.corpus().count() and tested, by adding temporary logging behind SYNC_CORPUS_SIZE flag to see the exact values being sent during sync(logs not included in commit as not needed). While the minimal tests UI did not visibly break when corpus_size was 0, the logs showed that SyncFromBrokerStage was the only NewTestcase producer that did not report the real state.corpus().count().Therefore, SyncFromBrokerStage now sends the actual state.corpus().count() as corpus_size, so all NewTestcase events follow the same semantics and future monitoring does not need to special‑case a hardcoded 0.
I can provide that fuzzer if you need.

  • Tested locally via custom fuzzer(I tried using nautilus_sync example in multiclient but during runtime I couldn't see any response,so shifted to creating a different local fuzzer focused on using syncfrombrokerstage)

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

@0xmuon 0xmuon changed the title SyncFromBrokerStage: report actual corpus_size in NewTestcase events Fix(SyncFromBrokerStage): report actual corpus_size in NewTestcase events Mar 20, 2026
@domenukk domenukk merged commit 69f2f93 into AFLplusplus:main Apr 7, 2026
112 checks passed
@domenukk
Copy link
Copy Markdown
Member

domenukk commented Apr 7, 2026

Thanks!

Aditya30ag pushed a commit to Aditya30ag/LibAFL that referenced this pull request Apr 8, 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