Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: fix failures found with fuzzing #19873

Merged

Conversation

spytheman
Copy link
Member

  • parser: make the parser a bit more robust for fuzzed source code, and show more context on scanner fails for source code without backing .v files
  • parser: make the parser more robust for fuzzed source code

@spytheman spytheman changed the title parser fix failures found with fuzzing parser: fix failures found with fuzzing Nov 14, 2023
@spytheman
Copy link
Member Author

spytheman commented Nov 14, 2023

The used file was x_fuzz.v.txt
produced by editing examples/2048/2048.v so that [inline] was renamed to @[inline], then running:
zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > x_fuzz.v
Then v -g -d trace_parse_stmt cmd/tools/vtest-parser.v (to get more sensible backtraces),
then: v test-parser x_fuzz.v .

Thanks @joe-conigliaro for reporting the problem.

…useful for diagnosing problems when they happen
@joe-conigliaro
Copy link
Member

Thanks @spytheman, excellent work!

@spytheman spytheman merged commit 50c3e40 into vlang:master Nov 14, 2023
54 checks passed
@spytheman spytheman deleted the parser_fix_failures_found_with_fuzzing branch November 14, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants