Skip to content

ci(fuzz): the nightly runs each target for its whole time budget and fails on a crash (#187) - #232

Merged
DrunkOnJava merged 2 commits into
mainfrom
ci/fuzz-nightly-fails-on-crash
Oct 26, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
ci/fuzz-nightly-fails-on-crash

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

The nightly fuzz workflow could not fail and did not fuzz for its budget. Each target's run step had continue-on-error: true and ended in 2>&1 | head -n 500 || true, and -runs=100000 stopped libFuzzer after about 11 seconds of the documented 300. This removes all three, so the time budget alone ends a clean run and a crash, leak or timeout fails that target's job. Refs #187.

Spec reference

No spec section. Fuzzing: #187 (every target run for an hour with no findings; durations recorded).

Changes, all in .github/workflows/fuzz-nightly.yml:

  • No continue-on-error, no | head -n 500 || true: libFuzzer's exit status reaches the job. head closing early could also SIGPIPE the fuzzer once its output passed 500 lines.
  • No -runs=100000: -max_total_time governs, as the header comment always said.
  • -print_final_stats=1, so every run records executions and peak RSS (Every fuzz target run for an hour with no findings #187 asks for recorded durations).
  • The dispatch input and target reach the script through env: instead of ${{ }} inside run:.
  • timeout-minutes 10 → 15, room for a cold-cache release build (the first nightly after deps(deps): bump libfuzzer-sys from 0.4.12 to 0.4.13 in /fuzz in the fuzz group #200 changes the fuzz lockfile) before the 300 s budget starts.

Test plan

Dispatched on this branch with a 60 s budget, run 40296541245 (before the timeout change, which no 60 s run approaches):

Target Result Executions Note
header_vars pass 7,342,634 Done ... in 61 second(s)
dwg_file_open pass 5,079,955 61 s
bitcursor_primitives pass 3,511,669 61 s
object_walker pass 2,699,436 61 s
rs_fec_decode pass 633,520 61 s
lz77_decompress pass 604,228 61 s
classmap_parse pass 574,627 61 s
section_map fail 179 panic at src/handle_map.rs:102:33, "slice index starts at 2 but ends at 1", input AAEABAoAAAA=
handlemap_parse fail 13 same panic, input AAEAAAAQEjQAAA==

The last scheduled nightly on main (run 40277371843, 2026-10-26 06:00 UTC) reported all nine green, each having stopped at Done 100000 runs in ~11 second(s); the same panic is reachable from both targets' seeds within seconds, and the old step could not have reported it.

After this merges the nightly is red until the handle-map fix lands (#231). A red nightly is then a real finding, not a workflow regression; land #231 first or together.

actionlint clean. No code or tests change.

Source-provenance declaration

By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported.
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

CI configuration only; libFuzzer flags from its own documentation.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.

@DrunkOnJava DrunkOnJava added type:ci Workflows and automation area:fuzz Fuzz targets and their corpora labels Oct 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:31:54.580013Z 788e039 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 10:30
@DrunkOnJava
DrunkOnJava merged commit 6be06b2 into main Oct 26, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/fuzz-nightly-fails-on-crash branch October 26, 2026 10:49
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
…ile, not a panic (#271)

The fuzz nightly (#187, made able to fail by #232) found it on its first strict run: dwg_file_open panicked at src/r2007.rs:353 with 'attempt to add with overflow'. load_system_page computed span with saturating multiplies, then sliced bytes[offset..offset + span]; a hostile header makes span usize::MAX, so the sum overflows (a panic in debug and fuzz builds, a silent wrap in release).

The same unchecked offset + length pattern sat at four more places that take both values from the file: the file-header payload (0x20 + stored), section-map names (pos + name_len) and data pages (base + span, base + compressed). All five now build their range with checked_range(start, len), which is None on overflow, so each falls into the Truncated or SectionMap error it already reported. align_up saturates instead of overflowing.

The crash input is committed as a dwg_file_open fuzz seed. On it, a debug dwg-info built from main exits 101 with the panic; built from this branch, it exits 0 and reports the container as _R2007_UNREADABLE, the reader's existing fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:fuzz Fuzz targets and their corpora type:ci Workflows and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant