Bug 30146 - gcc -- Internal error: Segmentation fault.
gcc -- Internal error: Segmentation fault.
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-02-28 23:27 EST by Need Real Name
Modified: 2007-04-18 12:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-05 23:26:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Preprocess output, generated with 'gcc -O2 -o hello1 -save-temps hello.c (18.70 KB, text/plain)
2001-03-03 00:22 EST, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2001-02-28 23:27:51 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.1 i586)

gcc generates a segmentation fault whenever you use the -O switch for

Reproducible: Always
Steps to Reproduce:
1. Create a source file, or untar one
2. Run gcc -O{1+}
3. Watch internal error message. :(

This is especially annoying, because almost every package out there uses
the optimization flag (which is a good thing, really, unless your gcc is

Actual Results:  
me2v@reliant c_tidbits $ gcc -O2 ascii.c -o ascii
In file included from /usr/include/stdio.h:631,
                 from ascii.c:1:
/usr/include/bits/stdio.h: In function `getc_unlocked':
/usr/include/bits/stdio.h:58: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Also, when trying to build freetype rpm:

mkdir /home/me2v/redhat/BUILD/freetype-2.0.1/obj/.libs
gcc -pedantic -ansi -c -Wall -O2 -march=i386 -mcpu=i686
/home/me2v/redhat/BUILD/freetype-2.0.1/src/base/ftsystem.c  -fPIC -DPIC -o
In file included from /usr/include/string.h:359,
/usr/include/bits/string2.h: In function `__strcspn_c1':
/usr/include/bits/string2.h:878: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
make: *** [/home/me2v/redhat/BUILD/freetype-2.0.1/obj/ftsystem.lo] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.71933 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.71933 (%build)

Expected Results:  I expect the program to compile successfully

Using kgcc seems to work successfully (now--with the last 2 or 3 versions
of glibc, before the current one, it generated the same seg. faults that
gcc does).  At least, I was able to recompile freetype using the current
kgcc (current == rawhide, of course! =P )

Installed packages of interest:



Comment 1 Jakub Jelinek 2001-03-02 04:31:08 EST
Please post here the exact preprocessed source which gcc is falling on together
with exact options (you get the preprocessed source e.g. by using -save-temps
option). gcc-2.96-76 certainly does not segfault whenever -O1 and above is used,
since it would otherwise not bootstrap, pass regression testing and rebuild
the whole distribution (which uses mostly -O2 -mcpu=i686, but various other
options for various packages as well) without trouble.
Comment 2 Need Real Name 2001-03-03 00:22:48 EST
Created attachment 11681 [details]
Preprocess output, generated with 'gcc -O2 -o hello1 -save-temps hello.c
Comment 3 Need Real Name 2001-03-05 23:26:47 EST
I downloaded and recompiled gcc 2.96-75 (making stage1 with kgcc).  It seems to
be working OK, so far. I'm compiling evolution with it right now.  I'll try
rebuilding gcc 2.96-76 later this week, to see if it exhibits the same Internal
Error as the binary distribution did.  There may have been some weird
interaction between glibc and the compiler--I didn't have this problem until I
moved to the glibc 2.2.x libraries, from 2.1.92.
Comment 4 Jakub Jelinek 2001-03-07 06:21:17 EST
I cannot reproduce this with gcc 2.96-76 on the preprocessed source you provided,
nor with 2.96-77.1.

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