-
Notifications
You must be signed in to change notification settings - Fork 53
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
EXCEPTION_ACCESS_VIOLATION : JVM crashes on windows 10 in the jssc lib at : jssc.SerialNativeInterface.openPort #65
Comments
Unfortunately the upstream bug report where this was originally reported has vanished, but this specific bug has since been patched and available for immediate download here: https://github.com/java-native/jssc/releases |
I am using the same jar that you mentioned. https://github.com/java-native/jssc/releases/download/v2.9.0/jssc-2.9.0.jar |
The aforementioned jar is tested and working on AdopOpenJDK11 (all releases), so I'm uncertain as to whether or not this can be fixed for OpenJDK11 from java.net but I'll leave it open for now. Note, it was tested on XP, 7, 10 as well as Solaris, MacOS 10.9+ and various Linuxes. Related: adoptium/adoptium-support#76 |
I am seeing this on AdoptOpenJDK too.
|
Does it occur on a second Windows 10 machine? If so, exact environment will help. If not, it's likely specific to something with your machine. |
Will update you shortly. I have only one machine with me in WFH mode. |
Here is the result from my colleagues machine. The log is attached. Same result. |
Here is one more log from 3rd machine. Amazon's Corretto implementation of Java 11. |
@atawre thanks for this information and for testing it on so many different JVMs. I'm a bit puzzled as to the various crashes. I have JSSC 2.9.1 library running on many (tens of thousands of) Windows 10 machines for an open-source commercial project that I operate. This leads me to suspect a few things:
For starters, can you share a Java code snippet which reproduces it? Additionally, if you can share the exact Windows information (32-bit vs. 64-bit and precise Windows 10 build version). This will be helpful in understanding scope. |
PFA one more log attached. Here is the link for crash dump (1.5gb) https://gofile.io/d/SPsioa |
Also, the logs suggest it's happening from IntelliJ, is this just how you're debugging it? I noticed a few things that differ but namely:
Historically, a polluted Unpolluting the |
I will update you more PATH thing. Yes, I am using intellij (debug) to run it. |
You can place code directly inside github using ```java tags. Extracted, quoting: // It fails at port.openPort
// SSTSerialPort is just a derivative of SerialPort
// transitionToDongleConnected keep internal state, so nothing much there too.
private void attemptDongleConnect() {
if (dongleConnectionState == DongleConnectionState.DongleConnected)
return;
if (isSimulatingDongleConnection()) {
transitionToDongleConnected();
} else {
closePort();
String[] ports = SerialPortList.getPortNames();
if (ports.length > 0) {
port = new SSTSerialPort(ports[0], isInRecordMode);
try {
log.info("Attempting to open port.");
transitionToDongleConnected();
boolean portOpened = port.openPort();
port.setParams(CommunicationConstants.BAUD_RATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
port.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT);
port.addEventListener(this, SerialPort.MASK_RXCHAR + MASK_CTS);
log.info("Port Opened? " + portOpened);
if (portOpened) {
if (dongleConnectionState == DongleConnectionState.NoDongleConnected)
transitionToDongleConnected();
SerialSend.sendListCommand(port);
System.out.println("SENDING LIST COMMAND");
}
} catch (Exception ex /*| SerialPortException spe*/ ) {
port = null;
transitionToDongleDisconnected();
log.error("Error opening port", ex);
}
}
}
} |
The code make several API calls which are not provided. After ruling out the |
I have removed earlier java version. Installed AdoptOpenJDK from msi package (java is in standard path.) Here is the mimimal code that I have on a button click, which fails exactly same.
All the calls on this button click are using standard jsst methods/classes, nothing from out project. |
Attached is a test which runs fine using IntelliJ on my machine:
I have Oracle JDK8 installed as well, but the IDE is configured to use AdoptOpenJDK11. The output is the following: "C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.3\lib\idea_rt.jar=62252:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.3\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\Owner\Desktop\JsscTest\out\production\Desktop;C:\Users\Owner\Desktop\JsscTest\lib\jssc-2.9.1.jar Main
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
+ COM1 Opened: true
Process finished with exit code 0
I would expect a unit-test to be a plain I've also noted your Windows version is older. This may or may not be relevant. |
The tests you supplied work. Not sure why it doesn't through my module. If you have a debug version of the jar ( dll with debug symbols) I can generate memory dump, if that helps. Note:All of this code worked for years with jdk8. |
JDK8 didn't pollute the path in the same fashion, so there's that. In regards to debug symbols, the project doesn't offer a precompiled build with them yet. A build could be created using maven and toggling on the debug flags, but assuming you're building using something like MSVC, it may not even crash since the If using cmake directly, it's MSVC 64-bit: Line 405 in 6d09752
MSVC 32-bit: Line 420 in 6d09752
I'm still not sure if this is going to help though. If mine crashes and yours doesn't, you should be looking at the environment, not the debugger in my opinion. |
As a courtesy, I can take a look at the offending IntelliJ project to see if the crash happens on my PC. You can email it to me, tres.finocchiaro@gmail.com. |
Hi, if you're able to send the project over please let me know. Otherwise, I'll close this as unreproducible. |
I'm having this same exact problem with a project that uses JavaFX. I tried an example with a fresh project containing an unaltered PATH and it made no difference. |
@dan-3lliott If you can whip up a small unit test, please share. |
@tresf I solved this exact same problem by updating my jssc version to 2.9.1. Would you mind adding this version to the central maven repository for easier usage? https://mvnrepository.com/artifact/org.scream3r/jssc |
A customer of us had the same problem when upgrading from JRE 1.8.0_251-B08 to 1.8.0_271 using org.scream3r:jssc:2.8.0 |
We have exactly the same problem, the fact there's no 2.9.1 on maven is critical |
@Puccet, just to make it clear, 2.9.1 may not be on Maven Central, but 2.9.2 of this fork is - so when you say you have the same problem, do you mean it happens with latest version that is on Maven, but not with 2.9.1? |
@pietrygamat No, I missed the 2.9.2, just set in the pom and now all seems to work properly, Thanks a lot!! |
Just chiming in that JSSC 2.9.2 on Java 1.8.0_271 for Windows x86 works fine for me. |
Please have a deeper look. Happening widely. 2.9.2 brefore, 2.9.4 downloaded today too. OpenJDK11, Amazon Coretto JDK11 fresh, updated installs. Many machines. No matter Intel or Amd. Windows 10 or 11 fresh installs with all updates. Just the first attempt to open a port crashes the JVM. |
This is an open source library, worked on by volunteers (like you!), the code and its build tools are open, I encourage anyone to spearhead this. The steps to reproduce this problem were never able to be reproduced on a secondary machine. Generally, these types of crashes can occur when there's a DLL conflict or if the program is compiled with certain optional CPU features. Since this is a fork of an unmaintained project, I ask anyone that's experiencing this issue to help identify its cause. Instructing internet stranger to look into something sours the open source model. |
To add some more context, I forked this library here for this exact issue because I bundle JSSC with a Java application that I maintain and is currently deployed to hundreds of thousands of Windows computers and this issue hasn't been reported there.
|
Hey Everyone, I was having the exact same problem at work, 'EXCEPTION_ACCESS_VIOLATION'. My machine is Windows 11, Java 8, and JSSC 2.8. What worked for me is I switched from JSSC-2.8 to JSSC-2.9.2. The problem never came up again. |
I should probably leave a status... So this fork fixes the problem in the 2.9+ on all configurations I mentioned. Lesson learned. |
I think this can be considered done. |
I was using jssc 2.8.0 and java 8. Need to switch to Java 11 for project requirement.
After everything is ported the jssc library seems to cause jvm to crash on window 10.
(Log is attached)
There is similar bug reported earlier - https://bugs.openjdk.java.net/browse/JDK-8203772
However, this was closed as jssc issue.
I am using openjdk 11. Wondering this is fixed. Since 2.9.0 mentions following in the fixes section.
Fixed hard crash on Windows using JDK11
hs_err_pid18016 (1).log
The text was updated successfully, but these errors were encountered: