Repository navigation
fix(ci): size the nightly fuzz batch to its timeout, fix the crashes it hid - #531
Merged
Merged
Conversation
…it hid Refs #514. The nightly `batch` job was cancelled at its 2 h timeout on 11 of the last 16 nights. Timeout. 204 targets get 17 s each from ClusterFuzzLite, but start/stop, corpus clone and corpus push add ~6.6 s per target (23.6 s wall, 33 s max), so the run takes ~80 min for a 1 h budget. The build grew from 14-31 min to 34-56 min on 2026-11-12. Setup + build + run reached 120 min whenever the build took more than ~38 min (11-27: build 42 min, run 77.6 min, cancelled at target ~198 of 204). A cancelled run never uploads its crashes. - Timeout 120 -> 180 min. A new `Fuzz budget` step gives the targets the time left until the timeout (minus 15 min and 10 s per target), at most 3600 s, and fails fast when a target would get under 5 s. - A new `Wait for the storage repository` step outlasts a transient GitHub 403: on 2026-11-20 the clone returned 403 six times in 31 s and cifuzz gave up with exit 128. - `scripts/fuzz-issue.sh`: a timed-out job (annotation `exceeded the maximum execution time`) is a failure and updates the issue; a cancel by hand still changes nothing. The issue lists the failed jobs and steps and shows git errors and tracebacks, not only crashes (11-20 said `no crash lines found`). `report` jobs get `checks: read`. - `scripts/fuzz-issue_test.sh` runs in the CI job `go` (13 of its checks fail against the old script). Crashes the nightly run reported or hid: - rubygems `FuzzMarshalRoundTrip` (the recurring `Not reproducible` crash): the oracle demanded a round trip for any requirement, but `DecodeSpecification` rejects more than 64 clauses (#421). NUL bytes in the `%+v` failure message cut the log, so the crash file name was lost and ClusterFuzzLite re-ran another file. Reproduced with the OSS-Fuzz shim: the old build crashed 9 of 12 jobs in three 17 s runs and exits 77 on the saved input; the new build ran 12 of 12 jobs clean and exits 0. The oracle now asserts the cap; `rubymarshal.MaxRequirementClauses` is exported. - rubygems `FuzzServeGemGet`: the oracle did not strip the query string. - conda `FuzzParsePackageIndex`: the oracle read numbers as float64. The product bug behind it is real: PostgreSQL jsonb refuses numbers beyond numeric, so an upload with `"platform": 1e131072` failed the INSERT. `jsonbRefuses` now drops such keys like it drops NUL. Checked against PostgreSQL 18 with 20000 boundary literals: none accepted that jsonb refuses. - docs/development/fuzzing.md: time budget, storage wait, issue rules, and the real artifact layout of the OSS-Fuzz shim (go-fuzz-headers).
Coverage
Go by area
Web by area (lines)
|
Collaborator
Author
|
Batch workflow dispatched on this branch to prove the job ends inside its timeout: https://github.com/openartifact/openartifact/actions/runs/46039173202 (result in a follow-up comment). |
Merged
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.
Refs #514. The tracking issue stays open until a nightly run passes; the next passing run closes it.
Root causes (from the run logs)
1. Time, not a hang. The
batchjob was cancelled at its 120 min timeout on 11 of the last 16 nights (11-19, 11-21 to 11-27).fuzz-seconds / targets= 17 s and counts nothing else. Per target, libFuzzer start/stop (~1.6 s), the corpus clone/fetch (~1.2 s) and the corpus upload bygit commit+git push(~3 s) come on top: 23.6 s wall on average (23.57 / 23.78 / 23.67 s on 11-18 / 11-21 / 11-27, 33 s max). TheRun fuzzersstep takes ~80 min for a "1 hour" budget.Build fuzzersstep took 14-31 min up to 11-11 and 34-56 min from 11-12 on, for the same 204 targets (runner CPU variance).cancelled, SARIF upload skipped, annotationThe job has exceeded the maximum execution time of 2h0m0s.upload_crashes()runs after the loop), and thereportjob ignoredcancelled.2. The 11-20 failure (run 44719092556, job 136229890096) was a different failure mode. The build was fine. The first thing
Run fuzzersdoes,git cloneof the storage repository, returnedHTTP 403six times (fatal: unable to access ... The requested URL returned error: 403, back-off 1/2/4/8/16 s), thenRetrying on GitFilestore._clone failedandCalledProcessError ... exit status 128. The token check 35 min earlier had passed andprunecloned fine an hour later, so the 403 was transient.scripts/fuzz-issue.shprintedno crash lines found in the failed logbecause it only grepped crash patterns.3. A real crash hid behind "Not reproducible" (
FuzzMarshalRoundTrip, in every log since 11-11). The oracle demanded a round trip for any requirement, whileDecodeSpecificationrejects more than 64 clauses (maxSpecClauses, #421, the hostile-gemspec hardening of 11-04):rubymarshal: invalid data: 103 requirement clauses exceeds maximum 64. The failure message printed the specification with%+v, its string fields hold NUL bytes, and libFuzzer copies the message to the log only up to the first NUL. TheTest unit written toline was lost with it, so ClusterFuzzLite re-ran a different file (Reproduce command returned: 0. Not reproducible) and passed the target.I reproduced it with the exact OSS-Fuzz Go shim (
go-118-fuzz-build, ASAN, the CI flags-jobs=4 -workers=4 -max_total_time=17 -len_control=0and the stored corpus, 178 files): the old build crashed 9 of 12 jobs in three 17 s runs and exits 77 on the saved input; the new build ran 12 of 12 jobs clean and exits 0 on it. It is not a product bug: the decoder only runs on uploads, and the cap is deliberate. The oracle now asserts the cap,rubymarshal.MaxRequirementClausesis exported instead of duplicated, and the messages print%#v.The same 11-21 set held two more crashes:
FuzzServeGemGet(gems/nokogiri-1.16.2-x86_64-linux.gem?;): the oracle did not strip the query string.FuzzParsePackageIndex(117255555555555e5555): the oracle decoded numbers as float64. The oracle was wrong, but it pointed at a real bug: PostgreSQL jsonb refuses numbers beyondnumeric(value overflows numeric format, 22003), so an upload with"platform": 1e131072failed the INSERT with a 500.jsonbRefusesnow drops such keys, like it already did for NUL. A differential run against PostgreSQL 18 with 20000 boundary literals found 0 accepted that jsonb refuses; the only difference was a harmless over-strict refusal of zero-valued numbers with absurd exponents.All three have a seed under
testdata/fuzz/and a behaviour test (TestSpecificationRequirementClauseCap,TestPackageIndexJSONBNumbers); the seeds fail on the old oracle with the CI error text.Changes
clusterfuzzlite-batch.yml: timeout 120 -> 180 min. AStart the clockstep records the deadline, aFuzz budgetstep gives the targets the time left (minus a 15 min reserve and 10 s overhead per target), at most the 3600 s of today, and fails fast naming the build when a target would get under 5 s. A normal night keeps the full 3600 s; a 110 min build gets ~6 s per target instead of being cancelled. AWait for the storage repositorystep (git ls-remote, 20 tries x 30 s) outlasts the transient 403.scripts/fuzz-issue.sh: a job that hit its timeout (annotationexceeded the maximum execution time) is a failure and updates the issue; a cancel by hand still changes nothing. The issue lists the failed jobs and steps and shows git errors, tracebacks and::error::lines. Thereportjobs of the batch andapi-fuzzgetchecks: read.scripts/fuzz-issue_test.sh, run in the CI jobgo: timeout, cancel by hand, the 11-20 failure, a crash, a silent failure, success. 13 checks fail against the old script.docs/development/fuzzing.md: time budget, storage wait, issue rules, and the real artifact layout of the OSS-Fuzz shim (go-fuzz-headers; the page described another layout).Checks
scripts/fuzz-issue_test.sh,shellcheck,actionlinton the three workflows: pass. The budget and wait steps were run with fake deadlines and a stubgit(3600 s after a 43 and 56 min build, 1224 s after ~110 min, error at 60 and 25 min left, error with no targets, a flaky 403 recovers, a down storage fails).go test -short ./pkg/rubymarshal/... ./internal/format/rubygems/... ./internal/format/conda/...andgolangci-linton them: pass.