Link wasm-wasm directly in the fuzzer#8794
Open
kripken wants to merge 1 commit into
Open
Conversation
Member
Author
|
Emscripten also has some complexity around the original exports and the instrumented ones, which I also am not totally sure I follow, |
Collaborator
|
I can't seem to find the conversation, but IIRC one of the other v8 folks said that the wrapped version should behave the same as the original. Maybe a bug in v8? I can poke around a bit more on it tomorrow. |
Member
Author
|
Thanks, then let me reduce my testcase here, and I'll get that to you. |
Member
Author
|
Ok, here is the testcase: https://gist.github.com/kripken/1759e0f618e0a755e5a69f28f6b78142 $ diff -U2 a.js b.js
--- a.js 2026-06-01 16:41:32.078358653 -0700
+++ b.js 2026-06-01 16:41:33.662363189 -0700
@@ -203,5 +203,4 @@
// whose keys are strings and whose values are the corresponding exports).
var exports = {};
-var rawExports = {};
// Also track exports in a list, to allow access by index. Each entry here will
@@ -520,5 +519,5 @@
assert(secondBinary);
// Provide the primary module's exports to the secondary.
- imports['primary'] = rawExports;
+ imports['primary'] = exports;
}
@@ -554,5 +553,4 @@
var key = e.name;
var value = instance.exports[key];
- rawExports[key] = value;
value = wrapExportForJSPI(value);
exports[key] = value;The only diff between the JS files is to use the raw exports as the imports of the other module. And the behavior is very different: versus The start function in the second module is important somehow - I only see this when fuzzing start functions. |
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 avoids passing JSPI-wrapped exports from one wasm module as the imports
to another. Without this, the stack traces and erroring behavior become very
confusing. I noticed this during #8736 (fuzzing start) but I don't think it's limited to
the start function.
With that said, I admit I don't totally understand why the stack traces etc. get
very odd before this PR... async stuff is complex. But this seems like the right
thing anyhow?