[Rxtx] Port Locking / JVM Crashing
Pawan.Kharbanda at dot.state.co.us
Tue Aug 8 13:49:14 MDT 2006
I found the culprit .... RXTX2.1.7 + JDK 1.5.0_06 + Redhat kernel
2.4.21-37.Elsmp + digi box is a bad combination. I upgraded one of my
machine(with 8 processors) to the new kernel (2.6.9-34.0.2.ELsmp) and
have absolutely no problem with JVM crashing or Port Locking even after
10000 operations (now I am trying 100,000 :). This is all with the
original RXTX 2.1.7 (final) api's without any of my fixes that I have
been trying for last 2-3 weeks.
I will suggest that we update the INSTALL or Readme file accompnying the
RXTX saying the suggested kernel for Redhat Linux is 2.6.9-34.0.2.Elsmp
and use Digi PortServer II with the following configuration (Model:
PortServer TS 16 Rack Firmware: Version 82000684_S 05/22/2006 POST:
82000685_G 02/02/2006). This should helped everybody using the RXTX
API's with RedHat Linux atleast.
From: Trent Jarvi [mailto:tjarvi at qbang.org]
Sent: Monday, August 07, 2006 6:02 PM
To: Kharbanda, Pawan
Cc: Trent Jarvi; RXTX Developers and Users
Subject: RE: Port Locking / JVM Crashing
I thought for sure it was a kernel driver problem. When I looked at
digi.com and saw it was probably not in the kernel, I started to think
even moreso. The kernel authors like to make things hard for external
But when I saw the error this morning, I thought it was a
The other thing I was thinking about was the undef's I mentioned. rxtx
behaves differently for some kernel drivers that do not support
everything. We have to do that to get the data we need.
I was trying to figure out what it may be but not having hardware makes
On Mon, 7 Aug 2006, Kharbanda, Pawan wrote:
> I think I got the problem fixed after some code changes in the C
> (SerialImp.c) and Java(RXTXPort.java) code. I am now testing on the
> staging environment (with 10 devices) with real time data and haven't
> seen a JVM lock/ Port locking since last night. I am going to do
> further stress testing and will send all my code changes and my
> findings in next few days.
> I believe the problem was causing due to the digi drivers and how the
> Linux kernel talked to it, so after making some code changes and
> synchronization fixes, I got it to work. I am keeping my fingers
> Thanks for all your help. You have been a great help.
> Will keep you posted.
> PS : We are going to test my new RXTX changes with the 2.6 Red Hat
> kernel (currently using 2.4.21-37.ELsmp) too.
> -----Original Message-----
> From: Trent Jarvi [mailto:tjarvi at qbang.org]
> Sent: Monday, August 07, 2006 5:08 PM
> To: Kharbanda, Pawan
> Subject: RE: Port Locking / JVM Crashing
> Hi Pawan
> As mentioned I did reproduce the error but after several hours of
> I'm looking at RXTXPort.java and thinking about what may be happening.
> The error is in the C layer but it may be preventable in the java
> lets say two closes are overlapping or an operation is trying to
> happen while another port is closing. The structure may be out of
> sync by the time the code using the structure in another thread gets
> to the event info struct.
> So I'm wondering if synchronization in RXTXPort() and close() may help
> A second thing that may help is you can put printf("got here\n"); in
> each of the lines in initialize event info struct to verify that the
> problem is in walking the linked list. Thats my suspicion.
> So a properly timed close() while calling the constructor may be
> catching rxtx off guard. You can synchronize to test that and it may
> do away with the problem.
More information about the Rxtx