Conversation
Member
Author
|
Added a simple reducer which seems to work well. It finds stuff like this: void func_0() {
puts("log(1)");
try {
try {
throw 0;
} catch(...) {
try {
while (getBoolean()) {
}
} catch(...) {
}
}
} catch(...) {
}
}That crashes clang with |
Member
Author
|
Can also find bugs in binaryen, this crashes with void func_0() {
try {
puts("log(1)");
} catch(...) {
while (getBoolean()) {
throw 0;
}
}
}I think this might be the rethrow bug that @aheejin mentions in WebAssembly/binaryen#3562 that will be fixed soon. |
Member
|
Thanks, this is great! I'll check those crashing examples soon. |
kripken
added a commit
to WebAssembly/binaryen
that referenced
this pull request
Feb 23, 2021
…a call (#3594) This was an unfortunate case of the order of execution of call arguments. link(self->currBasicBlock, self->startBasicBlock()) would run the call first, which sets currBasicBlock, so we'd end up with the same value for both parameters. Without this fix, the testcase would drop the result of the call, as it thought it had no uses. Also improve debug logging here a tiny bit. Found by emscripten-core/emscripten#13485
This was referenced Feb 23, 2021
kripken
added a commit
to WebAssembly/binaryen
that referenced
this pull request
Feb 23, 2021
We were missing a pop of catchIndexStack at a Delegate. It ends the scope, so it should do that, like TryEnd does. Found by emscripten-core/emscripten#13485 on -O2.
This was referenced Feb 24, 2021
kripken
added a commit
to WebAssembly/binaryen
that referenced
this pull request
Feb 24, 2021
Before this we would assert on hashing e.g. (br $x) by itself, without the context so we recognized the name $x. Somehow that was not an issue until delegate, we just happened to not hash such things. I believe I remember that @aheejin noticed this issue before, but given we didn't have a testcase, we deferred fixing it - now is the time, I guess, as with delegate it is easy to get e.g. CodeFolding to hash a Try with a delegate. Issue found by emscripten-core/emscripten#13485
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a quick and simple fuzzer, but it should generate some interesting patterns. It should also allow for easy reduction of testcases (see comments in the source for the technique).
Example random output:
This is capable of crashing clang (on
WebAssemblyCFGStackify) with-fwasm-exceptions. I assume it's too early to fuzz it?cc @aheejin @tlively @dschuff