public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Andrew.Pollard@brooks-pri.com
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/6784: SEGV using istream >> operator under gcc-3.1/sun-sparc-solaris2.6
Date: Thu, 23 May 2002 06:26:00 -0000	[thread overview]
Message-ID: <200205231321.OAA17506@primo.brooks.com> (raw)


>Number:         6784
>Category:       libstdc++
>Synopsis:       SEGV using istream >> operator under gcc-3.1/sun-sparc-solaris2.6
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 23 06:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew.Pollard@brooks-pri.com
>Release:        3.1
>Organization:
Brooks-PRI Automation
>Environment:
System: SunOS primo 5.6 Generic_105181-26 sun4u sparc SUNW,Ultra-4
Architecture: sun4

host: sparc-sun-solaris2.6
build: sparc-sun-solaris2.6
target: sparc-sun-solaris2.6
configured with: /disks/arlene/gnu/gcc-3.1/configure --prefix=/disks/homes/andrewp/compilers/gcc-3.1-sun-sparc-solaris2.6 --with-gnu-as --with-gnu-ld --enable-threads=solaris --enable-version-specific-runtime-libs --disable-shared --enable-languages=c++

binutils-2.12.1
>Description:
The following simple program:

bug.cxx
-----------------
#include <string>
#include <iostream>

int
main()
{
    std::string tok;
    std::cin >> tok;
    return (0);
}
-----------------

Causes a SEGV when compiled and run with the stock gcc-3.1/sun-sparc-solaris2.6
on a Solaris2.6 machine

This does not occur for

a) gcc-3.1/sun-sparc-solaris2.8
b) gcc-3.1/i686-pc-linux-gnu
c) gcc-3.0.4/sun-sparc-solaris2.6
>How-To-Repeat:
% g++ -v
Reading specs from /disks/homes/andrewp/compilers/gcc-3.1-sun-sparc-solaris2.6/lib/gcc-lib/sparc-sun-solaris2.6/3.1/specs
Configured with: /disks/arlene/gnu/gcc-3.1/configure --prefix=/disks/homes/andrewp/compilers/gcc-3.1-sun-sparc-solaris2.6 --with-gnu-as --with-gnu-ld --enable-threads=solaris --enable-version-specific-runtime-libs --disable-shared --enable-languages=c++
Thread model: solaris
gcc version 3.1

% g++ -g bug.cxx
% ./a.out < bug.cxx
Segmentation fault

% gdb ./a.out
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.6"...
(gdb) run < bug.cxx
Starting program: /disks/homes/andrewp/a.out < bug.cxx

Program received signal SIGSEGV, Segmentation fault.
0x0002850c in std::istream::sentry::sentry(std::istream&, bool) (
    this=0xeffffa27, __in=@0x50d40, __noskipws=35)
    at /disks/primo4/workplaces/andrewp/gnu/gcc-3.1-standard-build/sparc-sun-solaris2.6/libstdc++-v3/include/sparc-sun-solaris2.6/bits/ctype_inline.h:40
40        { return _M_table[static_cast<unsigned char>(__c)] & __m; }
(gdb) where
#0  0x0002850c in std::istream::sentry::sentry(std::istream&, bool) (
    this=0xeffffa27, __in=@0x50d40, __noskipws=35)
    at /disks/primo4/workplaces/andrewp/gnu/gcc-3.1-standard-build/sparc-sun-solaris2.6/libstdc++-v3/include/sparc-sun-solaris2.6/bits/ctype_inline.h:40
#1  0x0002cb1c in std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (__in=@0x50d40, __str=@0xeffffab8)
    at /disks/primo4/workplaces/andrewp/gnu/gcc-3.1-standard-build/sparc-sun-solaris2.6/libstdc++-v3/include/bits/istream.tcc:1133
#2  0x00011224 in main () at bug.cxx:8
(gdb) quit

Whereas on a Solaris2.8 system...

% g++ -v
Reading specs from /disks/homes/andrewp/compilers/gcc-3.1-sun-sparc-solaris2.8/lib/gcc-lib/sparc-sun-solaris2.8/3.1/specs
Configured with: /disks/arlene/gnu/gcc-3.1/configure --prefix=/disks/homes/andrewp/compilers/gcc-3.1-sun-sparc-solaris2.8 --with-gnu-as --with-gnu-ld --enable-threads=solaris --enable-version-specific-runtime-libs --disable-shared --enable-languages=c++
Thread model: solaris
gcc version 3.1

% g++ -g bug.cxx

% ./a.out < bug.cxx
%

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


             reply	other threads:[~2002-05-23 13:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-23  6:26 Andrew.Pollard [this message]
2002-05-23  8:37 bkoz
2002-05-23 10:46 Andrew Pollard
2002-05-24  9:56 Benjamin Kosnik
2002-05-24 10:27 Phil Edwards
2002-05-26  7:26 Gabriel Dos Reis
2002-05-27  2:36 Benjamin Kosnik
2002-05-27  2:39 Gabriel Dos Reis
2002-05-27  2:46 Benjamin Kosnik
2002-05-27  3:16 Gabriel Dos Reis
2002-05-27  4:26 Andrew Pollard
2002-05-27  4:53 Benjamin Kosnik
2002-05-27  4:57 bkoz
2002-05-28 10:18 Andrew Pollard
2002-05-29  2:16 bkoz
2002-05-29  2:16 Benjamin Kosnik

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=200205231321.OAA17506@primo.brooks.com \
    --to=andrew.pollard@brooks-pri.com \
    --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).