From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7875 invoked by alias); 25 Sep 2002 00:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7846 invoked by uid 71); 25 Sep 2002 00:16:00 -0000 Resent-Date: 25 Sep 2002 00:16:00 -0000 Resent-Message-ID: <20020925001600.7845.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Adam Fanello Received: (qmail 4629 invoked from network); 25 Sep 2002 00:08:22 -0000 Received: from unknown (HELO MAIL.centor.com) (216.133.21.254) by sources.redhat.com with SMTP; 25 Sep 2002 00:08:22 -0000 Received: by MAIL with Internet Mail Service (5.5.2653.19) id ; Tue, 24 Sep 2002 17:12:19 -0700 Message-Id: <012D0E417390D411ABD400A0C9175D8050D0E2@MAIL> Date: Tue, 24 Sep 2002 17:16:00 -0000 From: Adam Fanello To: "'gcc-gnats@gcc.gnu.org'" Cc: Glen Knowles Subject: c++/8026: -fstack-check dumps when throw out of scope with ostringstream X-SW-Source: 2002-09/txt/msg00656.txt.bz2 List-Id: >Number: 8026 >Category: c++ >Synopsis: -fstack-check dumps when throw out of scope with >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Sep 24 17:16:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: afanello@centor.com >Release: 3.2 >Organization: >Environment: System: HP-UX hp11 B.11.00 U 9000/800 813839606 unlimited-user license host: hppa2.0n-hp-hpux11.00 build: hppa2.0n-hp-hpux11.00 target: hppa2.0n-hp-hpux11.00 configured with: ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure >Description: Throwing out of a scope which contains a std::ostringstream when the program was compiled with the -fstack-check option causes a SIGSEGV while unwinding the stack. >How-To-Repeat: Source program: ctcore.cpp --------------------------------------------------------------------------- #include #include using namespace std; int main(int argc, const char** argv, const char** envp) { try { ostringstream msg; throw 0; } catch (int ex) { cout << "Caught exception" << endl; } cout << "End program." << endl; return 0; } -------------------------------------------------------------------------- $ g++ -fstack-check ctcore.cpp $ ./a.out Segmentation fault (core dumped) $ >Fix: Workaround: Don't use -fstack-check ------_=_NextPart_001_01C26428.3261B9D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable -fstack-check dumps when throw out of scope with = ostringstream

>Submitter-Id:  net
>Originator:    = afanello@centor.com
>Organization: 
>Confidential:  no
>Synopsis:      = -fstack-check dumps when throw out of scope with ostringstream
>Severity:      = serious
>Priority:      = medium
>Category:      = c++
>Class: =         wrong-code
>Release:       = 3.2
>Environment:
System: HP-UX hp11 B.11.00 U 9000/800 813839606 = unlimited-user license


       =20
host: hppa2.0n-hp-hpux11.00
build: hppa2.0n-hp-hpux11.00
target: hppa2.0n-hp-hpux11.00
configured with: ./configure  : (reconfigured) = ./configure  : (reconfigured) ./configure  : (reconfigured) = ./configure  : (reconfigured) ./configure  : (reconfigured) = ./configure  : (reconfigured) ./configure  : (reconfigured) = ./configure  : (reconfigured) ./configure  : (reconfigured) = ./configure  : (reconfigured) ./configure

>Description:
Throwing out of a scope which contains a = std::ostringstream when the program
was compiled with the -fstack-check option causes a = SIGSEGV while unwinding
the stack.

>How-To-Repeat:

Source program: ctcore.cpp
---------------------------------------------------------------= ------------
#include <iostream>
#include <sstream>

using namespace std;
 

int main(int argc, const char** argv, const char** = envp)
{
    try
    {
         = ostringstream msg;
         = throw 0;
    }
    catch (int ex)
    {
       cout << = "Caught exception" << endl;
    }

    cout << "End = program." << endl;
    return 0;
}
---------------------------------------------------------------= -----------

$ g++ -fstack-check ctcore.cpp
$ ./a.out
Segmentation fault (core dumped)
$

>Fix:
        Workaround: Don't use -fstack-check

------_=_NextPart_001_01C26428.3261B9D0-- >Release-Note: >Audit-Trail: >Unformatted: This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C26428.3261B9D0 Content-Type: text/plain; charset="iso-8859-1" ostringstream