Bug 16110

Summary: gcj segfaults when class not found
Product: [Retired] Red Hat Linux Reporter: mal
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-21 13:26:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mal 2000-08-13 20:29:05 UTC
If a class not found gcj segfaults
instead of just giving an error message.

gcj  -c com/gromco/sql/*.java
com/gromco/sql/KeywordsInSQL.java:10: Class or interface
`com.gromco.webutils.Search' not found in import.
import com.gromco.webutils.Search;
       ^
com/gromco/sql/KeywordsInSQL.java:137: Type `Search' not found in the
declaration of the argument `addmessagesto' of method `getIN'.
				   Search addmessagesto,
                                   ^
gcj: Internal error: Segmentation fault (program jc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

This is a gdb trace
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"...
(no debugging symbols found)...
(gdb) run  com/gromco/sql/KeywordsInSQL.java -fno-use-divide-subroutine
-fasynchronous-exceptions -quiet -dumpbase KeywordsInSQL.java -g1 -version
-o /tmp/ccel3C6jdd.s
Starting program: /usr/lib/gcc-lib/i386-redhat-linux/2.96/jc1
com/gromco/sql/KeywordsInSQL.java -fno-use-divide-subroutine
-fasynchronous-exceptions -quiet -dumpbase KeywordsInSQL.java -g1 -version
-o /tmp/ccel3C6jdd.s
GNU Java version 2.96 20000724 (experimental) (i386-redhat-linux) compiled
by GNU C version 2.96 20000724 (experimental).
com/gromco/sql/KeywordsInSQL.java:10: Class or interface
`com.gromco.webutils.Search' not found in import.
import com.gromco.webutils.Search;
       ^
com/gromco/sql/KeywordsInSQL.java:137: Type `Search' not found in the
declaration of the argument `addmessagesto' of method `getIN'.
				   Search addmessagesto,
                                   ^

Program received signal SIGSEGV, Segmentation fault.
0x8054c0d in strcpy () at ../sysdeps/generic/strcpy.c:31
31	../sysdeps/generic/strcpy.c: No such file or directory.
(gdb) bt
#0  0x8054c0d in strcpy () at ../sysdeps/generic/strcpy.c:31
#1  0x83de2a4 in ?? ()
#2  0x8054d99 in strcpy () at ../sysdeps/generic/strcpy.c:31
#3  0x807900f in strcpy () at ../sysdeps/generic/strcpy.c:31
#4  0x8079409 in strcpy () at ../sysdeps/generic/strcpy.c:31
#5  0x808422c in error ()
#6  0x8087f0e in error ()
#7  0x4003b345 in __libc_start_main (main=0x80878a0 <error+18992>, argc=11, 
    ubp_av=0xbffff9d4, init=0x8049374, fini=0x824716c <__umoddi3+572>, 
    rtld_fini=0x4000de14 <_dl_fini>, stack_end=0xbffff9cc)
    at ../sysdeps/generic/libc-start.c:111
(gdb) where
#0  0x8054c0d in strcpy () at ../sysdeps/generic/strcpy.c:31
#1  0x83de2a4 in ?? ()
#2  0x8054d99 in strcpy () at ../sysdeps/generic/strcpy.c:31
#3  0x807900f in strcpy () at ../sysdeps/generic/strcpy.c:31
#4  0x8079409 in strcpy ()at ../sysdeps/generic/strcpy.c:31
#5  0x808422c in error ()
#6  0x8087f0e in error ()
#7  0x4003b345 in __libc_start_main (main=0x80878a0 <error+18992>, argc=11, 
    ubp_av=0xbffff9d4, init=0x8049374, fini=0x824716c <__umoddi3+572>, 
    rtld_fini=0x4000de14 <_dl_fini>, stack_end=0xbffff9cc)
    at ../sysdeps/generic/libc-start.c:111
(gdb)

Comment 1 mal 2000-08-13 20:32:19 UTC
This is a test case:
--------------------------------------
cat  Y.java
import a.b.c.d.F;
class Y {
 final a.b.c.d.F x=new a.b.c.d.F();
}


Comment 2 Jakub Jelinek 2000-08-21 07:53:58 UTC
Cannot reproduce it.

Comment 3 mal 2000-08-21 13:25:41 UTC
Fixed in gcc-java-2.96-53
============= 2.96-53
rpm -q gcc-java
gcc-java-2.96-53
[mal@eth0_extrenal tgcc]$ gcj -c Y.java 
Y.java:1: Class or interface `a.b.c.d.F' not found in import.
  import a.b.c.d.F;
         ^
Y.java:3: Type `a.b.c.d.F' not found in declaration of field `x'.
   final a.b.c.d.F x=new a.b.c.d.F();
         ^
2 errors

================== 2.96-46
rpm -q gcc-java
gcc-java-2.96-46
[john@clienthost /tmp]$ gcj -c Y.java 
Y.java:1: Class or interface `a.b.c.d.F' not found in import.
  import a.b.c.d.F;
         ^
Y.java:3: Type `a.b.c.d.F' not found in declaration of field `x'.
   final a.b.c.d.F x=new a.b.c.d.F();
         ^
gcj: Internal error: Segmentation fault (program jc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


Comment 4 Jakub Jelinek 2000-08-21 15:44:09 UTC
I'll close it then...