Javet
Javet copied to clipboard
createV8Runtime crash
In Ubuntu I encounter the problem when two threads create v8runtimes, the VM crashes. This problem is not found in Windows however. Here is the code for bug reproduction, attached file is jvm crash report:
public class UnifiedEntityRTApplication {
private static final IJavetEnginePool<V8Runtime> javetEnginePool = new JavetEnginePool<>();
public static void main(String[] args) throws Exception {
new Thread(() -> {
try {
test2();
} catch (Exception e) {
throw new RuntimeException(e);
}
}).start();
new Thread(() -> {
try {
test2();
} catch (Exception e) {
throw new RuntimeException(e);
}
}).start();
}
private static void test2() throws Exception {
try (IJavetEngine<V8Runtime> javetEngine = javetEnginePool.getEngine()) {
V8Runtime v8Runtime = javetEngine.getV8Runtime();
}
}
}
Java version: openjdk version "1.8.0_442" OpenJDK Runtime Environment (build 1.8.0_442-8u442-b06~us1-0ubuntu1~22.04-b06) OpenJDK 64-Bit Server VM (build 25.442-b06, mixed mode)
Ubuntu version: Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy
Please check this doc out.