Bug 15963 - java segfault in GCC instead of an error message
Summary: java segfault in GCC instead of an error message
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-10 23:58 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-15 00:59:38 UTC
Embargoed:


Attachments (Terms of Use)

Description mal 2000-08-10 23:58:41 UTC
GCC segfault on the following program instad of giving an error message
gcc -O2 -S Y.java
gcc: Internal error: Segmentation fault (program jc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

In the same time if I remove static
public static class UU it compiles OK

gcc --version
2.96
(RedHat 7.0 Public Beta)

---- Y.java
public class Y {
final UU v=new UU();
int u=0;
public static class UU {
protected UU()
{
 Y.this.u=-1;
}
}
public static void main(String [] args)
{
 System.err.println("Y CALLED");
 final Y x=new Y();
 System.err.println(x.u);

}
}
----

Comment 1 mal 2000-08-21 15:39:22 UTC
The bug still exists in
rpm -q gcc-java
gcc-java-2.96-53

gdb /usr/lib/gcc-lib/i386-redhat-linux/2.96/jc1
GNU gdb 5.0
Copyright 2000 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"...
(gdb) run Y.java -fno-use-divide-subroutine -fasynchronous-exceptions -quiet
-dumpbase Y.java -g1 -version -o /tmp/ccpwYDDS.sf
Starting program: /usr/lib/gcc-lib/i386-redhat-linux/2.96/jc1 Y.java
-fno-use-divide-subroutine -fasynchronous-exceptions -quiet -dumpbase Y.java -g1
-version -o /tmp/ccpwYDDS.sf
GNU Java version 2.96 20000731 (experimental) (i386-redhat-linux) compiled by
GNU C version 2.96 20000731 (experimental).

Program received signal SIGSEGV, Segmentation fault.
0x80627d1 in maybe_access_field (decl=0x0, where=0x0, type=0x0)
    at ../../../gcc/java/parse.y:9510
9510	../../../gcc/java/parse.y: No such file or directory.
(gdb) bt
#0  0x80627d1 in maybe_access_field (decl=0x0, where=0x0, type=0x0)
    at ../../../gcc/java/parse.y:9510
#1  0x80622f1 in resolve_qualified_expression_name (wfl=0x839b268, 
    found_decl=0xbfffeddc, where_found=0xbfffedd8, type_found=0xbfffedd4)
    at ../../../gcc/java/parse.y:9321
#2  0x8060da5 in resolve_field_access (qual_wfl=0x839b268, field_decl=0x0, 
    field_type=0x0) at ../../../gcc/java/parse.y:8768
#3  0x8060d25 in resolve_expression_name (id=0x839b268, orig=0x0)
    at ../../../gcc/java/parse.y:8733
#4  0x80661b7 in java_complete_lhs (node=0x839b268)
    at ../../../gcc/java/parse.y:11110
#5  0x80665fc in java_complete_lhs (node=0x839b324)
    at ../../../gcc/java/parse.y:11225
#6  0x80651cd in java_complete_tree (node=0x839b324)
    at ../../../gcc/java/parse.y:10730
#7  0x8066234 in java_complete_lhs (node=0x839b33c)
    at ../../../gcc/java/parse.y:11127
#8  0x80651cd in java_complete_tree (node=0x839b33c)
    at ../../../gcc/java/parse.y:10730
#9  0x8065561 in java_complete_lhs (node=0x839b248)
    at ../../../gcc/java/parse.y:10865
#10 0x80651cd in java_complete_tree (node=0x839b248)
    at ../../../gcc/java/parse.y:10730
---Type <return> to continue, or q <return> to quit---
#11 0x805e9f3 in java_complete_expand_method (mdecl=0x839b0e0)
    at ../../../gcc/java/parse.y:7628
#12 0x805e463 in java_complete_expand_methods (class_decl=0x839ae08)
    at ../../../gcc/java/parse.y:7426
#13 0x805e383 in java_complete_expand_class (outer=0x839ae08)
    at ../../../gcc/java/parse.y:7375
#14 0x805e36a in java_complete_expand_class (outer=0x839a89c)
    at ../../../gcc/java/parse.y:7373
#15 0x805e322 in java_complete_expand_classes ()
    at ../../../gcc/java/parse.y:7353
#16 0x806058c in java_expand_classes () at ../../../gcc/java/parse.y:8483
#17 0x808f73d in yyparse () at ../../../gcc/java/jcf-parse.c:911
#18 0x809db2c in compile_file (name=0xbffffacf "Y.java")
    at ../../gcc/toplev.c:2296
#19 0x80a2a95 in main (argc=11, argv=0xbffff954) at ../../gcc/toplev.c:4759
#20 0x4003b345 in __libc_start_main (main=0x80a22e4 <main>, argc=11, 
    ubp_av=0xbffff954, init=0x80494a8 <_init>, fini=0x82dd00c <_fini>, 
    rtld_fini=0x4000de14 <_dl_fini>, stack_end=0xbffff94c)
    at ../sysdeps/generic/libc-start.c:111
(gdb)


Comment 2 Alan Cox 2002-12-15 00:59:38 UTC
Works properly in 8.0 - checked



Note You need to log in before you can comment on or make changes to this bug.