This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/53982] New: gij built for x32 can't run a simple Hello World class
- From: "dschepler at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Jul 2012 14:17:36 +0000
- Subject: [Bug java/53982] New: gij built for x32 can't run a simple Hello World class
- Auto-submitted: auto-generated
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)