This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Non-indirect-dispatch and failed loading of classes
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 08 Sep 2005 20:26:54 +0530
- Subject: Re: RFC: Non-indirect-dispatch and failed loading of classes
- Openpgp: url=http://ranjitmathew.hostingzero.com/aa_6C114B8F.txt
- References: <43203B36.802@gmail.com> <17184.15562.75324.24612@zapata.pink>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Haley wrote:
> Ranjit Mathew writes:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> > Consider the following:
> >
> > Foo.java:
> > class Foo { }
> >
> > Bar.java:
> > class Bar extends Foo { }
> >
> > Compile both to bytecode and then remove Foo.*. Now try to
> > compile Bar.class to object code (non-indirect-dispatch).
> > We get an internal error with current mainline.
>
> We should get a class not found error.
We do get an error, but it's not a fatal error and we die
later trying to lay out this class:
~/src/GCJ/PR20031 > $MYGCJ -c Bar.class
Bar.java:0: error: cannot find file for class Foo
Bar.java:0: error: cannot find file for class Foo
Bar.java:0: confused by earlier errors, bailing out
Under a debugger:
- --------------------------------- 8< ---------------------------------
(gdb) r
Starting program: /extra/src/gcc/build/gcc/jc1 Bar.class
- -fhash-synchronization-fno-use-divide-subroutine -fuse-boehm-gc
- -fnon-call-exceptions -fomit-frame-pointer -fkeep-inline-functions
- -quiet -dumpbase Bar.class -march=pentium3 -auxbase Bar -g1
- -I/extra/src/gcc/build/i686-pc-linux-gnu/libjava/libgcj-4.1.0.jar -o
/tmp/ccbWIDLt.s
Bar.java:0: error: cannot find file for class Foo
Bar.java:0: error: cannot find file for class Foo
Program received signal SIGSEGV, Segmentation fault.
0x0806d8c1 in layout_class_methods (this_class=0xb7e34bdc)
at /extra/src/gcc/gcc-20050907/gcc/java/class.c:2265
2265 if (!TYPE_NVIRTUALS (super_class))
(gdb)
- --------------------------------- 8< ---------------------------------
> > In this change:
> >
> > http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-parse.c.diff?r1=1.158&r2=1.158.4.1
> >
> > load_class() sets TYPE_DUMMY for a RECORD_TYPE if we failed to
> > load it, but that bit is effected only for non-indirect-dispatch.
> >
> > Is there a reason we can't make this independent of indirect-dispatch?
>
> Yes. When not using indirect dispatch we verify classes at compile
> time, and thus we really need to have them around.
But the loading of the class was *unsuccessful* for the case in
question. Do we have any hope of finding it later?
Thanks,
Ranjit.
- --
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDIFE2Yb1hx2wRS48RAk/gAKCcJksy6T7EtVJS5Gjvjvq/oCciNACfWEtJ
ttuxMwKGQlHfHl3sjrsZXNI=
=9rWl
-----END PGP SIGNATURE-----