Bug 151955 - Mismatch between CNI and Java objects
Mismatch between CNI and Java objects
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Andrew Haley
:
Depends On:
Blocks: 153674
  Show dependency treegraph
 
Reported: 2005-03-23 15:26 EST by Andrew Cagney
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-13 10:46:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Andrew Cagney 2005-03-23 15:26:21 EST
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 15:26:21 EST
Created attachment 112280 [details]
sample source
Comment 2 Andrew Haley 2005-03-31 02:27:06 EST
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 03:26:58 EST
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 03:28:35 EST
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 05:02:47 EST
dwmw2 has managed to duplicate this bug on his box.  Investigating.
Comment 6 Andrew Haley 2005-03-31 06:12:35 EST
Have duplicated the fault with gcc-java-4.0.0-0.37 on ppc.
Comment 8 Tom Tromey 2005-04-04 14:47:48 EDT
See this thread for more information:

http://gcc.gnu.org/ml/gcc/2005-04/msg00139.html
Comment 9 Andrew Haley 2005-04-05 04:59:03 EDT
This is now gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763.
Comment 10 Andrew Cagney 2005-04-06 10:27:51 EDT
GCC blah.40 fixes the problem (well at least passes my test case :-)

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