gij

42 views
Skip to first unread message

Daniel Schepler

unread,
Jul 10, 2012, 4:11:39 PM7/10/12
to x32...@googlegroups.com
Is it expected that gij compiled for x32 is supposed to work -- or is that something that nobody else had tested before?

When I try it on a simple Hello.class file (precompiled outside my x32 chroot, since I get an error finding ecj1 inside the chroot after building and installing), I get
Exception in thread "main" java.lang.NullPointerException
   at java.lang.String.charAt(natString.cc:605)
   at gnu.gcj.convert.Output_ASCII.write(Output_ASCII.java:48)
   at java.io.PrintStream.writeChars(PrintStream.java:344)
   at java.io.PrintStream.print(PrintStream.java:287)
   at java.io.PrintStream.println(PrintStream.java:554)
   at Hello.main(Hello.java:3)

But if I compile into a native executable (i.e. "gcj -O2 --main=Hello Hello.class -o Hello") that works just fine.

I'm compiling off hjl/x32/gcc-4_7-branch, after running "git merge origin/branches/gcc-4_7-branch", with a simple "../gcc-4.7/configure --prefix=/usr --enable-languages=c,c++,java --with-abi=mx32".
--
Daniel Schepler

H.J. Lu

unread,
Jul 11, 2012, 12:17:25 AM7/11/12
to x32...@googlegroups.com
There are some extra java failures on x32:

http://gcc.gnu.org/ml/gcc-testresults/2012-07/msg00761.html

FAIL: libjava.jar/TestClosureGC.jar execution - gij test
FAIL: libjava.jar/simple.jar output - gij test
FAIL: PR15133 output - gij test
FAIL: PR18116 output - gij test
FAIL: calls output - gij test
FAIL: directbuffer output - gij test
FAIL: final_method output - gij test
FAIL: findclass execution - gij test
FAIL: findclass2 output - gij test
FAIL: iface output - gij test
FAIL: init output - gij test
FAIL: invoke output - gij test
FAIL: jniutf execution - gij test
FAIL: martin execution - gij test
FAIL: noclass output - gij test
FAIL: overload output - gij test
FAIL: pr18278 execution - gij test
FAIL: pr23739 execution - gij test
FAIL: register output - gij test
FAIL: register2 output - gij test
FAIL: simple_int output - gij test
FAIL: throwit execution - gij test
FAIL: virtual output - gij test
FAIL: PR16923 output
FAIL: pr29812 execution - gij test
FAIL: getargssize run
FAIL: getlocalvartable run
FAIL: getstacktrace output
FAIL: Divide_1 output - source compiled test
FAIL: Divide_1 -findirect-dispatch output - source compiled test

One of them:

Exception in thread "main" java.lang.NullPointerException
at java.lang.String.charAt(natString.cc:605)
at gnu.gcj.convert.Output_ASCII.write(Output_ASCII.java:48)
at java.io.PrintStream.writeChars(PrintStream.java:344)
at java.io.PrintStream.print(PrintStream.java:287)
at java.io.PrintStream.println(PrintStream.java:554)
at findclass.main(findclass.java:14)
FAIL: findclass execution - gij test

I think they are related. Please open a GCC bug.

Thanks.


--
H.J.

Daniel Schepler

unread,
Jul 16, 2012, 10:22:38 AM7/16/12
to x32...@googlegroups.com
On Tuesday, July 10, 2012 9:17:25 PM UTC-7, H.J. wrote:
Please open a GCC bug.

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

(Sorry it took me so long to get around to filing the bug report.)
--
Daniel Schepler

H.J. Lu

unread,
Jul 18, 2012, 7:52:38 PM7/18/12
to x32...@googlegroups.com
On Mon, Jul 16, 2012 at 7:22 AM, Daniel Schepler <dsch...@gmail.com> wrote:
> On Tuesday, July 10, 2012 9:17:25 PM UTC-7, H.J. wrote:
>>
>> Please open a GCC bug.
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53982
>

Fixed on trunk as well as hjl/x32/gcc-4_7-branch.

--
H.J.

Daniel Schepler

