Bug 151955 - Mismatch between CNI and Java objects
Summary: Mismatch between CNI and Java objects
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Andrew Haley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 153674
TreeView+ depends on / blocked
 
Reported: 2005-03-23 20:26 UTC by Andrew Cagney
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-13 14:46:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
sample source (722 bytes, application/x-gzip)
2005-03-23 20:26 UTC, Andrew Cagney
no flags Details

Description Andrew Cagney 2005-03-23 20:26:21 UTC
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).

Comment 1 Andrew Cagney 2005-03-23 20:26:21 UTC
Created attachment 112280 [details]
sample source

Comment 2 Andrew Haley 2005-03-31 07:27:06 UTC
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


Comment 3 Andrew Haley 2005-03-31 08:26:58 UTC
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


Comment 4 Andrew Haley 2005-03-31 08:28:35 UTC
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


Comment 5 Andrew Haley 2005-03-31 10:02:47 UTC
dwmw2 has managed to duplicate this bug on his box.  Investigating.


Comment 6 Andrew Haley 2005-03-31 11:12:35 UTC
Have duplicated the fault with gcc-java-4.0.0-0.37 on ppc.


Comment 8 Tom Tromey 2005-04-04 18:47:48 UTC
See this thread for more information:

http://gcc.gnu.org/ml/gcc/2005-04/msg00139.html


Comment 9 Andrew Haley 2005-04-05 08:59:03 UTC
This is now gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763.


Comment 10 Andrew Cagney 2005-04-06 14:27:51 UTC
GCC blah.40 fixes the problem (well at least passes my test case :-)



Comment 11 Andrew Haley 2005-04-06 14:32:00 UTC
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...





Note You need to log in before you can comment on or make changes to this bug.