Closed vicentini closed 8 years ago
I have recently seen something similar. I have not collected as much data just yet but a jstack clearly shows that I have a thread blocked on the JNA call to clib.open.
@vicentini
I suppose you have made sure that every time you open the port, it gets closed ok too, right thought so.
Approximately how many times you can open/close the port before the open hangs?
Can you simplify this to simple test case that just keeps opening and closing a port?
If so, could you run the test with some other serial device in case this is a driver bug?
Closing this as there has been no response and I cannot reproduce this.
I have an application where I periodically read data from a serial port. Because the port name could change at any time, I always open the necessary port, request and read data and close the port afterwards. After some time, the port cannot be opened any longer. As you can see in the attached log (log level 5) the native call inside "PureJavaSerialPort-constructor" => "JTermios.open" is not returning anymore and blocking forever. (The first open/close call you see in line 1-6 happens in the CommPortIdentifier.getPortIdentifier method and is still working. The subsequent call to the same underlying open method not anymore.) AFAIK this shouldn't happen, because the passed attribute O_NONBLOCK should prevent the method from blocking.
Has anyone experienced anything similar? Is this a known issue?
Log output of a correctly working read process:
Log output when the library is not able to connect:
BTW, the application is running on linux with jdk1.8.0_91.