User account creation filtered due to spam.

Bug 17848 - segfault at java/class.c:2186 with PieSpy
Summary: segfault at java/class.c:2186 with PieSpy
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2004-10-05 18:11 UTC by Timo Lindfors
Modified: 2016-09-30 22:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-10-05 18:47:45


Attachments
testcase, a modified version of PieSpy (132.78 KB, application/octet-stream)
2004-10-05 18:14 UTC, Timo Lindfors
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Lindfors 2004-10-05 18:11:07 UTC
I get "internal compiler error: Segmentation fault" when I try to
compile a modified version of PieSpy, available at
http://iki.fi/lindi/piespy-without-imageio.tar.gz (sorry, I couldn't
create a reduced testcase):

[lindi@protu piespy-without-imageio]$
PATH=/home/lindi/installdir/installdir-gcc20041005/bin:$PATH gcj -C
org/jibble/socnet/Graph.java
./org/jibble/socnet/SocialNetworkBot.java:29: error: Superclass `PircBot' of
class `org.jibble.socnet.SocialNetworkBot' not found.
   public class SocialNetworkBot extends PircBot {
                                         ^
./org/jibble/socnet/SocialNetworkBot.java:159: error: Type `User' not found in
the declaration of the argument `users' of method `onUserList'.
       protected void onUserList(String channel, User[] users) {
                                                 ^
org/jibble/socnet/Graph.java:484: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

( Later I was told at #gcj that I need to add -Ilib/pircbot.jar, and
indeed, that seems to create Graph.class without warnings. )

I've built gcc from cvs today with

CVS_RSH=ssh cvs -d :ext:anoncvs@savannah.gnu.org:/cvsroot/gcc -qz9 checkout -P
gcc
cd gcc; mkdir builddir; cd builddir
../configure --prefix=/home/lindi/installdir/installdir-gcc20041005
make
make install

which can also be seen from the version information

[lindi@protu piespy-without-imageio]$
PATH=/home/lindi/installdir/installdir-gcc20041005/bin:$PATH gcj -v
Reading specs from
/home/lindi/installdir/installdir-gcc20041005/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Reading specs from
/home/lindi/installdir/installdir-gcc20041005/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../configure
--prefix=/home/lindi/installdir/installdir-gcc20041005
Thread model: posix
gcc version 4.0.0 20041005 (experimental)


I used gdb to follow gcj up to a point where it does a vfork() for
"jc1". I wrote the arguments down and called jc1 directly, that also
segfaults. Now I can however get a nice (?) backtrace too:

[lindi@protu piespy-without-imageio]$ gdb
/home/lindi/installdir/installdir-gcc20041005/libexec/gcc/i686-pc-linux-gnu/4.0.0/jc1
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) set args org/jibble/socnet/Graph.java -quiet -dumpbase Graph.java
-mtune=pentiumpro -auxbase-strip NONE -g1 -fsyntax-only -femit-class-files -o
/dev/null
(gdb) r
Starting program:
/home/lindi/installdir/installdir-gcc20041005/libexec/gcc/i686-pc-linux-gnu/4.0.0/jc1 org/jibble/socnet/Graph.java -quiet -dumpbase Graph.java -mtune=pentiumpro
-auxbase-strip NONE -g1 -fsyntax-only -femit-class-files -o /dev/null
./org/jibble/socnet/SocialNetworkBot.java:29: error: Superclass `PircBot' of
class `org.jibble.socnet.SocialNetworkBot' not found.
   public class SocialNetworkBot extends PircBot {
                                         ^
./org/jibble/socnet/SocialNetworkBot.java:159: error: Type `User' not found in
the declaration of the argument `users' of method `onUserList'.
       protected void onUserList(String channel, User[] users) {
                                                 ^

Program received signal SIGSEGV, Segmentation fault.
layout_class_methods (this_class=0x406a8570) at ../../gcc/java/class.c:2186
2186          if (!TYPE_NVIRTUALS (super_class))
(gdb) bt
#0  layout_class_methods (this_class=0x406a8570) at ../../gcc/java/class.c:2186
#1  0x0805a39f in resolve_and_layout (something=0x0, cl=0x0) at parse.y:6110
#2  0x0806b749 in qualify_ambiguous_name (id=0x403cfcf8) at parse.y:11516
#3  0x08065713 in resolve_expression_name (id=0x403cfcf8, orig=0x0) at
parse.y:9559
#4  0x0806f327 in java_complete_lhs (node=0x403cfcf8) at parse.y:11949
#5  0x0806b9b7 in java_complete_tree (node=0x403ce480) at parse.y:11556
#6  0x0806dd84 in java_complete_lhs (node=0x403ce4a4) at parse.y:12263
#7  0x0806b9b7 in java_complete_tree (node=0x403c8e80) at parse.y:11556
#8  0x0806f4f9 in complete_function_arguments (node=0x403cfe60) at parse.y:12398
#9  0x0806e2e1 in java_complete_lhs (node=0x403cfe60) at parse.y:12049
#10 0x0806b9b7 in java_complete_tree (node=0x1c7) at parse.y:11556
#11 0x0806f154 in java_complete_lhs (node=0x403cfe88) at parse.y:11972
#12 0x0806b9b7 in java_complete_tree (node=0x403ce578) at parse.y:11556
#13 0x0806bd71 in java_complete_lhs (node=0x403bcd9c) at parse.y:11645
#14 0x0806b9b7 in java_complete_tree (node=0x403d74a0) at parse.y:11556
#15 0x0806bfbb in java_complete_lhs (node=0x403bcd68) at parse.y:11677
#16 0x0806b9b7 in java_complete_tree (node=0x403d74c4) at parse.y:11556
#17 0x0806bfbb in java_complete_lhs (node=0x403bcd34) at parse.y:11677
#18 0x0806b9b7 in java_complete_tree (node=0x403c8c3c) at parse.y:11556
#19 0x080617e9 in java_complete_expand_method (mdecl=0x403c8c3c) at parse.y:8232
#20 0x080608d0 in java_complete_expand_methods (class_decl=0x4039fa6c) at
parse.y:7947
#21 0x0806052f in java_complete_expand_classes () at parse.y:7863
#22 0x08064ae5 in java_expand_classes () at parse.y:9187
#23 0x080a5e2a in java_parse_file (set_yydebug=0) at
../../gcc/java/jcf-parse.c:1207
#24 0x08323742 in compile_file () at ../../gcc/toplev.c:985
#25 0x08324e21 in do_compile () at ../../gcc/toplev.c:2069
#26 0x08324e85 in toplev_main (argc=13, argv=0xbfffd464) at
../../gcc/toplev.c:2101
#27 0x080b632b in main (argc=13, argv=0xbfffd464) at ../../gcc/main.c:35
Comment 1 Timo Lindfors 2004-10-05 18:14:25 UTC
Created attachment 7287 [details]
testcase, a modified version of PieSpy
Comment 2 Andrew Pinski 2004-10-05 18:47:45 UTC
Confirmed.
Comment 3 Tom Tromey 2004-10-11 19:21:54 UTC
If I use the -I option, it works.
Without the -I option, I get an error as I would expect:

opsy. gcj -C org/jibble/socnet/Graph.java
org/jibble/socnet/Graph.java: In class `org.jibble.socnet.Graph':
org/jibble/socnet/Graph.java: In method
`org.jibble.socnet.Graph.drawImage(int,int,int,int,double,boolean)':
org/jibble/socnet/Graph.java:484: error: cannot find file for class
org.jibble.pircbot.PircBot
org/jibble/socnet/Graph.java:484: confused by earlier errors, bailing out

I don't see a crash.
I'm using:
opsy. gcj --version
gcj (GCC) 4.0.0 20041006 (experimental)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Could you update and try again?

Comment 4 Andrew Pinski 2004-10-11 19:28:16 UTC
But:
org/jibble/socnet/Graph.java:484: confused by earlier errors, bailing out
is an ICE just that with --disable-checking on, you get that message instead of a seg fault.
Comment 5 Andrew Pinski 2016-09-30 22:49:25 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.