gcj segfaults on i686/x86_64-apple-darwin*

Andreas Tobler andreast@fgznet.ch
Thu Nov 12 23:18:00 GMT 2009


Andrew Haley wrote:
> Jack Howarth wrote:
>> On Mon, Nov 09, 2009 at 02:33:11PM +0000, Andrew Haley wrote:
>>> Jack Howarth wrote:
>>>
>>>>    Shouldn't the libjava testsuite contain some rudimentary tests using gcj
>>>> to make sure it is functional?
>>> Sure.
>>>
>>>> The recent testsuite results don't suggest
>>>> major problems with java on intel darwin...
>>>>
>>>> http://gcc.gnu.org/ml/gcc-testresults/2009-11/msg00666.html
>>>> http://gcc.gnu.org/ml/gcc-testresults/2009-10/msg01308.html
>>> This means that, whatever the cause of the bug, it wasn't present
>>> when these tests were run.
>>>
>>> You can easily verify that yourself by running 'make check-target-libjava'.
> 
>>    Actually the nature of the testsuite will mask this failure on intel darwin.
>> The gcj compiler doesn't segfault when presented with a *.class file to compile
>> into an executable. Only when presented a *.java file will the gcj compiler abort.
> 
> In that case, gcj isn't aborting.  gcj only ever compiles .class -> .o, where
> .java -> .class compilation is performed by ecj1.

That is what I told you, Andrew, on #irc.

>> I suspect if the libjava harness was fixed to compile the java files if a ecj1 was
>> built that all of the libjava.lang tests would suddenly fail on darwin.
> 
> Andreas Tobler Seems to think it's to do with stack execution, but
> I can't understand how that can be: gcj doesn't generate executable
> code on the stack.

Gcj not, but what is with ecj1? The suggestion I posted to the PR 
affects the ecjx linking.

The patchlet I posted in the 41991 PR does allow me to compile a java 
file into a class file and execute it with gij. Also the same for java 
to binary compile. This was not the case before. I went back to Jan 31 
09 and I always got an Abort with ecj1.

Note beside, I always installed the built gcc and tested the installed 
binaries.

[deuterium:~] andreast% gcj -C hello.java
[deuterium:~] andreast% gij hello
Hello World
Hello Andreas

[deuterium:~] andreast% gcj --main=testme -O testme.java
[deuterium:~] andreast% ./a.out
Hello

[deuterium:~] andreast% gcj -v
Using built-in specs.
Reading specs from 
/Volumes/development/gcc/head/testbin-x86_64/lib/gcc/x86_64-apple-darwin9/4.5.0/../../../libgcj.spec
  rename spec startfile to startfileorig
rename spec lib to liborig
COLLECT_GCC=gcj
COLLECT_LTO_WRAPPER=/Volumes/development/gcc/head/testbin-x86_64/libexec/gcc/x86_64-apple-darwin9/4.5.0/lto-wrapper
Target: x86_64-apple-darwin9
Configured with: /Volumes/development/gcc/head/gcc/configure 
--prefix=/Volumes/development/gcc/head/testbin-x86_64 
--build=x86_64-apple-darwin9 --target=x86_64-apple-darwin9 
--disable-static --with-gmp=/usr/local/x86_64 
--with-mpfr=/usr/local/x86_64 --enable-java-awt=xlib 
--enable-languages=c,c++,java
Thread model: posix
gcc version 4.5.0 20091111 (experimental) [trunk revision 153973] (GCC)


I'll run some more tests.

Andreas




More information about the Java mailing list