public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/21326] New: _Jv_Linker
@ 2005-05-02  3:19 rspencer at x10sys dot com
  2005-05-02  3:21 ` [Bug libgcj/21326] seg fault in _Jv_Linker pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: rspencer at x10sys dot com @ 2005-05-02  3:19 UTC (permalink / raw)
  To: java-prs

gcc configured with:--prefix=/proj/install --enable-shared
--enable-threads=posix --enable-clocale=gnu --with-gnu-as --with-gnu-ld
--disable-nls --with-system-zlib
Operating System: Fedora Core 3

This is *not* the gcj that is installed with FC3, I compiled it separately. The
libgcj is *not* the one installed with FC3, its the one I compiled from GCC 4.0.0

Attempting to run JING (a Relax NG based XML validator) after compilation with
GCJ yields a SIGSEGV in _Jv_Linker::prepare_constant_time_tables in file
libjava/link.cc at line 519. The code in this method traverses a list. One of
the pointers (klass0) in that list has value 1 which when de-referenced causes
the SIGSEGV. 

To recreate:
1. wget http://www.thaiopensource.com/download/gcj/jing-20030619.tar.gz
2. tar zxf jing-20030619.tar.gz
3. configure
4. make (13 warnings about deprecated classes)
5. cd test
6. make

JING is 330K of Java source so I didn't attach it. But, you can get it from the
URL above. I don't really care if its against the "reporting rules" for GCC.
This is a runtime error, not a compilation error (that I can tell).

GDB produces this trace:

#0  _Jv_Linker::prepare_constant_time_tables (klass=0x81415e0)
    at ../../../gcc/libjava/link.cc:519
#1  0xb771c20a in _Jv_Linker::wait_for_state (klass=0x81415e0, state=9)
    at ../../../gcc/libjava/link.cc:1712
#2  0xb774c816 in java::lang::VMClassLoader::resolveClass (klass=0x81415e0)
    at ../../../gcc/libjava/java/lang/natVMClassLoader.cc:44
#3  0xb77438be in java::lang::Class::initializeClass (this=0x81415e0)
    at ../../../gcc/libjava/java/lang/natClass.cc:728
#4  0xb770dca0 in _Jv_AllocObjectNoFinalizer (klass=0x81415e0) at Class.h:576
#5  0x0807fb67 in
com.thaiopensource.validate.auto.AutoSchemaReceiver.installHandlers(org.xml.sax.XMLReader)
(this=0x2, xr=0xe3de8)
    at AutoSchemaReceiver.java:92
#6  0x0807ee0e in
com.thaiopensource.validate.auto.AutoSchemaReader.createSchema(org.xml.sax.InputSource,
com.thaiopensource.util.PropertyMap) (this=0x4add8,
    in=0xa79d8, properties=0xa5ca0) at AutoSchemaReader.java:65
#7  0x0807a566 in
com.thaiopensource.validate.ValidationDriver.loadSchema(org.xml.sax.InputSource)
(this=0x4d758, in=0x1) at ValidationDriver.java:148
#8  0x0808da5e in
com.thaiopensource.relaxng.util.TestDriver.loadSchema(java.io.File)
(this=0x4f570, schema=0x2) at TestDriver.java:133
#9  0x0808dbea in
com.thaiopensource.relaxng.util.TestDriver.runTestCase(java.io.File)
(this=0x4f570, dir=0x4adb0) at TestDriver.java:92
#10 0x0808de65 in
com.thaiopensource.relaxng.util.TestDriver.runTestSuite(java.io.File)
(this=0x4f570, dir=0x4adb8) at TestDriver.java:81
#11 0x0808d8b3 in
com.thaiopensource.relaxng.util.TestDriver.doMain(java.lang.String[])
(this=0x4f570, args=0x24d00) at TestDriver.java:60
#12 0x0808d5f8 in
com.thaiopensource.relaxng.util.TestDriver.main(java.lang.String[]) (args=0x2)
at TestDriver.java:21
#13 0xb773bdc3 in gnu::java::lang::MainThread::call_main (this=0x77f18)
    at ../../../gcc/libjava/gnu/java/lang/natMainThread.cc:47
#14 0xb77e10de in gnu.java.lang.MainThread.run() (this=0x77f18)

The output on the stderr is this:

Exception in thread "main" java.lang.LinkageError: unexpected exception during
linking: com.thaiopensource.validate.auto.AutoSchemaReceiver$Handler
   at java.lang.VMClassLoader.transformException(java.lang.Class,
java.lang.Throwable) (/proj/install/lib/libgcj.so.6.0.0)
   at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/proj/install/lib/libgcj.so.6.0.0)
   at java.lang.Class.initializeClass() (/proj/install/lib/libgcj.so.6.0.0)
   at
com.thaiopensource.validate.auto.AutoSchemaReceiver.installHandlers(org.xml.sax.XMLReader)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/validate/auto/AutoSchemaReceiver.java:92)
   at
com.thaiopensource.validate.auto.AutoSchemaReader.createSchema(org.xml.sax.InputSource,
com.thaiopensource.util.PropertyMap)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/validate/auto/AutoSchemaReader.java:65)
   at
com.thaiopensource.validate.ValidationDriver.loadSchema(org.xml.sax.InputSource)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/validate/ValidationDriver.java:148)
   at com.thaiopensource.relaxng.util.TestDriver.loadSchema(java.io.File)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/relaxng/util/TestDriver.java:133)
   at com.thaiopensource.relaxng.util.TestDriver.runTestCase(java.io.File)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/relaxng/util/TestDriver.java:92)
   at com.thaiopensource.relaxng.util.TestDriver.runTestSuite(java.io.File)
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/relaxng/util/TestDriver.java:82)
   at com.thaiopensource.relaxng.util.TestDriver.doMain(java.lang.String[])
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/relaxng/util/TestDriver.java:61)
   at com.thaiopensource.relaxng.util.TestDriver.main(java.lang.String[])
(/proj/jing/jing-20030619/test/./src/com/thaiopensource/relaxng/util/TestDriver.java:21)
   at gnu.java.lang.MainThread.call_main() (/proj/install/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/proj/install/lib/libgcj.so.6.0.0)
Caused by: java.lang.NullPointerException
   at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/proj/install/lib/libgcj.so.6.0.0)
   ...11 more

-- 
           Summary: _Jv_Linker
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rspencer at x10sys dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
  2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
@ 2005-05-02  3:21 ` pinskia at gcc dot gnu dot org
  2005-05-03 18:29 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-02  3:21 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
            Summary|_Jv_Linker                  |seg fault in _Jv_Linker


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
  2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
  2005-05-02  3:21 ` [Bug libgcj/21326] seg fault in _Jv_Linker pinskia at gcc dot gnu dot org
@ 2005-05-03 18:29 ` tromey at gcc dot gnu dot org
  2005-05-03 22:16 ` rspencer at x10sys dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-05-03 18:29 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-05-03 18:29 -------
I didn't download the source to try this out.
But based on the stack trace, I think the problem is probably that
a class compiled with the C++ ABI is referring to an org.xml class.
This doesn't work, as these classes are compiled with the BC ABI
(i.e., -findirect-dispatch).

This is unfortunate, but necessary to support java.endorsed.dirs.
The restriction that a C++ ABI class can't directly refer to a BC ABI class
is unlikely to be lifted.

The fix is to compile your program with -findirect-dispatch.
(But note that at the moment this only works when compiling from .class)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
  2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
  2005-05-02  3:21 ` [Bug libgcj/21326] seg fault in _Jv_Linker pinskia at gcc dot gnu dot org
  2005-05-03 18:29 ` tromey at gcc dot gnu dot org
@ 2005-05-03 22:16 ` rspencer at x10sys dot com
  2005-05-04 16:55 ` rspencer at x10sys dot com
  2005-05-04 19:49 ` rspencer at x10sys dot com
  4 siblings, 0 replies; 8+ messages in thread
From: rspencer at x10sys dot com @ 2005-05-03 22:16 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rspencer at x10sys dot com  2005-05-03 22:16 -------
I don't see how that is possible on the application side as the source code is
100% Java and it is all compiled with the same options (there's only one
compilation command that compiles all sources). Perhaps you are suggesting that
libgcj is compiled differently from the application?  If so, shouldn't the
default compilation flags automatically work correctly with libgcj? The only
flags given are "-g -02".

So, I tried your suggestion. I compiled JING with HotSpot 1.4.2. It compiled
fine to .class files via javac 1.4.2.  I compiled the .class files (one command
line again) with GCJ using the -findirect-dispatch option. GCJ gave hundreds of
errors. Most of the errors were about "finalized field 'xyz' may not have been
initialized".  That sounds more like a warning to me, but I wouldn't know. I
take it that GCJ doesn't like foreign compiled .class files?

I'm not sure where to go from here except to give up on GCJ. Any other suggestions?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
  2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
                   ` (2 preceding siblings ...)
  2005-05-03 22:16 ` rspencer at x10sys dot com
@ 2005-05-04 16:55 ` rspencer at x10sys dot com
  2005-05-04 19:49 ` rspencer at x10sys dot com
  4 siblings, 0 replies; 8+ messages in thread
