[Tinyos-help] IBM JDK segfaults on libtoscomm.so

Ákos Maróy darkeye at tyrell.hu
Sat Jun 2 01:45:45 PDT 2007


Philip Levis wrote:
> With a little bit of tweaking, it shouldn't be too difficult to get the
> java code working with the standard Java comm. We moved away from it due
> to some issues with supporting newer versions of Linux. There was a time
> when it was really hard to find.

I've been using javacomm for a while on various projects, and although
it can be a challenge to set it up sometimes, I've never really
encountered issues with it afterwards.

what part of the code would need to be changed to make this work with
javacomm?


> Can you get it to dump core and figure our where the bug occurs? That
> is, the line of code/memory access?

some more findings:

- happens both if the IBM JDK or the SUN JDK is used
- I'm on the x86_64 platform (don't know if it happens on 32 bit)
- only happens if there's some data to read from the serial port
- the segfault always happens at the same place, but obviously memory is
corrupted sometime beforehand


here's the output when trying in the SUN JDK (turned on the note()
function in the shared object):

$ java TestSerial -comm serial@/dev/ttyUSB0:telos
NativeSerial_linux /dev/ttyUSB0: constructor begin
NativeSerial_linux /dev/ttyUSB0: block_on_read begin
NativeSerial_linux /dev/ttyUSB0: block_on_read end
NativeSerial_linux /dev/ttyUSB0: get_modem_status begin
NativeSerial_linux /dev/ttyUSB0: get_modem_status end
NativeSerial_linux /dev/ttyUSB0: set_modem_status begin
NativeSerial_linux /dev/ttyUSB0: set_modem_status end
NativeSerial_linux /dev/ttyUSB0: get_modem_status begin
NativeSerial_linux /dev/ttyUSB0: get_modem_status end
NativeSerial_linux /dev/ttyUSB0: set_modem_status begin
NativeSerial_linux /dev/ttyUSB0: set_modem_status end
NativeSerial_linux /dev/ttyUSB0: constructor end
NativeSerial_linux /dev/ttyUSB0: setSerialPortParams begin
NativeSerial_linux /dev/ttyUSB0: get_comm_state begin
NativeSerial_linux /dev/ttyUSB0: get_comm_state end
NativeSerial_linux /dev/ttyUSB0: waitForEvent begin
NativeSerial_linux /dev/ttyUSB0: waitForEvent end
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x00002aaaaad3d685, pid=13027, tid=1088813376
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C  [libtoscomm.so+0x3685]
Java_net_tinyos_comm_TOSCommJNI_NativeSerial_1didEventOccur+0x5
#
# An error report file with more information is saved as hs_err_pid13027.log
NativeSerial_linux /dev/ttyUSB0: setSerialPortParams end
serial@/dev/ttyUSB0:115200: resynchronising
NativeSerial_linux /dev/ttyUSB0: available begin
NativeSerial_linux /dev/ttyUSB0: available end
NativeSerial_linux /dev/ttyUSB0: read begin
   ...  read: 00
NativeSerial_linux /dev/ttyUSB0: read end
NativeSerial_linux /dev/ttyUSB0: available begin
NativeSerial_linux /dev/ttyUSB0: available end
NativeSerial_linux /dev/ttyUSB0: available begin
NativeSerial_linux /dev/ttyUSB0: available end
Sending packet 0#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted



please find the error log attached


Akos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hs_err_pid13027.log
Type: text/x-log
Size: 18396 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070602/4a4e9e72/hs_err_pid13027-0001.bin


More information about the Tinyos-help mailing list