This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling rxtx with gcj


I compiled the libraries without optimisation.
I run the program with gdb with a breakpoint just before the seg fault :

Starting program: /home/fbr/rxtx-2.1-6/test
[Thread debugging using libthread_db enabled]
[New Thread -1228843328 (LWP 15033)]
[New Thread -1229452368 (LWP 15034)]
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyS0
Found port: /dev/ttyS0
[New Thread -1238045776 (LWP 15035)]
[New Thread -1246434384 (LWP 15036)]
[Switching to Thread -1238045776 (LWP 15035)]

Breakpoint 1, report_serial_events (eis=0xb634e1c8) at
/home/fbr/rxtx-2.1-6/src/SerialImp.c:3570
3570                    if(!send_event( eis, SPE_DATA_AVAILABLE, 1 ))
(gdb) step
send_event (env=0xb634e1c8, jobj=0x1, type=1, flag=-1227867629) at
/home/fbr/rxtx-2.1-6/src/ParallelImp.c:797
797             jclass jclazz = (*env)->GetObjectClass( env, jobj );

I really don't understand why when SerialImp.c call send_event method it's the
ParallelImp.c one that is called. They don't have the same number of
argument !
The good send_event method in this context is at line 4430 in SerialImp.c .
I tried to declare the two functions (in ParallelImp.c and SerialImp.c) static
and I have the same problem in another function :

#5  0xb7fd858e in read_byte_array (fd=135045720, buffer=0xb634dcd0 " Ï\017",
length=3, timeout=997800)
   at /home/fbr/rxtx-2.1-6/src/I2CImp.c:741
#6  0xb637b10b in Java_gnu_io_RXTXPort_readArray (env=0x80ca258, jobj=0xfcfa0,
jbarray=0xf39a0, offset=0, length=2)
   at /home/fbr/rxtx-2.1-6/src/SerialImp.c:3119
#7  0x0806d7cb in gnu.io.RXTXPort.readArray(byte[], int, int) () at
RXTXPort.java:451
#8  0x0806b9c9 in gnu.io.RXTXPort$SerialInputStream.read(byte[], int,
int) () at
RXTXPort.java:1233
#9  0x0806b6b4 in gnu.io.RXTXPort$SerialInputStream.read(byte[]) () at
RXTXPort.java:1160
#10 0x08072525 in serialdemo.SimpleRead.serialEvent(gnu.io.SerialPortEvent)
(this=0xaaaf0, event=0xfbe10) at SimpleRead.java:173
#11 0x0806dff8 in gnu.io.RXTXPort.sendEvent(int, boolean) () at
RXTXPort.java:668
#12 0xb7910f87 in ffi_call_SYSV () from /usr/lib/libgcj.so.6
#13 0xb7910c03 in ffi_call () from /usr/lib/libgcj.so.6
#14 0xb74f0553 in _Jv_CallAnyMethodA () from /usr/lib/libgcj.so.6
#15 0xb74b5a07 in JNI_GetCreatedJavaVMs () from /usr/lib/libgcj.so.6
#16 0xb74b5abe in JNI_GetCreatedJavaVMs () from /usr/lib/libgcj.so.6
#17 0xb6d04898 in send_event (eis=0xb634e1c8, type=1, flag=1) at
/home/fbr/rxtx-2.1-6/src/SerialImp.c:4450
#18 0xb6d03a96 in report_serial_events (eis=0xb634e1c8) at
/home/fbr/rxtx-2.1-6/src/SerialImp.c:3570
#19 0xb637bfc7 in Java_gnu_io_RXTXPort_eventLoop (env=0x80ca258, jobj=0xfcfa0)
at /home/fbr/rxtx-2.1-6/src/SerialImp.c:3735
#20 0x0806d844 in gnu.io.RXTXPort.eventLoop() () at RXTXPort.java:451
-

Quoting Tom Tromey <tromey@redhat.com>:

">" == roychris <roychris@free.fr> writes:

#5  0xb7fd4341 in send_event (env=0xb63501c8, jobj=0x1, type=1,
    flag=-1227872198) at /home/fbr/rxtx-2.1-6/src/ParallelImp.c:796

jobj=0x1? That looks wrong.


796 jclass jclazz = (*env)->GetObjectClass( env, jobj );

.. and could certainly cause a crash here (well, inside GetObjectClass) when we try to dereference jobj.

So the next question is, why is it 0x1?

Tom




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]