-
Notifications
You must be signed in to change notification settings - Fork 860
Fuzz with start functions #8736
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
Open
kripken
wants to merge
24
commits into
WebAssembly:main
Choose a base branch
from
kripken:fuzz.start
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d2615d9
go
kripken f8d9cf8
fmrt
kripken a8fff04
fix
kripken d1a7722
fix
kripken dc8b327
fix
kripken eb6b0a7
fix
kripken 7b55ead
fix
kripken c02bb91
fix
kripken a52568a
fix
kripken b6c1171
fix
kripken 7b4a11b
fix
kripken 4dde53b
fix
kripken 684b058
fix
kripken 5f08a1f
fix
kripken 4a1a9a0
fix
kripken b5bed35
fix
kripken c62d304
go
kripken 07c2def
fix
kripken 1e1b500
fix
kripken 46204f8
fix
kripken 9d2c970
fix
kripken a34be63
Merge remote-tracking branch 'origin/main' into fuzz.start
kripken 2edd71a
10
kripken 11880d4
filter imports earlier
kripken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we can still throw an exception or trap in the start function, how bad would it be for us to allow calling imports? The worst they can do is throw, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reentrancy is even worse than throwing. It doesn't necessarily throw, in fact - it might call an import that calls exports with a try-catch, swallowing the exception on no exports existing. I took a look at some stuff here and it was not fun.
Though maybe this is important to fuzz for VM errors, even if it isn't for real-world code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess if it silently messes up the fuzz_shell.js state, that would be bad. But I'm not sure how that would happen. Maybe we can add an
initializationFinishedflag infuzz_shell.jsand add logging with early exits to all the imports we provide (or maybe just those that would call back in to exports).But if there are problems that would require more invasive fixes than that, then avoiding the issue by removing calls sounds ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I found a testcase and reminded myself why this is so bad. This is confusing in VMs, but in wasm-opt's own interpreter, it just breaks entirely. We are still running initialization and I guess in the C++ constructor, when this reentrancy happens, leading to crashes. Might be worth looking into it but it could require a large refactoring of our interpreter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah doing fallible work in a constructor isn't great. Want to at least add a TODO about doing that refactoring and allowing fuzzing of start functions calling other functions, including imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added in the last commit actually.