gcj segfaults on i686/x86_64-apple-darwin*

Jack Howarth <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
    Do any of the gcc java developers have access to intel darwin?
We are seeing segfaults on i686-apple-darwin9/10 and x86_64-apple-darwin9/10
when compiling code like...

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

with "gcj --main=testme -O testme.java" which produces segfaults of the
form...

gcj: Internal error: Abort trap (program ecj1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

This failure is showing up on x86_64-apple-darwin9/10 for gcc 4.4.2
and gcc trunk. Interestingly, i686-apple-darwin9 doesn't show the
segfault for gcc 4.4.2 but does for gcc trunk. Both gcc 4.4.2 and
gcc trunk show the segfault for i686-apple-darwin10. The gcc compiler
with ftp://sourceware.org/pub/java/ecj-latest.jar in the top level
of the build directory to produce the ecj1 binary. The gcc configurations
are of the form...

../gcc-4.5-20091107/configure --prefix=/sw --prefix=/sw/lib/gcc4.5
--mandir=/sw/share/man --infodir=/sw/share/info
--enable-languages=c,c++,fortran,objc,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--disable-libjava-multilib --with-arch=nocona --with-tune=generic
--build=i686-apple-darwin9 --host=i686-apple-darwin9
--target=i686-apple-darwin9

This issue has been filed as PR41991.
            Jack
ps Using -v to figure out how ecj1 is called, I obtained the following backtrace
under gcc trunk...

gdb /sw/lib/gcc4.5/libexec/gcc/i686-apple-darwin9/4.5.0/ecj1
...
(gdb) r testme.java -fbootclasspath=./:/sw/lib/gcc4.5/share/java/libgcj-4.5.0.jar -fsource=1.5 -ftarget=1.5 -fzip-dependency /var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccCFc8VX.zip -fzip-target /var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccBrG88S.jar
Starting program: /sw/lib/gcc4.5/libexec/gcc/i686-apple-darwin9/4.5.0/ecj1 testme.java -fbootclasspath=./:/sw/lib/gcc4.5/share/java/libgcj-4.5.0.jar -fsource=1.5 -ftarget=1.5 -fzip-dependency /var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccCFc8VX.zip -fzip-target /var/folders/1C/1CdoNxmNFHyOIjNBLNuJh++++TM/-Tmp-//ccBrG88S.jar
Reading symbols for shared libraries ++++.+. done

Program received signal SIGABRT, Aborted.
0x94cc2e42 in __kill ()
(gdb) bt
#0  0x94cc2e42 in __kill ()
#1  0x94cc2e34 in kill$UNIX2003 ()
#2  0x94d3523a in raise ()
#3  0x94d41679 in abort ()
#4  0x038de502 in _Jv_Throw (value=<value temporarily unavailable, due to optimizations>) at ../../../gcc-4.5-20091107/libjava/exception.cc:128
#5  0x039359bb in _ZN4java4lang5Class7forNameEJPS1_PNS0_6StringES2_ (className=<value temporarily unavailable, due to optimizations>, caller=<value temporarily unavailable, due to optimizations>) at Class.java:133
Previous frame inner to this frame (gdb could not unwind past this frame)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.