fuzz_parse_test.nx
buildroot/runtime/fuzz_parse_test.nx
about
fuzz_parse_test.nx -- mutational fuzz against parse_module.
FINDING (2026-04-24 first run of this harness):
Mutated input derived from the 'add' seed reliably hangs
parse_module under qemu. Timeout >60s at iteration 1.
The lexer completes (lex done fires); parse_function enters
(per-function name marker fires: 'add :'), then never returns.
This is an infinite loop in parse -- a real, previously
undetected vulnerability to malformed input.
Root-cause investigation: follow-up commit using the new
nx_panic_ctx + memcap + guards + GDB-via-qemu infra.
Likely similar structurally to the skip_ws_comments '/'
infinite-loop we found at bootstrap stage-2.
This file is currently configured with ITERS=0 to keep the F6
gate green. When the parser is hardened against mutation-
induced hangs, bump ITERS back up and keep it as a regression
harness.
The VALUE of this file: it documents a live parser
vulnerability that must be fixed before NishiLang is safe to
run on untrusted input (life-or-death requirement).
Parse-fuzz is re-enabled by raising FUZZ_ITERS in the const
below once the underlying hang is fixed.
dependencies 6 imports · 0 importers
imports: syscalls.nxtypes.nxlex_kinds.nxlex.nxparse.nxnx_fuzz.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 54 | const FUZZ_ITERS: i64 = 100 |
| 55 | const FUZZ_MAX_INPUT: i64 = 128 |
functions
| 57 | func main() -> i64 { |