public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: corsepiu@faw.uni-ulm.de
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/3983: basic_istringstream<unsigned xxx> causes segfault
Date: Fri, 10 Aug 2001 06:16:00 -0000	[thread overview]
Message-ID: <20010810130618.1649.qmail@sourceware.cygnus.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

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


             reply	other threads:[~2001-08-10  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-10  6:16 corsepiu [this message]
2002-03-11 11:12 pme
2002-04-02 18:36 bkoz
2002-04-03 12:36 bkoz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010810130618.1649.qmail@sourceware.cygnus.com \
    --to=corsepiu@faw.uni-ulm.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).