Repository navigation
OSS-Fuzz: Add new fuzzer targets concurrency operations - #3679
arthurscchan wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Real-time sampling and reset deadlines prevent fast fuzz inputs from reliably exercising the intended limiter transitions.
1 open issue
What changed in this PR
This PR expands bRPC’s OSS-Fuzz coverage with a target for the automatic concurrency limiter.
Changes:
- Adds fuzz-driven response errors, latencies, and request concurrency values.
- Registers
fuzz_concurrencyin the CMake and OSS-Fuzz build lists.
| File | Description |
|---|---|
| test/fuzzing/oss-fuzz.sh | Includes the new target in OSS-Fuzz builds. |
| test/fuzzing/fuzz_concurrency.cpp | Adds the automatic concurrency limiter fuzz harness. |
| test/CMakeLists.txt | Registers the new CMake fuzz target. |
Review effort: Balanced
c4696bf to
f9e8d05
Compare
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
f9e8d05 to
0465080
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open issues
uint8_tandsize_t(and lateruint64_t/int64_t) are used without including standard headers… · New PassingnullptrintoOnRequestedrisks turning this into a trivial/null-deref fuzzer (depending… · New This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… · New This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… · New This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… · New
1 resolved since last review
Review effort: Lite
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
0465080 to
1d2b7ec
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
The bitfield documentation is internally inconsistent: the request-tick flag is described as `bits… · New Usingbutil::cpuwide_time_us()introduces non-determinism into the fuzzer execution (seed corpus… · New The(i & 7) == 0periodic tick is a magic constant that’s not explained. Please extract7/8… · New
5 resolved since last review
uint8_tandsize_t(and lateruint64_t/int64_t) are used without including standard headers… This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… This harness relies on several embedded protocol/magic constants (record size8, shifts/masks… PassingnullptrintoOnRequestedrisks turning this into a trivial/null-deref fuzzer (depending…
Review effort: Lite
| // | ||
| // Each 8-byte record is big-endian and decoded as: | ||
| // bits 0..7 error_code | ||
| // bits 8..15 request-tick flag (bit 8 / 0x100) |
| } | ||
|
|
||
| brpc::policy::AutoConcurrencyLimiter limiter; | ||
| int64_t now_us = butil::cpuwide_time_us(); |
| static_cast<int64_t>((v >> kLatencyShift) & kLatencyMask); | ||
| limiter.AddSample(error_code, latency_us, now_us); | ||
| limiter.MaxConcurrency(); | ||
| if ((v & (1ULL << kRequestFlagBit)) || (i & 7) == 0) { |



This PR adds a new OSS-Fuzz fuzzer targets concurrency operations, aiming to improve the overall fuzzing coverage and effectiveness of project brpc.