Given a nested class, the CNI and java layouts don't match. This leads to (on PPC) a null pointer crash (this$0 wasn't initialized) (i386 crashes in similar wierd ways).
Created attachment 112280 [details] sample source
Seems to be unrepro for me, at least on x86. zapata:~/cni-inner $ make gcj -C x/Parent.java gcj -C x/Child.java gcjh x.Parent -o x/Parent.h gcjh x.Child -o x/Child.h gcjh 'x.Child$Nested' -o 'x/Child$Nested.h' gcj -g -I. -I/home/aph/gcc/install/lib/gcc/i686-pc-linux-gnu/include --main=x.Child x/Parent.java x/Child.java x/native.cxx zapata:~/cni-inner $ ./a.out 0
And on PPC-64. fish:~ $ tar xzf cni-inner-1.tar.gz fish:~ $ cd cni-inner fish:~/cni-inner $ make gcj -C x/Parent.java gcj -C x/Child.java gcjh x.Parent -o x/Parent.h gcjh x.Child -o x/Child.h gcjh 'x.Child$Nested' -o 'x/Child$Nested.h' gcj -g -I. --main=x.Child x/Parent.java x/Child.java x/native.cxx fish:~/cni-inner $ ./a.out 0 fish:~/cni-inner $ uname -a Linux fish.cambridge.redhat.com 2.6.11-1.1177_FC4 #1 SMP Tue Mar 8 17:35:29 EST 2005 ppc64 ppc64 ppc64 GNU/Linux
And on PPC-32. fish:~/cni-inner $ make make: Warning: File `Makefile' has modification time 3.7e+03 s in the future gcj -C x/Parent.java gcj -C x/Child.java gcjh x.Parent -o x/Parent.h gcjh x.Child -o x/Child.h gcjh 'x.Child$Nested' -o 'x/Child$Nested.h' gcj -m32 -g -I. --main=x.Child x/Parent.java x/Child.java x/native.cxx make: warning: Clock skew detected. Your build may be incomplete. fish:~/cni-inner $ ./a.out 0 fish:~/cni-inner $ file a.out a.out: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
dwmw2 has managed to duplicate this bug on his box. Investigating.
Have duplicated the fault with gcc-java-4.0.0-0.37 on ppc.
See this thread for more information: http://gcc.gnu.org/ml/gcc/2005-04/msg00139.html
This is now gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763.
GCC blah.40 fixes the problem (well at least passes my test case :-)
OK, thanks for trying it. This turned out to be quite a longstanding C++ compiler bug that no-one had noticed before. This should percolate through to the Fedora compiler Real Soon Now. Sorry I doubted you...