This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


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

libstdc++/3983: basic_istringstream<unsigned xxx> causes segfault



>Number:         3983
>Category:       libstdc++
>Synopsis:       basic_istringstream<unsigned xxx> causes segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 10 06:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ralf Corsepius
>Release:        unknown-1.0
>Organization:
>Environment:
gcc -v
Reading specs from /opt/gcc30/lib/gcc-lib/i486-suse-linux/3.0.1/specs
Configured with: ../configure --enable-threads=posix --enable-long-long --prefix=/opt/gcc30 --mandir=/opt/gcc30/man --infodir=/opt/gcc30/info --with-local-prefix=/usr/local --enable-languages=c,c++ --disable-nls --enable-shared --with-system-zlib --host=i486-suse-linux --build=i486-suse-linux
Thread model: posix
gcc version 3.0.1 20010807 (prerelease)

SuSE-Linux-7.2/glibc-2.2.2/Linux-2.4.7
>Description:
Using an unsigned template parameter with basic_istringstream<>
(Eg. unsigned char, unsigned int) causes random program output and segfaults.
>How-To-Repeat:
Compile and run the program below:

----- snip ------
#include <sstream>
#include <iostream>

using namespace std;

int main ( )
{
  int v ;
  unsigned char s[2] ;
  s[0] = '1';
  s[1] = 0;
  basic_istringstream<unsigned char> strm(s);
  strm >> v ;
//  cerr << "result: " << v << endl ;
  return 0;
}
----- snip -----

g++ -Wall -g -o foo foo.cc

./foo
foo: (h!@x÷ÿ¿o?@
foo: (h!@x÷ÿ¿o?@
Speicherzugriffsfehler (core dumped)

>Fix:

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