Skip to content

[zig] fix fuzz crash #7740

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

Closed
wants to merge 1 commit into from
Closed

[zig] fix fuzz crash #7740

wants to merge 1 commit into from

Conversation

lukewilliamboswell
Copy link
Collaborator

This debug assertion was causing the parser to crash. Removing it seems to resolve the issue.

@gamebox does this look ok?

$ zig build snapshot -- src/snapshots/fuzz_crash/fuzz_crash_018.txt
thread 4022156 panic: reached unreachable code
/Users/luke/zig-macos-aarch64-0.14.0/lib/std/debug.zig:522:14: 0x104f47c93 in assert (snapshot)
    if (!ok) unreachable; // assertion failure
             ^
/Users/luke/Documents/GitHub/roc/src/check/parse/IR.zig:989:33: 0x10503eb3b in addPattern (snapshot)
                std.debug.assert(a.patterns.span.len > 1);
                                ^
/Users/luke/Documents/GitHub/roc/src/check/parse/Parser.zig:1177:33: 0x10506cb93 in parsePattern (snapshot)
    return self.store.addPattern(.{ .alternatives = .{
                                ^
/Users/luke/Documents/GitHub/roc/src/check/parse/Parser.zig:1187:29: 0x105084e73 in parsePatternWithAlts (snapshot)
    return self.parsePattern(.alternatives_allowed);

<snipped...>

Copy link

Thank you for your contribution! Sometimes PRs end up staying open for a long time without activity, which can make the list of open PRs get long and time-consuming to review. To keep things manageable for reviewers, this bot automatically closes PRs that haven’t had activity in 60 days. This PR hasn’t had activity in 30 days, so it will be automatically closed if there is no more activity in the next 30 days. Keep in mind that PRs marked Closed are not deleted, so no matter what, the PR will still be right here in the repo. You can always access it and reopen it anytime you like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants