From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1734 invoked by alias); 16 Jul 2012 14:18:15 -0000 Received: (qmail 1645 invoked by uid 22791); 16 Jul 2012 14:18:12 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jul 2012 14:17:57 +0000 From: "dschepler at gmail dot com" To: java-prs@gcc.gnu.org Subject: [Bug java/53982] New: gij built for x32 can't run a simple Hello World class Date: Mon, 16 Jul 2012 14:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dschepler at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2012-q3/txt/msg00009.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53982 Bug #: 53982 Summary: gij built for x32 can't run a simple Hello World class Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned@gcc.gnu.org ReportedBy: dschepler@gmail.com Built and installed gcc from hjl/x32/gcc-4_7-branch (in a test chroot), after running "git merge origin/branches/gcc-4_7-branch", using ../src/configure --prefix=/usr --with-abi=mx32 --enable-languages=c,c++,java With this configuration, I imported a HelloWorld.class file built outside the chroot (since "gcj -C HelloWorld.java" inside the chroot complains about missing ecj1), and tried running "gij HelloWorld". This gave an error: Exception in thread "main" java.lang.NullPointerException at java.lang.String.charAt(libgcj.so.13) at gnu.gcj.convert.Output_ASCII.write(libgcj.so.13) at java.io.PrintStream.writeChars(libgcj.so.13) at java.io.PrintStream.print(libgcj.so.13) at java.io.PrintStream.println(libgcj.so.13) at HelloWorld.main(HelloWorld.java:3) The Java source is just the prototypical Java hello-world example: public class HelloWorld { public static void main(String args[]) { System.out.println("Hello World!"); } } On the other hand, if I compile the .class file into a native executable using "gcj -O2 HelloWorld.class --main=HelloWorld -o ./HelloWorld" then that executable runs just fine. But I'm not entirely convinced gcj-compiled native executables work without problems, either. For example, with ecj compiled from the Debian libecj-java binary package's jar file into native code, I can run gcj -C HelloWorld.java OK in the Debian x32 chroot I'm bootstrapping. But on most source packages of any size, it bails out sooner or later with a heap corruption message ecj1: arena.c:661: heap_trim: Assertion `p->size == (0|0x1)' failed. gcj-4.7: internal compiler error: Aborted (program ecj1)