Skip to content

test(fuzz): v3 nesting-depth / stack-safety target #74

@membphis

Description

@membphis

Background

Part of the qjson fuzz harness (#63). #63's fuzz_parse_eager clamps
max_depth to 128 (to align with serde_json's default recursion limit and
avoid differential false positives at the boundary). As a result, the v1
target does not exercise:

  • qjson's real default depth (1024) or configurable ceiling (4096),
  • the validate_depth boundary (off-by-one: is N the last accepted or first
    rejected depth?),
  • decode-side stack safety under deep nesting.

(Note: #71 fixed a stack overflow on the encode side; this is the
decode/parse side, which is unrelated and currently uncovered.)

Depends on #63.

Goal

A non-differential fuzz target focused on nesting depth: confirm qjson
rejects over-deep input without panic / UB / stack overflow, and pin the exact
boundary behavior at the default (1024) and ceiling (4096).

Scope (this issue = one PR)

  • Add a fuzz target that generates deeply-nested {/[ inputs
    (e.g. length-bounded mutation of a nested skeleton).
  • Assert parse rejects beyond effective_max_depth with a clean error
    (no panic, no ASAN finding).
  • Cover default (1024) and ceiling (4096), and the just-below /
    just-above boundary cases.

Acceptance Criteria

  • Deeply-nested inputs never cause stack overflow or an ASAN report.
  • The depth boundary (accept N / reject N+1) is asserted and documented.

Affected files

  • fuzz/fuzz_targets/fuzz_depth.rs (new)

Part of #63. Depends on #63.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions