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

JVM fails with core dump #56

Open
melix opened this issue Feb 13, 2021 · 2 comments
Open

JVM fails with core dump #56

melix opened this issue Feb 13, 2021 · 2 comments
Assignees
Labels
🐞 bug Something isn't working
Projects

Comments

@melix
Copy link

melix commented Feb 13, 2021

Describe the bug

Invocation of a WASM binary triggers a segfault in the VM, crashing it. It seems that this occurs quite frequently on my laptop, but I'm seeing successful runs also.

An example of a failing run: https://scans.gradle.com/s/d7otkguc6enr6/console-log?anchor=73
Without any code change, this one passed: https://scans.gradle.com/s/cqx4p4rdmfdf2

Steps to reproduce

Pre-requisites: install cargo and cargo install wasm-gc.

  1. Clone https://github.com/melix/gradle-wasm-plugin
  2. git chechout jvm-crash
  3. Run ./gradlew functionalTest
  4. See error (or not)

Expected behavior

The JVM shouldn't crash.

Actual behavior

The JVM crashes more often than it should.

Additional context

This behavior was observed under Linux Mint 20.1. I have attached a core dump.

hs_err_pid1026074.log

The problem seems to occur during finalization. It's worth noting that you shouldn't rely on finalize in Java.

Seems that commenting out the instance.close() call on https://github.com/melix/gradle-wasm-plugin/blob/2ff26beb103c8049e7215084852d7dbbde889870/wasm-base-tasks/src/main/java/me/champeau/gradle/wasm/tasks/AbstractWasmTask.java#L49 fixes the pb.

@melix melix added the 🐞 bug Something isn't working label Feb 13, 2021
@Hywan Hywan self-assigned this Mar 2, 2021
@Hywan Hywan added this to 📬 Backlog in Kanban via automation Mar 2, 2021
@Hywan Hywan moved this from 📬 Backlog to 🏁 Ready in Kanban Mar 2, 2021
@Hywan
Copy link
Contributor

Hywan commented Mar 2, 2021

Thank you for the detailed report! It looks a duplicated issue of #58. I'll investigate :-).

@johnkbarrow
Copy link

I can confirm that not calling instance.close() definitely improves stability. Calling it resulted in my JVM crashing without fail every time after a couple of invocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
Kanban
  
🏁 Ready
Development

No branches or pull requests

3 participants