This is the mail archive of the libstdc++-prs@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/25: all (istream) input causes segmentation fault



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]