🧪 Fuzz parser totality against hostile input

Open Beginner friendly
#85 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
compilers, testing

Research direction

Read engine/parser.go:31-54 and the existing cases in engine/parser_test.go:24-230, then run the specified seed-corpus command. Add engine/parser_fuzz_test.go with FuzzParser using a fresh zero VM and parser, the six listed seeds, and an 8 KiB bound. Verify that the seed and 30-second fuzz commands complete without a panic.

Written by the indexing model from the issue text.

Description

Summary

NewParser accepts arbitrary rune input through io.RuneReader in engine/parser.go:31-54, while engine/parser_test.go:24-230 provides a finite table corpus. The parser must return a term or error for hostile input without panicking.

Why it matters

Parser panics turn malformed source into a host failure rather than a Prolog parse error and can expose untested lexer-parser state transitions.

Scope

Add engine/parser_fuzz_test.go with FuzzParser. Use a fresh zero VM and parser for each input, bound inputs to 8 KiB, and seed "", "foo.", "[", "'don''t panic'.", "9223372036854775808.", and "tag{x:}.".

Acceptance criteria

  • FuzzParser creates a fresh zero VM and parser for every fuzz input.
  • Inputs longer than 8 KiB are skipped or otherwise bounded before parsing.
  • The seed corpus contains all six specified inputs.
  • Every seed and fuzz input returns a term or error without panicking.
  • A 30-second fuzz run completes without a panic.

Verification

Run the seed corpus through go test ./engine -run '^FuzzParser$' and run go test ./engine -run '^$' -fuzz '^FuzzParser$' -fuzztime=30s; both commands must complete without a panic.

Dominant language
Go
Stars
5
Forks
0
Avg merge
6h 36m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from axone-protocol/prolog

All issues in axone-protocol/prolog

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.