You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't been able to create a minimal example exhibiting the same behaviour just yet. I'm still working on that. 👈
However the bug randomly appears when memory usage gets near 2^31. I have also verified that the issue is present both in Chrome and Firefox (so this does not appear to be a WASM vm bug)
What did you see happen?
bytes.IndexByte returns -4294967295 on the following snippet:
Go version
1.21.7
Output of
go env
in your module/workspace:GOARCH=wasm GOOS=js GOHOSTARCH=amd64 (I'll update this with the values I used when experimenting with a fix when I can)
What did you do?
It seems that
bytes.IndexByte
when compiled tojs/wasm
can return values that are below-1
. The code snippet that triggered this issue is this:(extracted from https://github.com/evanw/esbuild/blob/2af5ccf478812d2d7226ad4435d46fbbb3419a8c/internal/js_printer/js_printer.go#L3464)
Original issue: stackblitz/webcontainer-core#1310
I haven't been able to create a minimal example exhibiting the same behaviour just yet. I'm still working on that. 👈
However the bug randomly appears when memory usage gets near 2^31. I have also verified that the issue is present both in Chrome and Firefox (so this does not appear to be a WASM vm bug)
What did you see happen?
bytes.IndexByte
returns-4294967295
on the following snippet:I've also seen similar values such as
-4294967293
for other input.What did you expect to see?
I expect to see the correct, positive values and no other negative values than
-1
.Note that I did a simple patch modifying:
https://github.com/golang/go/blob/master/src/bytes/bytes.go#L95-L97
to be:
And it did fix the issue as it can be seen there:
https://stackblitz.com/edit/github-9i57jp-wrcype
Again, apologies for the lack of a good and simple reproducible example. I'll try to update this issue as soon as I have found one.
The text was updated successfully, but these errors were encountered: