public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/41375]  New: Compiling native executable without -findirect-dispatch causes random SEGVs
@ 2009-09-16 12:10 yuri at tsoft dot com
  2009-09-16 12:12 ` [Bug java/41375] " yuri at tsoft dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yuri at tsoft dot com @ 2009-09-16 12:10 UTC (permalink / raw)
  To: java-prs

I have a simple Java class that doesn't directly depend on anything except for
java.lang.String, java.lang.reflect.Class and java.lang.reflect.Method.

It loads other classes (from jars in my case) by name and invoked them through
Class.forName()/Method.invoke() mechanism.

But it only works when -findirect-dispatch is specified. Without
-findirect-dispatch it crashes shortly into the run with the stack below.

-findirect-dispatch should only impact the way how currently compiled unit
links to other units. In case of the programs like mine (not dependent on
anything else directly) -findirect-dispatch should have no impact at all. It
should resolve classes and run them the same way, since in this scenario it's
clear what should be done to load other classes.

--- stack (debug info is not everywhere) ---
0x35ec31a7 in __error () from /lib/libthr.so.3
#1  0x35ec2d88 in __error () from /lib/libthr.so.3
#2  0x36005860 in ?? ()
#3  0x00000008 in ?? ()
#4  0x00000001 in ?? ()
#5  0x36005840 in ?? ()
#6  0x00000000 in ?? ()
#7  0x00000001 in ?? ()
#8  0x33c718d4 in ?? () from /libexec/ld-elf.so.1
#9  0x35ec16df in pthread_setcancelstate () from /lib/libthr.so.3
#10 0x35ec0f7d in pthread_cond_signal () from /lib/libthr.so.3
#11 0x347e57e8 in _Jv_CondWait (cv=0x35e5b78c, mu=0x35e5b780, millis=0,
nanos=0) at ../../../gcc-4.4.1/libjava/posix-threads.cc:212
#12 0x8c347cb0 in ?? ()
#13 0x35e5b78c in _ZL5mutex () from /usr/local/gcc/4.4.1-java/lib/libgcj.so.10
#14 0x35e5b780 in E () from /usr/local/gcc/4.4.1-java/lib/libgcj.so.10
#15 0x00000000 in ?? ()
#16 0x00000000 in ?? ()
#17 0x00000000 in ?? ()
#18 0x00000001 in ?? ()
#19 0x33c4e998 in dladdr () from /libexec/ld-elf.so.1


-- 
           Summary: Compiling native executable without -findirect-dispatch
                    causes random SEGVs
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com


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


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

* [Bug java/41375] Compiling native executable without -findirect-dispatch causes random SEGVs
  2009-09-16 12:10 [Bug java/41375] New: Compiling native executable without -findirect-dispatch causes random SEGVs yuri at tsoft dot com
@ 2009-09-16 12:12 ` yuri at tsoft dot com
  2009-09-16 20:01 ` yuri at tsoft dot com
  2009-10-19  9:01 ` aph at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: yuri at tsoft dot com @ 2009-09-16 12:12 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from yuri at tsoft dot com  2009-09-16 12:12 -------
I should also add that one of the classes has native methods, and crash occurs
shortly after the first such method is invoked.

This may or may not be a factor in the issue.

Testcase is quite large and I can't submit it here.


-- 


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


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

* [Bug java/41375] Compiling native executable without -findirect-dispatch causes random SEGVs
  2009-09-16 12:10 [Bug java/41375] New: Compiling native executable without -findirect-dispatch causes random SEGVs yuri at tsoft dot com
  2009-09-16 12:12 ` [Bug java/41375] " yuri at tsoft dot com
@ 2009-09-16 20:01 ` yuri at tsoft dot com
  2009-10-19  9:01 ` aph at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: yuri at tsoft dot com @ 2009-09-16 20:01 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from yuri at tsoft dot com  2009-09-16 20:01 -------
Created an attachment (id=18599)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18599&action=view)
Java proxy example that crashes without -findirect-dispatch

Try making an executable with -findirect-dispatch and run some large
application through it's 'main' method.

I get SEGV from inside this application.

FreeBSD-72-STABLE


-- 


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


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

* [Bug java/41375] Compiling native executable without -findirect-dispatch causes random SEGVs
  2009-09-16 12:10 [Bug java/41375] New: Compiling native executable without -findirect-dispatch causes random SEGVs yuri at tsoft dot com
  2009-09-16 12:12 ` [Bug java/41375] " yuri at tsoft dot com
  2009-09-16 20:01 ` yuri at tsoft dot com
@ 2009-10-19  9:01 ` aph at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: aph at gcc dot gnu dot org @ 2009-10-19  9:01 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from aph at gcc dot gnu dot org  2009-10-19 09:01 -------
Works for me on GNU/Linux:

ClassNotFoundException: java.lang.ClassNotFoundException: my.other.class not
found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
Exception in thread "main" java.lang.ExceptionInInitializerError
   at java.lang.Class.initializeClass(libgcj.so.10)
   at MyProxy.main(a.out)
Caused by: java.lang.NullPointerException
   at MyProxy.<clinit>(a.out)
   at java.lang.Class.initializeClass(libgcj.so.10)
   ...1 more


-- 

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


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


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

end of thread, other threads:[~2009-10-19  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16 12:10 [Bug java/41375] New: Compiling native executable without -findirect-dispatch causes random SEGVs yuri at tsoft dot com
2009-09-16 12:12 ` [Bug java/41375] " yuri at tsoft dot com
2009-09-16 20:01 ` yuri at tsoft dot com
2009-10-19  9:01 ` aph 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).