From: rspencer at x10sys dot com @ 2005-05-04 16:55 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rspencer at x10sys dot com  2005-05-04 16:55 -------
One other note. Shouldn't the segfault in _Jv_Linker be fixed anyway?
Dereferencing a point of value 0x01 isn't likely to be valid in any circumstances?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
  2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
                   ` (3 preceding siblings ...)
  2005-05-04 16:55 ` rspencer at x10sys dot com
@ 2005-05-04 19:49 ` rspencer at x10sys dot com
  4 siblings, 0 replies; 8+ messages in thread
From: rspencer at x10sys dot com @ 2005-05-04 19:49 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rspencer at x10sys dot com  2005-05-04 19:48 -------
Okay, after fixing some makefile bugs, the workaround suggested by Tom worked.

Feel free to close this now unless you want to track down the SIGSEGV.

Reid

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
       [not found] <bug-21326-10546@http.gcc.gnu.org/bugzilla/>
  2005-10-13 18:41 ` pinskia at gcc dot gnu dot org
@ 2005-11-01 15:17 ` tromey at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-11-01 15:17 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from tromey at gcc dot gnu dot org  2005-11-01 15:17 -------
Fixed.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libgcj/21326] seg fault in _Jv_Linker
       [not found] <bug-21326-10546@http.gcc.gnu.org/bugzilla/>
@ 2005-10-13 18:41 ` pinskia at gcc dot gnu dot org
  2005-11-01 15:17 ` tromey at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-13 18:41 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-10-13 18:41 -------
I think this a dup of bug 24251 which was just fixed on the mainline, if you
want to try again, that would be nice.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21326


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-01 15:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02  3:19 [Bug libgcj/21326] New: _Jv_Linker rspencer at x10sys dot com
2005-05-02  3:21 ` [Bug libgcj/21326] seg fault in _Jv_Linker pinskia at gcc dot gnu dot org
2005-05-03 18:29 ` tromey at gcc dot gnu dot org
2005-05-03 22:16 ` rspencer at x10sys dot com
2005-05-04 16:55 ` rspencer at x10sys dot com
2005-05-04 19:49 ` rspencer at x10sys dot com
     [not found] <bug-21326-10546@http.gcc.gnu.org/bugzilla/>
2005-10-13 18:41 ` pinskia at gcc dot gnu dot org
2005-11-01 15:17 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).