misc/wasm, runtime: calling fmt.Println in different goroutines causes a crash #40081
Labels
arch-wasm
WebAssembly issues
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. As of the time this issue was created, 1.14.4 is the latest non-beta release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See 0xProject/0x-mesh#849. We were seeing our code occasionally crash in the browser with different error messages. Sometimes we see the error message
memory access out of bounds
, and other times it isfatal: unreachable
. We believe these two errors may be related.We were able to create a minimal reproduction:
We are running the program via https://github.com/agnivade/wasmbrowsertest with the command
GOOS=js GOARCH=wasm go run -exec="wasmbrowsertest" main.go
. This is just a quick way for us to get the program running in a headless browser. If you prefer, you can follow the instructions from the WebAssembly Wiki for running this in a non-headless browser by serving up an index.html file. The crash occurs either way.The program does not seem to crash in Node.js environments. It also doesn't crash if you run it without
GOOS=js GOARCH=wasm
. It only seems to crash in the browser.What did you expect to see?
The program should run until stopped and repeatedly print out numbers between 0 and 99.
What did you see instead?
The program crashes with the following stack trace:
The text was updated successfully, but these errors were encountered: