Bug 51238

Summary: Use of "-fomit-frame-pointer" causes segfault
Product: [Retired] Red Hat Linux Reporter: Steve Snyder <swsnyder>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: t8m
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 19:33:51 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 Steve Snyder 2001-08-08 17:56:16 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010803

Description of problem:
Compiling Mozilla (0.9.2/0.9.3) with the "-fomit-frame-pointer" compiler
switch causes a segmentation fault when "regxpcom" is run.

How reproducible:
Always

Steps to Reproduce:
 1. Download (ftp.mozilla.org) and unpack Mozilla SRPM:

   
/pub/mozilla/releases/mozilla0.9.3/Red_Hat_7x_RPMS/SRPMS/mozilla-0.9.3-0.src.rpm

2. Edit ~/SPECS/mozilla.  Replace this text (line #113):

    BUILD_OFFICIAL=1 ./configure

  with this text:

    BUILD_OFFICIAL=1 CXXFLAGS="-march=i686 -O2" ./configure

3. Run: "rpm -bb --clean /usr/src/redhat/SPECS/mozilla".

4. The build runs to completion, proving that there are no problems with
the source code or with the switches ("-march=i686 -O2") used.

5. Now edit the spec file again.  Add the "-fomit-frame-pointer" switch:

    BUILD_OFFICIAL=1 CXXFLAGS="-march=i686 -O2 -fomit-frame-pointer"

6. Rebuild: "rpm -bb --clean /usr/src/redhat/SPECS/mozilla".

7. This time the build quits with this output:

    + MOZILLA_FIVE_HOME=/var/tmp/mozilla-root/usr/lib/mozilla
    + ./regxpcom
    /var/tmp/rpm-tmp.46295: line 122:  2197 Segmentation fault      (core
dumped) LD_LIBRARY_PATH=`pwd`:`pwd`/.. MOZILLA_FIVE_HOME=`pwd` ./regxpcom
    error: Bad exit status from /var/tmp/rpm-tmp.46295 (%install)




Actual Results:  Received notification of segmentation fault

Expected Results:  Build should run to completion. generating binary RPM files.


Additional info:

# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)

# rpm -qi binutils | grep Version
Version     : 2.10.91.0.2

Comment 1 Steve Snyder 2001-12-27 16:47:20 UTC
Well, I guess I'm just talking to myself here, but I'll submit an update anyway.

As seen above, this problem was originally reported on RHL v7.1 and Mozilla
v0.9.3.  The problem still exists on RHL v7.2 and Mozilla 0.9.7.  Same compiler
switches apply: "-march=i686 -O2" works, adding -fomit-frame-pointer causes
segfault.

Use of the switches is true whether CXXFLAGS is set explicitly as above or
whether implicitly via './configure --enable-optimize="-march=i686 -O2" '.

Updated info:

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)

$ rpm -qi binutils | grep Version
Version     : 2.11.90.0.8



Comment 2 Jakub Jelinek 2004-10-02 19:33:51 UTC
GCC 2.96-RH is too old now, if you can reproduce with contemporary GCCs,
please reopen.