-
Notifications
You must be signed in to change notification settings - Fork 893
Fuzz waitqueue instructions #9012
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Some comments aren't visible on the classic Files Changed page.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,60 @@ | ||
| ;; RUN: wasm-fuzz-types -v --seed=3 | filecheck %s | ||
|
|
||
| ;; CHECK: Running with seed 3 | ||
| ;; CHECK-NEXT: Built 20 types: | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $0 (sub (shared (func (param i64 f64 exnref (ref null $0)) (result (ref cont)))))) | ||
| ;; CHECK-NEXT: (type $1 (shared (descriptor $2) (struct))) | ||
| ;; CHECK-NEXT: (type $2 (shared (describes $1) (descriptor $4) (struct (field (mut v128)) (field (mut (ref $4))) (field (mut v128)) (field (mut i32)) (field f32)))) | ||
| ;; CHECK-NEXT: (type $3 (array i8)) | ||
| ;; CHECK-NEXT: (type $4 (shared (describes $2) (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $5 (shared (descriptor $6) (struct (field f64) (field (ref $7)) (field (mut f64)) (field (mut (ref null (shared eq)))) (field (ref $11)) (field (ref (shared any)))))) | ||
| ;; CHECK-NEXT: (type $6 (shared (describes $5) (descriptor $7) (struct (field (mut i32)) (field (mut i16)) (field i64) (field f32) (field (ref null $11)) (field (mut f64))))) | ||
| ;; CHECK-NEXT: (type $7 (shared (describes $6) (descriptor $9) (struct (field i8) (field (mut f32)) (field (mut f64)) (field (mut i32)) (field (mut f32)) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $8 (sub (struct))) | ||
| ;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $11) (struct (field (mut v128)) (field (mut v128)) (field (mut f32))))) | ||
| ;; CHECK-NEXT: (type $10 (func (param f32 f64 f32))) | ||
| ;; CHECK-NEXT: (type $11 (shared (describes $9) (struct (field (ref (shared struct))) (field i32) (field f32) (field (mut (ref null (shared struct)))) (field i64) (field i32)))) | ||
| ;; CHECK-NEXT: (type $12 (sub (descriptor $13) (struct (field (mut i8)) (field f32) (field (mut v128))))) | ||
| ;; CHECK-NEXT: (type $13 (sub (describes $12) (struct (field i32) (field (ref $10)) (field i8) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $14 (sub $8 (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $15 (sub $8 (struct (field v128) (field (mut (ref null (shared struct))))))) | ||
| ;; CHECK-NEXT: (type $16 (shared (func (param (ref null $10)) (result (ref $6) i32 f64)))) | ||
| ;; CHECK-NEXT: (type $17 (sub final $12 (descriptor $18) (struct (field (mut i8)) (field f32) (field (mut v128)) (field (ref $17)) (field (mut i8)) (field (mut eqref))))) | ||
| ;; CHECK-NEXT: (type $18 (sub final $13 (describes $17) (struct (field i32) (field (ref $10)) (field i8) (field (mut i64)) (field (mut (ref null $11))) (field f64)))) | ||
| ;; CHECK-NEXT: (type $19 (sub $8 (struct (field (mut i8)) (field (mut v128)) (field v128) (field v128)))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK: Running with seed 3 | ||
| ;; CHECK-NEXT: Built 20 types: | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $0 (sub (shared (func (param i64 f64 exnref (ref null $0)) (result (ref cont)))))) | ||
| ;; CHECK-NEXT: (type $1 (shared (descriptor $2) (struct))) | ||
| ;; CHECK-NEXT: (type $2 (shared (describes $1) (descriptor $4) (struct (field (mut v128)) (field (mut (ref $4))) (field (mut v128)) (field (mut i32)) (field f32)))) | ||
| ;; CHECK-NEXT: (type $3 (array i8)) | ||
| ;; CHECK-NEXT: (type $4 (shared (describes $2) (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $5 (shared (descriptor $6) (struct (field f64) (field (ref $7)) (field (mut f64)) (field (mut (ref (shared i31)))) (field (mut (ref $11))) (field (ref (shared i31)))))) | ||
| ;; CHECK-NEXT: (type $6 (shared (describes $5) (descriptor $7) (struct (field (mut i32)) (field (mut (ref null $0))) (field (ref null (shared i31))) (field (mut v128)) (field (mut i64)) (field (mut (ref $2)))))) | ||
| ;; CHECK-NEXT: (type $7 (shared (describes $6) (descriptor $9) (struct (field (ref null $6)) (field (mut (ref $0))) (field (ref $7)) (field i8) (field (mut i8)) (field (ref null $5))))) | ||
| ;; CHECK-NEXT: (type $8 (sub (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $11) (struct (field (mut (ref $0))) (field (mut v128))))) | ||
| ;; CHECK-NEXT: (type $10 (func (result (ref extern) (ref noextern) (ref $13) i32 exnref))) | ||
| ;; CHECK-NEXT: (type $11 (shared (describes $9) (struct (field i16) (field (ref null $11))))) | ||
| ;; CHECK-NEXT: (type $12 (sub (descriptor $13) (struct (field i64) (field (ref (shared extern))) (field (mut i16)) (field (mut (ref noextern)))))) | ||
| ;; CHECK-NEXT: (type $13 (sub (describes $12) (struct (field (ref extern)) (field f64)))) | ||
| ;; CHECK-NEXT: (type $14 (sub final $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field v128)))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $15 (sub $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field (mut i32))))) | ||
| ;; CHECK-NEXT: (type $16 (shared (func (param (ref null $17)) (result exnref)))) | ||
| ;; CHECK-NEXT: (type $17 (sub final $12 (descriptor $18) (struct (field i64) (field (ref (shared extern))) (field (mut i16)) (field (mut (ref noextern))) (field (mut (ref null $10)))))) | ||
| ;; CHECK-NEXT: (type $18 (sub final $13 (describes $17) (struct (field (ref extern)) (field f64) (field (mut i16)) (field (mut i8))))) | ||
| ;; CHECK-NEXT: (type $19 (sub $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field (mut (ref cont))) (field (mut i64))))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-EMPTY: | ||
| ;; CHECK-NEXT: Inhabitable types: | ||
| ;; CHECK-NEXT: Inhabitable types: | ||
| ;; CHECK-EMPTY: | ||
| ;; CHECK-NEXT: Built 20 types: | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $0 (sub (shared (func (param i64 f64 exnref (ref null $0)) (result (ref cont)))))) | ||
| ;; CHECK-NEXT: (type $1 (shared (descriptor $2) (struct))) | ||
| ;; CHECK-NEXT: (type $2 (shared (describes $1) (descriptor $4) (struct (field (mut v128)) (field (mut (ref $4))) (field (mut v128)) (field (mut i32)) (field f32)))) | ||
| ;; CHECK-NEXT: (type $3 (array i8)) | ||
| ;; CHECK-NEXT: (type $4 (shared (describes $2) (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $5 (shared (descriptor $6) (struct (field f64) (field (ref $7)) (field (mut f64)) (field (mut (ref null (shared eq)))) (field (ref $11)) (field (ref (shared any)))))) | ||
| ;; CHECK-NEXT: (type $6 (shared (describes $5) (descriptor $7) (struct (field (mut i32)) (field (mut i16)) (field i64) (field f32) (field (ref null $11)) (field (mut f64))))) | ||
| ;; CHECK-NEXT: (type $7 (shared (describes $6) (descriptor $9) (struct (field i8) (field (mut f32)) (field (mut f64)) (field (mut i32)) (field (mut f32)) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $8 (sub (struct))) | ||
| ;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $11) (struct (field (mut v128)) (field (mut v128)) (field (mut f32))))) | ||
| ;; CHECK-NEXT: (type $10 (func (param f32 f64 f32))) | ||
| ;; CHECK-NEXT: (type $11 (shared (describes $9) (struct (field (ref (shared struct))) (field i32) (field f32) (field (mut (ref null (shared struct)))) (field i64) (field i32)))) | ||
| ;; CHECK-NEXT: (type $12 (sub (descriptor $13) (struct (field (mut i8)) (field f32) (field (mut v128))))) | ||
| ;; CHECK-NEXT: (type $13 (sub (describes $12) (struct (field i32) (field (ref $10)) (field i8) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $14 (sub $8 (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $15 (sub $8 (struct (field v128) (field (mut (ref null (shared struct))))))) | ||
| ;; CHECK-NEXT: (type $16 (shared (func (param (ref null $10)) (result (ref $6) i32 f64)))) | ||
| ;; CHECK-NEXT: (type $17 (sub final $12 (descriptor $18) (struct (field (mut i8)) (field f32) (field (mut v128)) (field (ref null $17)) (field (mut i8)) (field (mut eqref))))) | ||
| ;; CHECK-NEXT: (type $18 (sub final $13 (describes $17) (struct (field i32) (field (ref $10)) (field i8) (field (mut i64)) (field (mut (ref null $11))) (field f64)))) | ||
| ;; CHECK-NEXT: (type $19 (sub $8 (struct (field (mut i8)) (field (mut v128)) (field v128) (field v128)))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: Built 20 types: | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $0 (sub (shared (func (param i64 f64 exnref (ref null $0)) (result (ref cont)))))) | ||
| ;; CHECK-NEXT: (type $1 (shared (descriptor $2) (struct))) | ||
| ;; CHECK-NEXT: (type $2 (shared (describes $1) (descriptor $4) (struct (field (mut v128)) (field (mut (ref $4))) (field (mut v128)) (field (mut i32)) (field f32)))) | ||
| ;; CHECK-NEXT: (type $3 (array i8)) | ||
| ;; CHECK-NEXT: (type $4 (shared (describes $2) (struct))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $5 (shared (descriptor $6) (struct (field f64) (field (ref $7)) (field (mut f64)) (field (mut (ref (shared i31)))) (field (mut (ref $11))) (field (ref (shared i31)))))) | ||
| ;; CHECK-NEXT: (type $6 (shared (describes $5) (descriptor $7) (struct (field (mut i32)) (field (mut (ref null $0))) (field (ref null (shared i31))) (field (mut v128)) (field (mut i64)) (field (mut (ref $2)))))) | ||
| ;; CHECK-NEXT: (type $7 (shared (describes $6) (descriptor $9) (struct (field (ref null $6)) (field (mut (ref $0))) (field (ref null $7)) (field i8) (field (mut i8)) (field (ref null $5))))) | ||
| ;; CHECK-NEXT: (type $8 (sub (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64))))) | ||
| ;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $11) (struct (field (mut (ref $0))) (field (mut v128))))) | ||
| ;; CHECK-NEXT: (type $10 (func (result (ref extern) (ref noextern) (ref $13) i32 exnref))) | ||
| ;; CHECK-NEXT: (type $11 (shared (describes $9) (struct (field i16) (field (ref null $11))))) | ||
| ;; CHECK-NEXT: (type $12 (sub (descriptor $13) (struct (field i64) (field (ref null (shared extern))) (field (mut i16)) (field (mut nullexternref))))) | ||
| ;; CHECK-NEXT: (type $13 (sub (describes $12) (struct (field externref) (field f64)))) | ||
| ;; CHECK-NEXT: (type $14 (sub final $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field v128)))) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (rec | ||
| ;; CHECK-NEXT: (type $15 (sub $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field (mut i32))))) | ||
| ;; CHECK-NEXT: (type $16 (shared (func (param (ref null $17)) (result exnref)))) | ||
| ;; CHECK-NEXT: (type $17 (sub final $12 (descriptor $18) (struct (field i64) (field (ref null (shared extern))) (field (mut i16)) (field (mut nullexternref)) (field (mut (ref null $10)))))) | ||
| ;; CHECK-NEXT: (type $18 (sub final $13 (describes $17) (struct (field externref) (field f64) (field (mut i16)) (field (mut i8))))) | ||
| ;; CHECK-NEXT: (type $19 (sub $8 (struct (field (mut i16)) (field (mut (ref null $3))) (field (mut i64)) (field (mut (ref cont))) (field (mut i64))))) | ||
| ;; CHECK-NEXT: ) |
Oops, something went wrong.
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.
If we don't do this, does the fuzzer easily run into lengthy hangs? I don't believe we have a similar fixup for linear memory hangs, but it's only rarely been an issue.
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.
memory.atomic.waitworks a little differently.memory.atomic.waitis only generated ifATOMIC_WAITSis true to begin with (FWIW this looks like a hard-coded flag that's always false), then it generates a random i64 for the timeout and has no fixup.OTOH for
struct.waitwe may always generate the instruction, butATOMIC_WAITSonly determines whether the timeout can be non-0. I think this is the better way to do it since we can at least exercise the non-blocking code paths. We probably don't get hangs frommemory.atomic.waitoften because it would have to take an existing test that contains the instruction and mutate it to make it block (either via the timeout or the control word); it's never generated from scratch by the fuzzer whilestruct.waitis.I could update
memory.atomic.waitin a future PR if we want more uniformity here.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.
It would be nice to make them consistent in a follow-up, thanks.
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.
Starting this in #9170.