-
Notifications
You must be signed in to change notification settings - Fork 272
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
invalid table access only with Go 1.24 and amd64 #2375
Comments
For reference, I do get a crash on wazero tests using rosetta with go 1.24 that doesn't happen on 1.23
But it doesn't seem to happen if I run on a github runner so maybe just rosetta-specific (above error happens on native too) https://github.com/anuraaga/wazero/actions/runs/13302580071/job/37146554276?pr=2 |
Interesting, I tried running |
FYI, on WSL2 with both $ go test ./imports/wasi_snapshot_preview1/
--- FAIL: Test_fdReaddir_ls (0.59s)
--- FAIL: Test_fdReaddir_ls/tinygo (0.03s)
--- FAIL: Test_fdReaddir_ls/tinygo/empty_directory (0.03s)
require.go:331: expected no error, but was wasm error: unreachable
wasm stack trace:
main.runtime._panic(i32,i32)
main._start(): panic: fdopendir ./a-: errno 21
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:268
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:238
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:104
--- FAIL: Test_fdReaddir_ls/tinygo/directory_with_entries (0.00s)
require.go:331: expected no error, but was wasm error: unreachable
wasm stack trace:
main.runtime._panic(i32,i32)
main._start(): panic: fdopendir .: errno 21
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:268
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:238
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:118
--- FAIL: Test_fdReaddir_ls/tinygo/directory_with_tons_of_entries (0.00s)
require.go:331: expected no error, but was wasm error: unreachable
wasm stack trace:
main.runtime._panic(i32,i32)
main._start(): panic: fdopendir .: errno 21
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:268
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:238
/wazero/imports/wasi_snapshot_preview1/wasi_stdlib_test.go:148
FAIL
FAIL github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1 9.651s
FAIL
|
We have found this commit from Go to be the cause of the issues golang/go@601ea46#diff-ab6c974d2f954725a8b1b04f85fb0f1d6aa453692188e727b47ffc8ff202603bL46 Currently we call the runtime's |
Does that mean it's a compiler bug? Or is |
There's a lot of The point isn't that the compiler is impervious to Go runtime changes. The point is that you can self contain those breakages to wazero, and have a reasonably safe and performant way to run external code. |
Thanks for the quick turnaround on this one! Much appreciated 🙇♂ |
Describe the bug
go-re2 usage crashes only with Go 1.24 on amd64. I guess this must be some interaction with different codegen in 1.24 on that platform. I believe it is happening when invoking a wasi host function and may be trampoline related. It is crashing right away with no concurrency or anything special.
To Reproduce
Description of the host and wasm code that reproduces the behavior.
Smoothest debugging will be if you can share a repository with the
actual code.
With go 1.24, run go-re2 tests.
debug-build
branch has unattested debug binary, main will crash without symbolsExpected behavior
Doesn't crash
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the relevant information):
Additional context
Originally reported in wasilibs/go-re2#190
Dump with host function logging - while I thought it may be only the first host function call that is affected, it appears there is one
clock_time_get
call that succeeds before the failing one withinfwrite
.https://gist.github.com/anuraaga/83ef5402670e51f492bcd4b6f25014e8
The text was updated successfully, but these errors were encountered: