This is the mail archive of the
libstdc++-prs@sourceware.cygnus.com
mailing list for the libstdc++ project.
libstdc++/25: all (istream) input causes segmentation fault
- To: libstdc++-gnats at sourceware dot cygnus dot com
- Subject: libstdc++/25: all (istream) input causes segmentation fault
- From: Nicholas dot Walker at desy dot de
- Date: 12 Jan 2000 11:25:23 -0000
- Reply-To: Nicholas dot Walker at desy dot de
- Resent-Cc: libstdc++-prs at sourceware dot cygnus dot com
- Resent-Reply-To: libstdc++-gnats@sourceware.cygnus.com, Nicholas.Walker@desy.de
>Number: 25
>Category: libstdc++
>Synopsis: all (istream) input causes segmentation fault
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 12 03:27:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Nick Walker
>Release: stdlibc++-2.90.7
>Organization:
>Environment:
solaris (SunOS vs 5.5.1)
>Description:
Attempting to read anything from an istream causes a segmentation fault. I have traced the problem to line 326 in file locale_facets.h:
bool
is(mask __m, char __c) const throw()
-> { return _M_table[(unsigned char)(__c)] & __m; }
It appears that _M_table = 0x0.
I am using a local installed version of stdlibc++-2.90.7, compiled with gcc 2.95.2. The test code (see How-To-Repeat) was compiled and linked using the -static flag. Both debug (-g) and optimised (-O3) compilation show the same bug.
As a side note, compiling the same code with 2.90.6 runs fine - but 2.90.6 float/double output doesn't work, and so I need 2.90.7.
>How-To-Repeat:
#include <iostream>
#include <fstream>
int main()
{
int n; // replace with your favorite type
cin>>n; // boom!
ifstream is("test.dat");
is>>n; // still boom!
return 0;
}
>Fix:
Badly need one!!
>Release-Note:
>Audit-Trail:
>Unformatted: