Skip to content
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

testing/synctest: cross-bubble operations in wasm calls operations #70512

Closed
neild opened this issue Nov 21, 2024 · 2 comments
Closed

testing/synctest: cross-bubble operations in wasm calls operations #70512

neild opened this issue Nov 21, 2024 · 2 comments
Labels
arch-wasm WebAssembly issues FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@neild
Copy link
Contributor

neild commented Nov 21, 2024

The following problem appears in https://go.dev/cl/630382.

syscall/js.FuncOf creates a function which may be called from JavaScript. syscall/fs_js.go (and probably other places) uses this mechanism to pass a callback to Javascript. The callback writes a value to a channel.

When running under synctest, this results in a cross-bubble channel operation: The channel is created in a synctest bubble, but the JS-executed function which sends to the channel runs outside the bubble, resulting in panic.

The fix might be to make syscall/js.FuncOf synctest-aware, so that callbacks run in the creators' bubble. But we'll also need to ensure that bubbles don't idle while a JS call is in progress. Possibly mark the bubble as active until FuncOf.Release is called?

@ianlancetaylor
Copy link
Contributor

CC @golang/wasm

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/631055 mentions this issue: runtime, internal/synctest, syscall/js: keep bubble membership in syscalls

@dmitshur dmitshur added arch-wasm WebAssembly issues NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Nov 22, 2024
@dmitshur dmitshur modified the milestones: Backlog, Go1.24 Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly issues FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants