[Bug java/41745] New: Segmentation fault when ecj.jar is run as a binary compiled by gcj

View: New views
6 Messages — Rating Filter:   Alert me  

[Bug java/41745] New: Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use this command line:
gcj -o ecj --main=org.eclipse.jdt.internal.compiler.batch.Main
/usr/local/share/java/ecj.jar
to compile ecj.jar into native binary ecj.

However, when I try running resulting binary on Hello World Java program it
crashes. Original ecj.jar compiles HelloWorld successfully.

public class HelloWorld {
  public static void main(String args[]) {
    System.out.println("Hello World!");
  }
}


--
           Summary: Segmentation fault when ecj.jar is run as a binary
                    compiled by gcj
           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=41745


[Bug java/41745] Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from aph at gcc dot gnu dot org  2009-10-19 09:08 -------
Works for me:

 $ gcj -o ecj --main=org.eclipse.jdt.internal.compiler.batch.Main
/usr/share/java/ecj.jar
 $ ./ecj HelloWorld.java
 $ java HelloWorld
Hello World!


--

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


[Bug java/41745] Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from yuri at tsoft dot com  2009-10-19 09:23 -------
No, it doesn't work for me on FreeBSD-8.0:

/usr/local/gcc/4.4.1-java/bin/gcj -o ecj
--main=org.eclipse.jdt.internal.compiler.batch.Main
/usr/local/share/java/ecj.jar

LD_LIBRARY_PATH=/usr/local/gcc/4.4.1-java/lib ldd ./ecj
./ecj:
        libgcc_s.so.1 => /usr/local/gcc/4.4.1-java/lib/libgcc_s.so.1
(0x341ba000)
        libgcj.so.10 => /usr/local/gcc/4.4.1-java/lib/libgcj.so.10 (0x341c6000)
        libm.so.5 => /lib/libm.so.5 (0x363d9000)
        libthr.so.3 => /lib/libthr.so.3 (0x363f3000)
        librt.so.1 => /usr/lib/librt.so.1 (0x36408000)
        libc.so.7 => /lib/libc.so.7 (0x3640d000)

LD_LIBRARY_PATH=/usr/local/gcc/4.4.1-java/lib ./ecj HelloWorld.java
Segmentation fault: 11

backtrace:
#0  0x364041c7 in __error () from /lib/libthr.so.3
#1  0x36403da8 in __error () from /lib/libthr.so.3
#2  0x36606820 in ?? ()
#3  0x00000008 in ?? ()
#4  0x00000001 in ?? ()
#5  0x36606800 in ?? ()
#6  0x00000000 in ?? ()
#7  0xbf9fedd4 in ?? ()
#8  0x363fe1a5 in pthread_rwlock_unlock () from /lib/libthr.so.3
#9  0x36401fae in pthread_cond_signal () from /lib/libthr.so.3
#10 0x34d217e8 in _Jv_CondWait (cv=0x3639778c, mu=0x36397780, millis=0,
nanos=0) at ../../../gcc-4.4.1/libjava/posix-threads.cc:212
#11 0x8c34d070 in ?? ()
#12 0x3639778c in _ZL5mutex () from /usr/local/gcc/4.4.1-java/lib/libgcj.so.10
#13 0x36397780 in E () from /usr/local/gcc/4.4.1-java/lib/libgcj.so.10
#14 0x00000000 in ?? ()
#15 0x00000000 in ?? ()
#16 0x00000000 in ?? ()
#17 0x00000001 in ?? ()
#18 0x341795a8 in dladdr () from /libexec/ld-elf.so.1


--


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


[Bug java/41745] Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-19 10:53 -------
Sounds more like a BSD threads issue, so you need to debug it more.


--

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|                            |freebsd-8.0


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


[Bug java/41745] Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #4 from yuri at tsoft dot com  2009-10-19 17:20 -------
I confirm this on FreeBSD-8.0 for gcc-4.5.0.20091001.
I notified the maintainer of FreeBSD gcc port.
But once the fix will be found it should go into gcj itself, not into port.


--


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


[Bug java/41745] Segmentation fault when ecj.jar is run as a binary compiled by gcj

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #5 from yuri at tsoft dot com  2009-10-19 19:12 -------
How to run testsuite for gcj?
When I run 'gmake check-gcc' from the build directory it doesn't run gcj tests
at all, and gcc/g++ tests summaries are all empty. Not sure what that means.


--


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