unread,
Sep 6, 2012, 4:11:14 PM9/6/12
to x32...@googlegroups.com
I just tried again on hjl/x32/gcc-4_7-branch (as of commit 587aa2d017226c45fa428227bb48ed9d25acf976 checked out this morning) and it seems like gcj still isn't really working well on x32.  For example, if I unpack the ecj-3.5.1 source, cd to src/org.eclipse.jdt.core, and then execute "gcj -C -I /usr/share/java/ant.jar `find . -name \*.java | sort`" it gives:

ecj1: arena.c:661: heap_trim: Assertion `p->size == (0|0x1)' failed.
gcj: internal compiler error: Aborted (program ecj1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

after outputting a random number of .class files and warnings.  (Occasionally it even succeeds, and some other times there's no output before this error.)

Should I file another bug?
--
Daniel Schepler

H.J. Lu

unread,
Sep 6, 2012, 4:27:09 PM9/6/12
to x32...@googlegroups.com
Isn't an ecj1 bug? Please file a GCC bug if you can find a stand-alone
testcase.


--
H.J.

Daniel Schepler

unread,
Sep 6, 2012, 5:14:44 PM9/6/12
to x32...@googlegroups.com
On Thursday, September 6, 2012 1:27:10 PM UTC-7, H.J. wrote:
Isn't an ecj1 bug?  Please file a GCC bug if you can find a stand-alone
testcase.

Hmm, it also fails running the compiler manually using "gij -classpath /usr/share/java/eclipse-ecj.jar:/usr/share/java/ant.jar org.eclipse.jdt.internal.compiler.batch.Main -source 1.5 -target 1.5 -bootclasspath /usr/share/java/libgcj-4.7.2.jar ." -- with the same error message, just in gij instead of ecj1.  I don't know if that counts as stand-alone, but I also don't know how I'd isolate the problem to create a smaller test case, especially since the crash is random.

The problem also doesn't just happen compiling ecj source, it happens fairly frequently on other Java sources too, including some packages that are fairly small.  It's just that with the larger packages, it's more likely to be able to reproduce the crash at some point.  (And I'm also seeing it with an AOT-compiled binary of ecj.)
--
Daniel

H.J. Lu

unread,
Sep 6, 2012, 5:18:58 PM9/6/12
to x32...@googlegroups.com
ecj just compiles java into byte code. Can you find a testcase
with self-contained java byte code?


--
H.J.

Mike Frysinger

unread,
Sep 6, 2012, 5:37:10 PM9/6/12
to x32...@googlegroups.com
i don't think so. i think there's a pthreads bug here somewhere. we
see the same error when using git (repacking with threads), pbzip2
(when using more than 1 thread), and squashfs (which uses threads).

i've been poking it off & on trying to reduce it, but you can find
more details here:
https://bugs.gentoo.org/show_bug.cgi?id=394175
-mike

H.J. Lu

unread,
Sep 6, 2012, 5:44:52 PM9/6/12
to x32...@googlegroups.com
Please find a testcase and I will fix it.

Thanks.

--
H.J.

Daniel Schepler

unread,
Sep 6, 2012, 6:16:37 PM9/6/12
to x32...@googlegroups.com
On Thursday, September 6, 2012 2:18:59 PM UTC-7, H.J. wrote:
ecj just compiles java into byte code.  Can you find a testcase
with self-contained java byte code?

Hmm, scanning through my failed Debian package build logs, it looks like most of the Java packages are failing in the gcj/ecj stage. A few fail in a javadoc run, or elsewhere in an ant run; but those aren't very self-contained either.  But you're right, there's probably nothing that special about ecj (or gjdoc or ant) that would make it and nothing else fail.  It's just that all the examples I have so far are from Debian package builds, which are mainly concerned with compiling into .jar files.

Like the Gentoo posters, I've also seen the error from other programs.  But I always thought it was a symptom of non-ported programs corrupting the memory heap, or in some cases possibly some issue in the libgc port.
--
Daniel

Mike Frysinger

unread,
Sep 6, 2012, 6:52:43 PM9/6/12
to x32...@googlegroups.com
> Please find a testcase and I will fix it.

here's a semi reduced testcase:
http://wh0rd.org/~vapier/pbzip2.tar.xz

unpack it and run the doit.sh script. it should fail with the arena.c
error. note that the local pbzip2 sources are heavily hacked by me to
remove code that is unrelated to the crash at hand (to try and to
produce a reduced testcase). if you want to get back to the original
tree, just download pbzip2-1.1.8 and run it against the local man1/
tree in that tarball.
-mike

Daniel Schepler

unread,
Sep 6, 2012, 6:56:23 PM9/6/12
to x32...@googlegroups.com
Just in case it's useful, I looked through my failed build logs for arena.c.  Some of the other failures I found:

GraphicsMagick test suite, magick++/demo/demo.sh (failed just after printing "Montage images...")
perl test suite (version 5.14.2)
  t/re/pat_psycho_thr
  t/re/pat_rt_report_thr
  t/re/pat_special_cc_thr
  t/re/pat_thr
  t/re/regexp_unicode_prop_thr
  dist/threads/t/thread
pixman test suite, stress-test
plzip test suite
tokyocabinet test suite, tchmttest

(Sorry if this shows up twice, I'm not sure if the first one went through.)
--
Daniel

H.J. Lu

unread,
Sep 6, 2012, 11:59:45 PM9/6/12
to x32...@googlegroups.com
Are there any dependencies? I only have x32 GCC and glibc.
What else do I need to reproduce it?

Thanks.

--
H.J.

Mike Frysinger

unread,
Sep 7, 2012, 12:27:48 AM9/7/12
to x32...@googlegroups.com
> Are there any dependencies? I only have x32 GCC and glibc.
> What else do I need to reproduce it?

it needs libbzip2 (static is OK) and g++. bzip2 itself just needs a C compiler.
-mike

Mike Frysinger

unread,
Sep 7, 2012, 1:49:27 AM9/7/12
to x32...@googlegroups.com
you could always d/l the stage3 tarball i uploaded and cherry pick
libraries from it :)
-mike

H.J. Lu

unread,
Sep 7, 2012, 7:00:02 PM9/7/12
to x32...@googlegroups.com
It works for me:

+ bzip2 -k man1/a2p.1 man1/c2ph.1
man1/config_data-0.390.100_rc-perl-5.16.1.1 man1/find2perl.1
man1/json_pp-2.272.0-perl-5.16.1.1 man1/libnetcfg.1
man1/perl5004delta.1 man1/perl5122delta.1 man1/perl5123delta.1
man1/perl5124delta.1 man1/perl5140delta.1 man1/perl5141delta.1
man1/perl5142delta.1 man1/perl5160delta.1 man1/perl561delta.1
man1/perl56delta.1 man1/perl582delta.1 man1/perl584delta.1
man1/perl585delta.1 man1/perl586delta.1 man1/perl587delta.1
man1/perl588delta.1 man1/perl589delta.1 man1/perlaix.1
man1/perlamiga.1 man1/perlapi.1 man1/perlartistic.1 man1/perlbook.1
man1/perlboot.1 man1/perlbug.1 man1/perlcall.1 man1/perlce.1
man1/perlcheat.1 man1/perlclib.1 man1/perlcn.1 man1/perlcommunity.1
man1/perlcygwin.1 man1/perldata.1 man1/perldbmfilter.1
man1/perldebguts.1 man1/perldebtut.1 man1/perldebug.1 man1/perldgux.1
man1/perldiag.1 man1/perldsc.1 man1/perldtrace.1 man1/perlembed.1
man1/perlepoc.1 man1/perlexperiment.1 man1/perlfaq.1 man1/perlfaq2.1
man1/perlfaq3.1 man1/perlfaq4.1 man1/perlfaq5.1 man1/perlfaq6.1
man1/perlfaq7.1 man1/perlfilter.1 man1/perlfork.1 man1/perlfreebsd.1
man1/perlfunc.1 man1/perlgit.1 man1/perlglossary.1 man1/perlguts.1
man1/perlhack.1 man1/perlhacktips.1 man1/perlhacktut.1 man1/perlhpux.1
man1/perlhurd.1 man1/perlintern.1 man1/perlinterp.1 man1/perlirix.1
man1/perlivp.1 man1/perllexwarn.1 man1/perllinux.1 man1/perllocale.1
man1/perllol.1 man1/perlmacos.1 man1/perlmacosx.1 man1/perlmod.1
man1/perlmodinstall.1 man1/perlmodstyle.1 man1/perlmpeix.1
man1/perlmroapi.1 man1/perlnetware.1 man1/perlnewmod.1
man1/perlnumber.1 man1/perlobj.1 man1/perlop.1 man1/perlopentut.1
man1/perlos2.1 man1/perlos390.1 man1/perlplan9.1 man1/perlpod.1
man1/perlpodspec.1 man1/perlpodstyle-2.4.0-perl-5.16.1.1
man1/perlpolicy.1 man1/perlpragma.1 man1/perlqnx.1 man1/perlre.1
man1/perlrebackslash.1 man1/perlrecharclass.1 man1/perlref.1
man1/perlreguts.1 man1/perlrun.1 man1/perlsolaris.1 man1/perlsource.1
man1/perlsub.1 man1/perlsymbian.1 man1/perltoc.1 man1/perltodo.1
man1/perltooc.1 man1/perltoot.1 man1/perltrap.1 man1/perltru64.1
man1/perlunicode.1 man1/perlunifaq.1 man1/perluniprops.1
man1/perlunitut.1 man1/perluts.1 man1/perlvar.1 man1/perlvmesa.1
man1/perlvms.1 man1/perlvos.1 man1/perlwin32.1 man1/perlxstut.1
man1/perlxstypemap.1 man1/piconv-2.440.0-perl-5.16.1.1 man1/pl2pm.1
man1/pod2html.1 man1/pod2latex.1 man1/pod2man-2.4.0-perl-5.16.1.1
man1/pod2text-2.4.0-perl-5.16.1.1 man1/podselect-1.510.0-perl-5.16.1.1
man1/psed.1 man1/pstruct.1 man1/ptardiff-1.820.0-perl-5.16.1.1
man1/ptargrep-1.820.0-perl-5.16.1.1 man1/s2p.1
man1/shasum-5.710.0-perl-5.16.1.1 man1/splain.1
man1/xsubpp-3.160.0-perl-5.16.1.1
+ g++ -mx32 -O2 -Wall -g -pthread pbzip2.cpp BZ2StreamScanner.cpp -o
pbzip2 -lbz2 -lpthread
+ ./pbzip2 -k -f man1/a2p.1 man1/c2ph.1
man1/config_data-0.390.100_rc-perl-5.16.1.1 man1/find2perl.1
man1/json_pp-2.272.0-perl-5.16.1.1 man1/libnetcfg.1
man1/perl5004delta.1 man1/perl5122delta.1 man1/perl5123delta.1
man1/perl5124delta.1 man1/perl5140delta.1 man1/perl5141delta.1
man1/perl5142delta.1 man1/perl5160delta.1 man1/perl561delta.1
man1/perl56delta.1 man1/perl582delta.1 man1/perl584delta.1
man1/perl585delta.1 man1/perl586delta.1 man1/perl587delta.1
man1/perl588delta.1 man1/perl589delta.1 man1/perlaix.1
man1/perlamiga.1 man1/perlapi.1 man1/perlartistic.1 man1/perlbook.1
man1/perlboot.1 man1/perlbug.1 man1/perlcall.1 man1/perlce.1
man1/perlcheat.1 man1/perlclib.1 man1/perlcn.1 man1/perlcommunity.1
man1/perlcygwin.1 man1/perldata.1 man1/perldbmfilter.1
man1/perldebguts.1 man1/perldebtut.1 man1/perldebug.1 man1/perldgux.1
man1/perldiag.1 man1/perldsc.1 man1/perldtrace.1 man1/perlembed.1
man1/perlepoc.1 man1/perlexperiment.1 man1/perlfaq.1 man1/perlfaq2.1
man1/perlfaq3.1 man1/perlfaq4.1 man1/perlfaq5.1 man1/perlfaq6.1
man1/perlfaq7.1 man1/perlfilter.1 man1/perlfork.1 man1/perlfreebsd.1
man1/perlfunc.1 man1/perlgit.1 man1/perlglossary.1 man1/perlguts.1
man1/perlhack.1 man1/perlhacktips.1 man1/perlhacktut.1 man1/perlhpux.1
man1/perlhurd.1 man1/perlintern.1 man1/perlinterp.1 man1/perlirix.1
man1/perlivp.1 man1/perllexwarn.1 man1/perllinux.1 man1/perllocale.1
man1/perllol.1 man1/perlmacos.1 man1/perlmacosx.1 man1/perlmod.1
man1/perlmodinstall.1 man1/perlmodstyle.1 man1/perlmpeix.1
man1/perlmroapi.1 man1/perlnetware.1 man1/perlnewmod.1
man1/perlnumber.1 man1/perlobj.1 man1/perlop.1 man1/perlopentut.1
man1/perlos2.1 man1/perlos390.1 man1/perlplan9.1 man1/perlpod.1
man1/perlpodspec.1 man1/perlpodstyle-2.4.0-perl-5.16.1.1
man1/perlpolicy.1 man1/perlpragma.1 man1/perlqnx.1 man1/perlre.1
man1/perlrebackslash.1 man1/perlrecharclass.1 man1/perlref.1
man1/perlreguts.1 man1/perlrun.1 man1/perlsolaris.1 man1/perlsource.1
man1/perlsub.1 man1/perlsymbian.1 man1/perltoc.1 man1/perltodo.1
man1/perltooc.1 man1/perltoot.1 man1/perltrap.1 man1/perltru64.1
man1/perlunicode.1 man1/perlunifaq.1 man1/perluniprops.1
man1/perlunitut.1 man1/perluts.1 man1/perlvar.1 man1/perlvmesa.1
man1/perlvms.1 man1/perlvos.1 man1/perlwin32.1 man1/perlxstut.1
man1/perlxstypemap.1 man1/piconv-2.440.0-perl-5.16.1.1 man1/pl2pm.1
man1/pod2html.1 man1/pod2latex.1 man1/pod2man-2.4.0-perl-5.16.1.1
man1/pod2text-2.4.0-perl-5.16.1.1 man1/podselect-1.510.0-perl-5.16.1.1
man1/psed.1 man1/pstruct.1 man1/ptardiff-1.820.0-perl-5.16.1.1
man1/ptargrep-1.820.0-perl-5.16.1.1 man1/s2p.1
man1/shasum-5.710.0-perl-5.16.1.1 man1/splain.1
man1/xsubpp-3.160.0-perl-5.16.1.1 -p2

I am using glibc hjl/x32/release/2.15 branch.

--
H.J.

Mike Frysinger

unread,
Sep 7, 2012, 7:05:24 PM9/7/12
to x32...@googlegroups.com
On Fri, Sep 7, 2012 at 7:00 PM, H.J. Lu <hjl....@gmail.com> wrote:
> I am using glibc hjl/x32/release/2.15 branch.

i'm using the official glibc-2.16 release
-mike

H.J. Lu

unread,
Sep 7, 2012, 7:40:42 PM9/7/12
to x32...@googlegroups.com
Yes, I can reproduce it with glibc 2.16. Please open a glibc
bug.

Thanks.

--
H.J.

Mike Frysinger

unread,
Sep 7, 2012, 7:53:54 PM9/7/12
to x32...@googlegroups.com
On Fri, Sep 7, 2012 at 7:40 PM, H.J. Lu <hjl....@gmail.com> wrote:
> On Fri, Sep 7, 2012 at 4:05 PM, Mike Frysinger <vap...@gmail.com> wrote:
>> On Fri, Sep 7, 2012 at 7:00 PM, H.J. Lu <hjl....@gmail.com> wrote:
>>> I am using glibc hjl/x32/release/2.15 branch.
>>
>> i'm using the official glibc-2.16 release
>
> Yes, I can reproduce it with glibc 2.16.

great :)

> Please open a glibc bug.

done: http://sourceware.org/bugzilla/show_bug.cgi?id=14562
-mike

H.J. Lu

unread,
Sep 9, 2012, 4:48:51 PM9/9/12
to x32...@googlegroups.com
Please try my fix on hjl/pr14562/2.16 branch before I submit it to glibc.

Thanks.


--
H.J.

Daniel Schepler

unread,
Sep 10, 2012, 1:48:19 AM9/10/12
to x32...@googlegroups.com
On Sunday, September 9, 2012 1:48:52 PM UTC-7, H.J. wrote:
Please try my fix on hjl/pr14562/2.16 branch before I submit it to glibc.

With the patch, I couldn't reproduce the errors anymore in the tests I ran -- gij running ecj on a couple packages where it failed before, and the perl or pixman testsuites.
--
Daniel Schepler

Reply all
Reply to author
Forward
0 new messages