Compiling rxtx with gcj
roychris@free.fr
roychris@free.fr
Wed Sep 21 16:28:00 GMT 2005
Hi,
I'm trying to compile rxtx with gcj. I obtained the same result with rxtx2.1.6
rxtx2.1.7* and with gcj 4.0.1 4.0.2 and 4.1.0 and on a local i686 (on debian
sid) and a target i386 (make with buildroot) with respectively kernel 2.6.11
and 2.6.12. I use too libgcj.so.6
When I execute the simpleread test program with java sun or kaffe, I have no
problem.
So, to make a native application, I build a rxtx library :
gcj -shared -findirect-dispatch -Wl,-Bsymbolic -fPIC -fjni -o
/lib/librxtxComm.so ./RXTXcomm.jar
And after, I build the program :
gcj -lrxtxI2C -lrxtxParallel -lrxtxRaw -lrxtxRS485 -lrxtxComm
-findirect-dispatch -Wl,-Bsymbolic -fPIC -DPIC -fjni ../serialdemo.jar -o
simpleread --main=serialdemo.SimpleRead
I did the same for the simple write program and it worked.
When I execute it, the program wait data on serial port, but when it received
them, it aborted.
The end of the strace is :
-----------------------------------------------------------------------
ioctl(3, SNDCTL_TMR_START or TCSETS, {B9600 -opost -isig -icanon -echo ...}) =
0ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo
...}) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb5351000
mprotect(0xb5351000, 4096, PROT_NONE) = 0
clone(child_stack=0xb5b504c4,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb5b50bf8, {entry_number:6, base_addr:0xb5b50bb0, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,
useable:1}, child_tidptr=0xb5b50bf8) = 12040
futex(0x42dac, FUTEX_WAIT, 0, NULL) = 0
futex(0xb7f41ca4, FUTEX_WAIT, 1, NULL) = -1 EINTR (Interrupted system call)
--- SIGIO (I/O possible) @ 0 (0) ---
futex(0xb7f41ca4, FUTEX_WAIT, 1, NULL) = -1 EINTR (Interrupted system call)
+++ killed by SIGABRT (core dumped) +++
-------------------------------------------------------------------------
With the core, gdb say :
(gdb) bt
#0 0xb6d329e7 in raise () from /lib/tls/libc.so.6
#1 0xb6d3431b in abort () from /lib/tls/libc.so.6
#2 0xb74bbd61 in _Jv_Throw () from /usr/lib/libgcj.so.6
#3 0xb74b01d9 in _Jv_remJ () from /usr/lib/libgcj.so.6
#4 <signal handler called>
#5 0xb7fd4341 in send_event (env=0xb63501c8, jobj=0x1, type=1,
flag=-1227872198) at /home/fbr/rxtx-2.1-6/src/ParallelImp.c:796
#6 0xb6d028a9 in report_serial_events (eis=0xb63501c8)
at /home/fbr/rxtx-2.1-6/src/SerialImp.c:3568
#7 0xb637d397 in Java_gnu_io_RXTXPort_eventLoop (env=0x80ca248, jobj=0xfcfa0)
at /home/fbr/rxtx-2.1-6/src/SerialImp.c:3733
#8 0x0806d844 in gnu.io.RXTXPort.eventLoop() () at RXTXPort.java:451
#9 0x0806bb91 in gnu.io.RXTXPort$MonitorThread.run() () at RXTXPort.java:1292
#10 0xb74ec756 in _Jv_ThreadRun () from /usr/lib/libgcj.so.6
#11 0xb74ffe1a in _Jv_ThreadUnRegister () from /usr/lib/libgcj.so.6
#12 0xb79217e5 in GC_start_routine () from /usr/lib/libgcj.so.6
#13 0xb6e5eccd in start_thread () from /lib/tls/libpthread.so.0
#14 0xb6ddab0e in clone () from /lib/tls/libc.so.6
791 ----------------------------------------------------------*/
792 int send_event(JNIEnv *env, jobject jobj, jint type, int flag)
793 {
794 int result;
795 jmethodID foo;
796 jclass jclazz = (*env)->GetObjectClass( env, jobj );
797
798 if(jclazz == NULL) return JNI_TRUE;
799 foo = (*env)->GetMethodID( env, jclazz, "sendEvent", "(IZ)Z" );
I'm not able to find the problem. Do you have an idea ?
Thanks
More information about the Java
mailing list