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

Segmentation fault when compiling Wasm module in tests #4588

Open
inliquid opened this issue Nov 7, 2024 · 2 comments
Open

Segmentation fault when compiling Wasm module in tests #4588

inliquid opened this issue Nov 7, 2024 · 2 comments
Labels
wasm WebAssembly

Comments

@inliquid
Copy link

inliquid commented Nov 7, 2024

We have a segmentation violation errors in some tests during tinygo build <...> invocation. They start failing very recently after this change (this is not necessarily connected) and not in every run.

Full error message can be seen by following below links, message in both cases more or less similar:

<...>
tinygo build -o tests/well-known/plugin/plugin.wasm -scheduler=none --no-debug --target=wasi tests/well-known/plugin/plugin.go
SIGSEGV: segmentation violation
PC=0x81301c m=0 sigcode=18446744073709551610 addr=0x3e900000ed0
<...>

This error happens with different versions of tinygo. For example:

  1. tinygo-v0.29.0 (go1.20.14)
  2. tinygo-v0.31.2 (go1.22.8)

This is code which tinygo failed to compile -> plugin.go.

I can't reproduce this locally. Tried testing with Ubuntu 22.04 and older Ubuntu 20.04 with exact same Go and TinyGo versions as in failing tests, but everything worked well.

So this seems to be some sort of flaky test, probably environment-dependent (github runner).

To reproduce you need to clone https://github.com/knqyf263/go-plugin and run make test.

@aykevl
Copy link
Member

aykevl commented Nov 8, 2024

If there's no way to reproduce locally, it's going to be very difficult to debug this. Especially because this appears to be a memory corruption issue.

Have you tried simply running the test many times, possibly with tinygo clean in between runs?

@inliquid
Copy link
Author

inliquid commented Nov 8, 2024

If there's no way to reproduce locally, it's going to be very difficult to debug this. Especially because this appears to be a memory corruption issue.

Yes, I understand, maybe anyone else have encountered same error and can add more context...

Have you tried simply running the test many times, possibly with tinygo clean in between runs?

Thanks, I'll try to run test with this command in a loop and get back with result, whole test takes couple of minutes, so unfortunately it's not easy to produce a lot of attempts.

@deadprogram deadprogram added the wasm WebAssembly label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm WebAssembly
Projects
None yet
Development

No branches or pull requests

3 participants