[Rxtx] Port Locking / JVM Crashing

Trent Jarvi tjarvi at qbang.org
Thu Sep 7 18:38:35 MDT 2006


On Thu, 7 Sep 2006, Andy Dalton wrote:

> Greetings,
>
> I've seen in the archives some recent discussion between Trent and
> Pawan Kharbanda that looks like it's related to a problem I'm
> experiencing.  I've downloaded and ran Pawan's test application and I
> am able to reproduce the problem with my hardware pretty quickly (with
> as little as 3 threads).  Here's the end snipit of what happened:
>
> ---------------------------------------------------------------------------------------------------------------------------
>
> Cycle No (Thread ::: /dev/ttyUSB13) ::::::: 2
> Exception in thread "Thread ::: /dev/ttyUSB13"
> java.lang.NoClassDefFoundError: javax.comm/PortInUseException
>        at javax.comm.RXTXPort.open(Native Method)
>        at javax.comm.RXTXPort.<init>(RXTXPort.java:84)Exiting Thread
> ::: /dev/ttyUSB50
> Cycle No (Thread ::: /dev/ttyUSB50) ::::::: 2
> Exiting Thread ::: /dev/ttyUSB25
> Cycle No (Thread ::: /dev/ttyUSB25) ::::::: 2
>
>        at javax.comm.RXTXCommDriver.getCommPort(RXTXCommDriver.java:772)
>        at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:343)
>        at TestOpenClosePort$SerialThread.run(TestOpenClosePort.java:192)
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> #  SIGSEGV (0xb) at pc=0xaa30d73a, pid=1449, tid=2778098592
> #
> # Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode)
> # Problematic frame:
> # C  [librxtxSerial.so+0x773a]  initialise_event_info_struct+0x18a
> #
> # An error report file with more information is saved as hs_err_pid1449.log
> Exiting Thread ::: /dev/ttyUSB12
> Cycle No (Thread ::: /dev/ttyUSB12) ::::::: 2
> Exiting Thread ::: /dev/ttyUSB29
> Cycle No (Thread ::: /dev/ttyUSB29) ::::::: 2
> Exiting Thread ::: /dev/ttyUSB64
> Cycle No (Thread ::: /dev/ttyUSB64) ::::::: 2
> Port /dev/ttyUSB1 is Opened
> 0x01 Sent
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> #
> Aborted
>
> ---------------------------------------------------------------------------------------------------------------------------
>
> I'm working with rxtx-2.1-7pre17 to communicate with 80 FTDI USB
> serial devices in Linux.  Currently I can be communicating with up to
> 8 different devices at the same time.  The problem is, I frequently
> get the same SIGSEGV seen above:
>
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> #  SIGSEGV (0xb) at pc=0xa8b1673a, pid=20656, tid=2808978336
> #
> # Java VM: Java HotSpot(TM) Client VM (1.5.0_05-b05 mixed mode)
> # Problematic frame:
> # C  [librxtxSerial-2.1-7pre17.so+0x773a]  initialise_event_info_struct+0x18a
> #
> # An error report file with more information is saved as hs_err_pid20656.log
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> #
>
> I've tried upgrading to rxtx-2.1-7r2; however, I can't seem to get
> that version to work at all with my existing software.  Here's some
> information related to my setup:
>
> $ java -version
> java version "1.5.0_08"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode)
>
> $ uname -a
> Linux nestbed 2.6.17-gentoo-r7 #1 SMP Sat Sep 2 03:55:06 EDT 2006 i686
> Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
>
> $ grep VERSION /usr/src/linux/drivers/usb/serial/ftdi_sio.c
> #define DRIVER_VERSION "v1.4.3"
>
> If there's any additional information I might be able to provide,
> please let me know.
>
> Thanks in advance for your time as assistance.
>

Hi Andy

With Gentoo, I would try recompiling rxtx-2.1-7 on your system.  The pre17 
is older and its easier to work with older binaries.  But that is all you 
are gaining as far as I know.  Compiling on your system should result in a 
usable library.

I would be interested in knowing if you still have problems.

In Pawan's case, the problem was resolved by upgrading the system, drivers 
and firmware on the multiport device.  USB can be interesting this way too 
but less so on Linux.

I was able to generate a crash but only after hours of hammering.  So 
while there is probably a latent problem, I do not know of a case where it 
is reproducable like you mention with current rxtx.

--
Trent Jarvi
tjarvi at qbang.org



More information about the Rxtx mailing list