Bug 30146 - gcc -- Internal error: Segmentation fault.
Summary: gcc -- Internal error: Segmentation fault.
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-01 04:27 UTC by Need Real Name
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-03-06 04:26:51 UTC
Embargoed:


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

Description Need Real Name 2001-03-01 04:27:51 UTC
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
optimization.

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
borked).
	

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
-I/home/me2v/redhat/BUILD/freetype-2.0.1/builds/unix
-I/home/me2v/redhat/BUILD/freetype-2.0.1/include
-I/home/me2v/redhat/BUILD/freetype-2.0.1/src
/home/me2v/redhat/BUILD/freetype-2.0.1/src/base/ftsystem.c  -fPIC -DPIC -o
/home/me2v/redhat/BUILD/freetype-2.0.1/obj/.libs/ftsystem.lo
In file included from /usr/include/string.h:359,
                 from
/home/me2v/redhat/BUILD/freetype-2.0.1/src/base/ftsystem.c:36:
/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:

gcc-2.96-76
gcc-objc-2.96-76
kgcc-1.1.2-40
gcc-java-2.96-76
gcc-c++-2.96-76
libstdc++-devel-2.96-76
libstdc++-2.96-76

kgcc-1.1.2-40

glibc-2.2.2-3
glibc-common-2.2.2-3
glibc-profile-2.2.2-3
glibc-devel-2.2.2-3

Comment 1 Jakub Jelinek 2001-03-02 09:31:08 UTC
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 05:22:48 UTC
Created attachment 11681 [details]
Preprocess output, generated with 'gcc -O2 -o hello1 -save-temps hello.c

Comment 3 Need Real Name 2001-03-06 04:26:47 UTC
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 11:21:17 UTC
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.