java-native/jssc

SerialPort.closePort windows blue screen of death

HughWick opened this issue · 4 comments

My own laptop can switch serial port without any problem, but my colleague's computer can open the serial port, but when closing the serial port there is a windows blue screen of death.

jssc 2.9.3
spring boot 2.2.7

My environment is

windows10 21h1 education version
openjdk11
intel core i7-8565U

Colleague's computer environment is

windows10 2004 Professional Edition 
openjdk11
amd ryzen 5 4600U

The blue screen termination code is:SYSTEM_SERVICE_EXCEPTION .
What did I do wrong?

Supplementary:
After packaging with maven, run the application with the java -jar XXX.jar command

tresf commented

Does the same thing happen if you open it with Putty?

Does the same thing happen if you open it with Putty?

After using putty with all the same parameters, I can open the serial port normally and close the serial session normally without the windows blue screen of death. Then I switch back to using java and still get the blue screen of death

tresf commented

Thanks for testing Putty.

Most articles about the SYSTEM SERVICE EXCEPTION point to device drivers, I was curious if another app exhibited the same symptom.

As a starting point, I would recommend reinstalling -- if any -- the serial drivers in use in Device Manager clicking the checkbook to remove the device driver it's offered. Even if Windows Update installed these automatically, it's a good troubleshooting step. If the device manufacturer offers updated drivers, testing them is helpful.

The usual PC troubleshooting is also encouraged such as running chkdsk /f as Administrator in a Command Prompt, then rebooting.

The underlying issue may be a bug with JSSC's implementation, but if so, this is the first it's been reported. The code for Windows is largely untouched between jssc 2.9.3 and 2.9.4 but the binaries were recompiled, it would be interesting to know if the problem exists there too, or if the Java Version affects the bug.

Of course, the symptom makes testing combinations hard so perhaps obtaining more crash information from the system is a better first step.

As I'm sure you're aware, JSSC is a volunteer-lead project, so any assistance or insight as to what could be the cause is greatly appreciated.

Thanks for testing Putty.

Most articles about the SYSTEM SERVICE EXCEPTION point to device drivers, I was curious if another app exhibited the same symptom.

As a starting point, I would recommend reinstalling -- if any -- the serial drivers in use in Device Manager clicking the checkbook to remove the device driver it's offered. Even if Windows Update installed these automatically, it's a good troubleshooting step. If the device manufacturer offers updated drivers, testing them is helpful.

The usual PC troubleshooting is also encouraged such as running chkdsk /f as Administrator in a Command Prompt, then rebooting.

The underlying issue may be a bug with JSSC's implementation, but if so, this is the first it's been reported. The code for Windows is largely untouched between jssc 2.9.3 and 2.9.4 but the binaries were recompiled, it would be interesting to know if the problem exists there too, or if the Java Version affects the bug.

Of course, the symptom makes testing combinations hard so perhaps obtaining more crash information from the system is a better first step.

As I'm sure you're aware, JSSC is a volunteer-lead project, so any assistance or insight as to what could be the cause is greatly appreciated.

Thank you brother, I solved the problem after upgrading the serial port driver for windwos.