Bug 24251 - [4.0 Regression] BC-compiled interfaces in libgcj can't be called from non-BC code
Summary: [4.0 Regression] BC-compiled interfaces in libgcj can't be called from non-BC...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 4.0.3
Assignee: Andrew Haley
URL:
Keywords: wrong-code
Depends on: 21326
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-07 08:32 UTC by khiraly
Modified: 2005-10-14 13:15 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.0
Known to fail:
Last reconfirmed: 2005-10-11 17:58:46


Attachments
Testcase, java source file (528 bytes, text/plain)
2005-10-07 08:36 UTC, khiraly
Details
XML file, what the java program use (119 bytes, application/xml)
2005-10-07 08:37 UTC, khiraly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description khiraly 2005-10-07 08:32:09 UTC
Hi!

As discussed on the mailing list ( http://gcc.gnu.org/ml/java/2005-10/msg00025.html ), there is a segmentation fault problem using org.w3c.dom.* packages.

Verified on debian SID (me, gcj version 4.0.2) and on FC3 (David Daney, CVS head) using the small test program what was wirtten to demonstrate the segfault.

Here is the test program:
http://khiraly.4242.hu/tmp/saxsux/SaxSux.java
http://khiraly.4242.hu/tmp/saxsux/config.xml

Quick quide:
khiraly@elite:~/saxsux$ javac SaxSux.java
khiraly@elite:~/saxsux$ java SaxSux config.xml
Teszt
true
khiraly@elite:~/saxsux$ gcj-4.0 --main=SaxSux SaxSux.java
khiraly@elite:~/saxsux$ ./a.out config.xml
Aborted
khiraly@elite:~/saxsux$

gdb output (CVS HEAD):
#0  0xb7fe8402 in __kernel_vsyscall ()
#1  0x00b887d5 in raise () from /lib/tls/libc.so.6
#2  0x00b8a149 in abort () from /lib/tls/libc.so.6
#3  0xb74f81c7 in _Jv_Throw (value=0x17b7b0)
     at ../../../gcccvsmain/gcc/libjava/exception.cc:111
#4  0xb74ec0ea in catch_segv (_dummy=Could not find the frame base for 
"catch_segv".
) at ../../../gcccvsmain/gcc/libjava/prims.cc:152
#5  <signal handler called>
#6  0x0804a508 in org::w3c::dom::Node::class$ ()
#7  0x08049340 in SaxSux.getStringElement(java.lang.String) ()
#8  0x0804906e in SaxSux.main(java.lang.String[]) ()
#9  0xb75189d3 in gnu::java::lang::MainThread::call_main (this=0x62f18)
     at ../../../gcccvsmain/gcc/libjava/gnu/java/lang/natMainThread.cc:47
#10 0xb7559a07 in gnu.java.lang.MainThread.run() (this=0x62f18) at 
MainThread.java:105
#11 0xb75277eb in _Jv_ThreadRun (thread=0x62f18)
     at ../../../gcccvsmain/gcc/libjava/java/lang/natThread.cc:299
#12 0xb74ed03d in _Jv_RunMain (vm_args=0x0, klass=0x804a2c0, name=0x0, 
argc=2,
     argv=0xbf8e5bd4, is_jar=false) at 
../../../gcccvsmain/gcc/libjava/prims.cc:1386
#13 0xb74ed1a2 in _Jv_RunMain (klass=0x804a2c0, name=0x0, argc=2, 
argv=0xbf8e5bd4,
     is_jar=false) at ../../../gcccvsmain/gcc/libjava/prims.cc:1397
#14 0xb74ed1e7 in JvRunMain (klass=0x804a2c0, argc=2, argv=0xbf8e5bd4)
     at ../../../gcccvsmain/gcc/libjava/prims.cc:1403
#15 0x08048fc4 in main ()

Best regards, 
 Khiraly
Comment 1 khiraly 2005-10-07 08:36:12 UTC
Created attachment 9917 [details]
Testcase, java source file

Exactly the same file, what is available on:
http://khiraly.4242.hu/tmp/saxsux/SaxSux.java
Comment 2 khiraly 2005-10-07 08:37:12 UTC
Created attachment 9918 [details]
XML file, what the java program use

Exactly the same file, what is available on:
http://khiraly.4242.hu/tmp/saxsux/config.xml
Comment 3 CVS Commits 2005-10-13 17:36:12 UTC
Subject: Bug 24251

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2005-10-13 17:36:07

Modified files:
	libjava        : ChangeLog link.cc 

Log message:
	2005-10-12  Andrew Haley  <aph@redhat.com>
	
	PR java/24251
	* link.cc (ensure_method_table_complete): Install Miranda methods
	for interfaces too.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3754&r2=1.3755
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/link.cc.diff?cvsroot=gcc&r1=1.18&r2=1.19

Comment 4 CVS Commits 2005-10-14 11:41:43 UTC
Subject: Bug 24251

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	aph@gcc.gnu.org	2005-10-14 11:41:40

Modified files:
	libjava        : link.cc ChangeLog 

Log message:
	2005-10-12  Andrew Haley  <aph@redhat.com>
	
	PR java/24251
	* link.cc (ensure_method_table_complete): Install Miranda methods
	for interfaces too.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/link.cc.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.10.2.5&r2=1.10.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3391.2.107&r2=1.3391.2.108

Comment 5 Andrew Pinski 2005-10-14 13:15:38 UTC
Fixed.