Bug 20268

Summary: gcc segfaults on kosher code
Product: [Retired] Red Hat Linux Reporter: Gregory Leblanc <gleblanc>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high 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-11-03 17:27:42 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:
Attachments:
Description Flags
Output from -save-temps of gcc none

Description Gregory Leblanc 2000-11-03 06:09:52 UTC
GCC is segfaulting on a simple compile.  I'm trying to compile Evolution
from CVS, but I've checked that this compiles elsewhere (on stock RH7 and
on RH6.2 with the patches).  I've verified my gcc install (rpm -V gcc), and
tried this quite a few times.  Here's the command line that I'm running to
get this crash.

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I/usr/lib/glib/include
-I/opt/gnome_cvs//include -DUNICODE_USE_SYSTEM_ICONV
-DG_LOG_DOMAIN=\"libibex\" -I/usr/lib/glib/include -I/usr/X11R6/include -g
-O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations
-Wp,-MD,.deps/ibex_block.pp -c ibex_block.c  -fPIC -DPIC -o
.libs/ibex_block.lo

Here's the output that I get back.  I'll make a backup of this build tree,
so that I can provide additional feedback upon request.  BTW, this machine
is NOT overclocked or doing any other "bad things" with the hardware.


ibex_block.c:246:74: warning: pasting would not give a valid preprocessing
token
ibex_block.c:4: parse error before `<'
In file included from /usr/include/bits/types.h:166,
                 from /usr/include/sys/types.h:31,
                 from /usr/include/db1/db.h:40,
                 from ibex_block.c:6:
/usr/include/bits/pthreadtypes.h:48: parse error before `size_t'
/usr/include/bits/pthreadtypes.h:48: warning: no semicolon at end of struct
or union
/usr/include/bits/pthreadtypes.h:51: parse error before `__stacksize'
/usr/include/bits/pthreadtypes.h:51: warning: data definition has no type
or storage class
/usr/include/bits/pthreadtypes.h:52: warning: data definition has no type
or storage class
In file included from ibex_block.c:6:
/usr/include/db1/db.h:76: parse error before `size_t'
/usr/include/db1/db.h:76: warning: no semicolon at end of struct or union
/usr/include/db1/db.h:77: warning: data definition has no type or storage
class
/usr/include/db1/db.h:121: parse error before `*'
/usr/include/db1/db.h:122: parse error before `*'
/usr/include/db1/db.h:123: parse error before `DBT'
/usr/include/db1/db.h:124: parse error before `DBT'
/usr/include/db1/db.h:142: parse error before `*'
/usr/include/db1/db.h:143: warning: no semicolon at end of struct or union
/usr/include/db1/db.h:146: parse error before `}'
/usr/include/db1/db.h:146: warning: data definition has no type or storage
class
/usr/include/db1/db.h:158: parse error before `size_t'
/usr/include/db1/db.h:171: parse error before `size_t'
/usr/include/db1/db.h:171: warning: no semicolon at end of struct or union
/usr/include/db1/db.h:174: parse error before `}'
/usr/include/db1/db.h:174: warning: data definition has no type or storage
class
ibex_block.c:6: parse error before `=='
In file included from /usr/include/_G_config.h:45,
                 from /usr/include/libio.h:31,
                 from /usr/include/stdio.h:70,
                 from ibex_block.c:9:
/usr/include/gconv.h:71: parse error before `size_t'
/usr/include/gconv.h:84: parse error before `size_t'
/usr/include/gconv.h:93: parse error before `size_t'
/usr/include/gconv.h:169: parse error before `size_t'
/usr/include/gconv.h:169: warning: no semicolon at end of struct or union
/usr/include/gconv.h:172: parse error before `}'
/usr/include/gconv.h:172: warning: data definition has no type or storage
class
In file included from /usr/include/libio.h:31,
                 from /usr/include/stdio.h:70,
                 from ibex_block.c:9:
/usr/include/_G_config.h:47: field `__cd' has incomplete type
/usr/include/_G_config.h:50: field `__cd' has incomplete type
/usr/include/_G_config.h:53: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Comment 1 Jakub Jelinek 2000-11-03 15:13:46 UTC
Please rerun the above command with -save-temps -v additional options and
attach here the resulting .i file.
It looks like the code does not play nice with the included headers (for
whatever reason, without .i file I cannot tell much), but no matter what
even on bad input gcc should never segfault nor generate ICE, so I'd like
the testcase so that I can fix it.

Comment 2 Gregory Leblanc 2000-11-03 16:38:57 UTC
Created attachment 5015 [details]
Output from -save-temps of gcc

Comment 3 Jakub Jelinek 2000-11-03 17:17:47 UTC
That file (ibex_block.c) has apparently unresolved CVS or RCS conflict in it,
<<<<<<< ibex_block.c
#include <db1/db.h>
=======
>>>>>>> 1.5
That's not valid C obviously, if you fix it, it will work.
I'll work on fixing the ICE though.

Comment 4 Jakub Jelinek 2000-11-03 17:27:39 UTC
Richard Kenner fixed this on Sep, 16th in CVS gcc, I've just verified the
backport of this patch into RH gcc fixes it, it will appear in the next
gcc rpm package (gcc-2.96-63), which should make it into rawhide first and
soon after into gcc errata.