From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22791 invoked by alias); 23 May 2002 13:26:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22771 invoked by uid 71); 23 May 2002 13:26:01 -0000 Resent-Date: 23 May 2002 13:26:01 -0000 Resent-Message-ID: <20020523132601.22770.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Andrew.Pollard@brooks-pri.com Received:(qmail 21603 invoked from network); 23 May 2002 13:21:46 -0000 Received: from unknown (HELO mis2.brooks.com) (63.71.19.252) by sources.redhat.com with SMTP; 23 May 2002 13:21:46 -0000 Received: from arlene.brooks.com ([10.78.254.253]) by mis2.brooks.com with esmtp (Exim 3.16 #1) id 17AsXH-0006k4-00 for gcc-gnats@gcc.gnu.org; Thu, 23 May 2002 09:21:43 -0400 Received: from primo.brooks.com (primo.brooks.com [10.78.254.42]) by arlene.brooks.com (8.11.6/8.11.6) with ESMTP id g4NDLfj24104 for ; Thu, 23 May 2002 14:21:43 +0100 Received: by primo.brooks.com (8.8.8+Sun/SMI-SVR4) id OAA17506; Thu, 23 May 2002 14:21:41 +0100 (BST) Message-Id:<200205231321.OAA17506@primo.brooks.com> Date: Thu, 23 May 2002 06:26:00 -0000 From: Andrew.Pollard@brooks-pri.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: libstdc++/6784: SEGV using istream >> operator under gcc-3.1/sun-sparc-solaris2.6 X-SW-Source: 2002-05/txt/msg00725.txt.bz2 List-Id: >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 #include 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(__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 >& std::operator>>, std::allocator >(std::basic_istream >&, std::basic_string, std::allocator >&) (__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: