libstdc++/4402: Crash in std::ostream with bad values and std::fixed

stuart@personalrobots.com stuart@personalrobots.com
Wed Sep 26 07:26:00 GMT 2001


>Number:         4402
>Category:       libstdc++
>Synopsis:       Crash in std::ostream with bad values and std::fixed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 26 07:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     stuart@personalrobots.com
>Release:        gcc 3.0
>Organization:
>Environment:
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc-3.0/configure --enable-threads
Thread model: posix
gcc version 3.0
>Description:
The following code causes a SEGV - I know it is a silly thing to do but bad values happen sometimes and it is easier to debug if the stack doesn't get trashed when trying to output some debugging information!

Code test.cc:
#include <iostream>
#include <iomanip>

int main ( int argc, char *argv[] )
{
    double value = 3.5e230;
    std::cout << std::fixed << std::setprecision(3) << value << " " <<
	std::setprecision(1) << value << std::endl;
}

Compile with:
gcc test.cc -o test -lstdc++



>How-To-Repeat:
Compile and run the code in the description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list