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

JRE crash with GraalVM 20.1.0 #42

Open
NorbertSandor opened this issue Sep 1, 2020 · 5 comments
Open

JRE crash with GraalVM 20.1.0 #42

NorbertSandor opened this issue Sep 1, 2020 · 5 comments

Comments

@NorbertSandor
Copy link
Contributor

NorbertSandor commented Sep 1, 2020

It is easy to reproduce: calling org.firmata4j.IODevice.start() always crashes the JVM:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=12504, tid=6892
#
# JRE version: OpenJDK Runtime Environment GraalVM CE 20.1.0 (11.0.7+10) (build 11.0.7+10-jvmci-20.1-b02)
# Java VM: OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (11.0.7+10-jvmci-20.1-b02, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [jSSC-2.8_x86_64.dll+0xb5db]
#

---------------  T H R E A D  ---------------

Current thread (0x000002369e22a000):  JavaThread "main" [_thread_in_native, id=6892, stack(0x000000e67c200000,0x000000e67c300000)]

Stack: [0x000000e67c200000,0x000000e67c300000],  sp=0x000000e67c2fbfb0,  free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [jSSC-2.8_x86_64.dll+0xb5db]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J+0
j  jssc.SerialPort.openPort()Z+65
j  org.firmata4j.transport.SerialTransport.start()V+14
j  org.firmata4j.firmata.FirmataDevice.start()V+24

...
@kurbatov
Copy link
Owner

kurbatov commented Sep 1, 2020

It seems that jssc crashes. If jSerialComm that you propose in #41 doesn't fail on Graal, this issue get solved by implementing a Transport interface using working library.

I didn't mean supporting Graal when building the library but I would highly appreciate if you contribute a solution to this issue.

@NorbertSandor
Copy link
Contributor Author

The implementation proposed in #43 works with GraalVM as well.

@dougmeredith
Copy link

It sounds like this is under control, but a further data point, just in case: Same issue with AdoptOpenJDK 11.0.7 on Windows.

@dougmeredith
Copy link

A quick update: JSerialCommTransport solved the problem for me too. Thanks!

Based on issues I had with an older version of nrjavaserial, I suspect that the original problem occurs on Windows with any JVM newer than 8.

@centic9
Copy link
Contributor

centic9 commented Jan 4, 2021

I now have the exact same crash on Windows with pure OpenJDK 8 & 11, I am fairly sure it worked before without any update to the JDK in the meantime, so maybe some Windows update broke jssc here?

The new serial transport from #43 works fine for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants