This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 116068 - c++ code core dumps w/ -O flag on x86_64, works in gcc 3.3.2
c++ code core dumps w/ -O flag on x86_64, works in gcc 3.3.2
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
x86_64 Linux
high Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-17 19:13 EST by Lenny
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-11 23:40:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lenny 2004-02-17 19:13:19 EST
Description of problem:

The following code snippit fails when compiled w/ optimization 
enabled on gcc 3.2.3-24.  It works when you don't compile w/ -O.  It 
also works with gcc 3.3.2.

Version-Release number of selected component (if applicable):

gcc-3.2.3-24 (x86_64)

How reproducible:

Always

Steps to Reproduce:

$ /usr/bin/g++ -m64 -O3 test.cpp 
$ ./a.out 
Testing 1...
Testing 1 OK
Testing 2...
Segmentation fault (core dumped)

Source for test.cpp:

#include <iostream>
using namespace std;

void test1(...) {
}
void test2(int i, ...) {
}

int main(int, char **)
{
     cout << "Testing 1..." << endl;
     test1(1, 1.2);
     cout << "Testing 1 OK" << endl;

     cout << "Testing 2..." << endl;
     test2(1, 1.2);
     cout << "Testing 2 OK" << endl;

     return 1;
}

  
Actual results:


Expected results:


Additional info:
Comment 2 John Flanagan 2004-05-11 23:40:21 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-142.html

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