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 removed all about parallel, I2C, RS485 and raw in the rxtx driver, and now
it's working for serial port.

Thanks.

Quoting Andrew Haley <aph@redhat.com>:

roychris@free.fr writes:
> 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 :


This doesn't seem to make sense.  Your JNI programs seem to be written
in C, and C doesn't have methods.  C only has functions, and if you
have multiple functions called send_event then the shared library
loader will call the first function it finds that has the same name.
It doesn't prefer the function that is in the same file as the
caller.

I can't imagine what is supposed to happen here.  Can you just remove
SerialImp.c or ParallelImp.c?

Andrew.




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