Weird segmentation fault

Geert Bevin
Fri Apr 18 13:25:00 GMT 2003


I'm trying to integrate java with c++ using cni and I get the following 
weird segmentation fault. I'm probably doing something wong but I can't 
find what.

I've attached the 2 files that I'm using. I compile this as follows :

gcj -c
gcj -C
gcjh Dispatcher
g++ -I. -c
gcc -o main *.o -lgcj

Then I execute with


and immediately get a segmentation fault.

Does someone knows why?

These are the details about my environment :

Gentoo Base System version
gbevin@pine callbacks $ uname -a
Linux pine 2.4.20-ben10 #1 Sat Apr 12 11:56:17 CEST 2003 ppc  7455, 
altivec supported GNU/Linux
gbevin@pine callbacks $ gcj -v
Reading specs from 
Reading specs from 
rename spec lib to liborig
Configured with: ../configure --prefix=/opt/gcc-3.3-cvs 
--enable-threads=posix --enable-shared : (reconfigured) ../configure 
--prefix=/opt/gcc-3.3-cvs --enable-threads=posix --enable-shared 
Thread model: posix
gcc version 3.3 20030412 (prerelease)
gbevin@pine callbacks $ echo $CLASSPATH
gbevin@pine callbacks $ ldd --version
ldd (GNU libc) 2.3.2

This is what main is linked against :

gbevin@pine callbacks $ ldd main => /opt/gcc-3.3-cvs/lib/ (0x0f74c000) => /lib/ (0x0f5f1000) => /lib/ (0x0f580000) => /lib/ (0x0f55d000) => /opt/gcc-3.3-cvs/lib/ (0x0f531000)
         /lib/ => /lib/ (0x30000000)

This is what gdb gives me :

gbevin@pine callbacks $ gdb ./main
GNU gdb 5.3
This GDB was configured as "powerpc-unknown-linux-gnu"...
(gdb) run
Starting program: /data/Workspace/bagheera/design/poc/callbacks/main
[New Thread 16384 (LWP 2283)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 2283)]
_Jv_equalUtf8Consts(_Jv_Utf8Const*, _Jv_Utf8Const*) (a=0x0, b=0xfd95560)
     at ../../../libjava/
146     ../../../libjava/ No such file or directory.
         in ../../../libjava/
Current language:  auto; currently c++

Thanks for the help,

Geert Bevin

Geert Bevin                       Uwyn
"Use what you need"               Lambermontlaan 148               1030 Brussels
gbevin[remove] at uwyn dot com    Tel & Fax +32 2 245 41 06

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers,
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
URL: <>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
URL: <>

More information about the Java mailing list