public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
@ 2002-07-03 17:55 bkoz
  0 siblings, 0 replies; 4+ messages in thread
From: bkoz @ 2002-07-03 17:55 UTC (permalink / raw)
  To: dje, gcc-bugs, gcc-prs, nikhild, nobody

Synopsis: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers

Responsible-Changed-From-To: unassigned->dje
Responsible-Changed-By: bkoz
Responsible-Changed-When: Wed Jul  3 17:55:41 2002
Responsible-Changed-Why:
    Yours...
State-Changed-From-To: open->analyzed
State-Changed-By: bkoz
State-Changed-When: Wed Jul  3 17:55:41 2002
State-Changed-Why:
    I cannot reproduce this.
    
    on x86/linux, I've been unable to reproduce this with the following:
    
    gcc-3_1-branch
    gcc
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6991


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
@ 2002-11-06 11:57 dje
  0 siblings, 0 replies; 4+ messages in thread
From: dje @ 2002-11-06 11:57 UTC (permalink / raw)
  To: dje, gcc-bugs, gcc-prs, nikhild

Synopsis: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers

State-Changed-From-To: analyzed->closed
State-Changed-By: dje
State-Changed-When: Wed Nov  6 11:57:34 2002
State-Changed-Why:
    I cannot duplicate this problem on AIX 4.3.3.0 using G++ 3.2.
    Please upgrade your compiler.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6991


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
@ 2002-07-19  8:26 Nikhil R. Deshpande
  0 siblings, 0 replies; 4+ messages in thread
From: Nikhil R. Deshpande @ 2002-07-19  8:26 UTC (permalink / raw)
  To: dje; +Cc: gcc-prs

The following reply was made to PR libstdc++/6991; it has been noted by GNATS.

From: "Nikhil R. Deshpande" <nikhild@flashmail.com>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<dje@gcc.gnu.org>
Cc:  
Subject: Re: libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
Date: Fri, 19 Jul 2002 11:16:57 -0400

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_000C_01C22F15.CB8624E0
 Content-Type: text/plain;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=3D=
 gcc&pr=3D6991
 
 dje wrote:
 > I cannot reproduce this.
 >   =20
 >    on x86/linux, I've been unable to reproduce this with the =
 following:
 >   =20
 >    gcc-3_1-branch
 >    gcc
 
 The problem is reproducible on my machine with=20
 AIX 4.3.3.0
 GCC 3.0.4
 (and not x86/linux).
 Is there any way I can help you in solving this? (I have a very similar =
 problem on GCC 3.0.4
 on Solaris 2.8, but I am unable to produce a simple test case.)
 
 With regards,
  Nikhil
 
 
 ------=_NextPart_000_000C_01C22F15.CB8624E0
 Content-Type: text/html;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML><HEAD>
 <META http-equiv=3DContent-Type content=3D"text/html; =
 charset=3Diso-8859-1">
 <META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
 <STYLE></STYLE>
 </HEAD>
 <BODY bgColor=3D#ffffff>
 <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
 <DIV><A=20
 href=3D"http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&a=
 mp;database=3Dgcc&amp;pr=3D6991">http://gcc.gnu.org/cgi-bin/gnatsweb.pl?c=
 md=3Dview%20audit-trail&amp;database=3Dgcc&amp;pr=3D6991</A></DIV>
 <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
 <DIV>dje wrote:</DIV>
 <DIV>&gt; I cannot reproduce this.<BR><FONT face=3DArial=20
 size=3D2>&gt;</FONT>&nbsp;&nbsp;&nbsp; <BR>&gt;&nbsp;&nbsp;&nbsp; on =
 x86/linux,=20
 I've been unable to reproduce this with the following:<BR><FONT =
 face=3DArial=20
 size=3D2>&gt;</FONT>&nbsp;&nbsp;&nbsp; <BR>&gt;&nbsp;&nbsp;&nbsp;=20
 gcc-3_1-branch<BR>&gt;&nbsp;&nbsp;&nbsp; gcc<BR></DIV>
 <DIV><FONT face=3DArial size=3D2>The problem is reproducible on my =
 machine with=20
 </FONT></DIV>
 <DIV><FONT face=3DArial size=3D2>AIX 4.3.3.0<BR>GCC =
 3.0.4</FONT><BR><FONT face=3DArial=20
 size=3D2>(and not x86/linux).</FONT></DIV>
 <DIV><FONT face=3DArial size=3D2>Is there any way I can help you in =
 solving this? (I=20
 have a very similar problem on GCC 3.0.4</FONT></DIV>
 <DIV><FONT face=3DArial size=3D2>on Solaris 2.8, but&nbsp;I am unable to =
 produce a=20
 simple test case.)</FONT></DIV>
 <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
 <DIV><FONT face=3DArial size=3D2>With regards,</FONT></DIV>
 <DIV><FONT face=3DArial size=3D2>&nbsp;Nikhil</FONT></DIV>
 <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>
 
 ------=_NextPart_000_000C_01C22F15.CB8624E0--
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
@ 2002-06-11  7:06 nikhild
  0 siblings, 0 replies; 4+ messages in thread
From: nikhild @ 2002-06-11  7:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: nikhild


>Number:         6991
>Category:       libstdc++
>Synopsis:       Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 11 07:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nikhil Deshpande
>Release:        GCC 3.0.4
>Organization:
>Environment:
AIX 4.3.3.0
GNU binutils 2.12.1
GCC 3.0.4
>Description:
- Seg fault when writing (operator<<) numbers to 
  ostringstream.
- BUT seg fault only if os << i statement is followed by
  os.str() call. If os.str() is removed, it does not crash.
  e.g. 
    ostringstream os;
    int i = 1234;
    os << i; // crashes here
    os.str(); // presence of this stmt effects above crash
- Also happens for long, float, double etc. (any number).

----------------------------------------------------------

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 "powerpc-ibm-aix4.3.3.0"...
Core was generated by `a.out'.
Program terminated with signal 11, Segmentation fault.
bt#0  0x10002888 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (
    this=0x60002, __s=
      {<iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, _M_sbuf = 0x2ff2289c, _M_failed = false}, __f=@0x2ff228f0, __fill=32 ' ', __v=1234)
    at /usr/local/gcc-3.0.4/include/g++-v3/bits/locale_facets.h:758
758           { return do_put(__s, __f, __fill, __v); }
(gdb) bt
#0  0x10002888 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (
    this=0x60002, __s=
      {<iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, _M_sbuf = 0x2ff2289c, _M_failed = false}, __f=@0x2ff228f0, __fill=32 ' ', __v=1234)
    at /usr/local/gcc-3.0.4/include/g++-v3/bits/locale_facets.h:758
#1  0x100014f4 in std::ostream::operator<<(long) (this=0x2ff22898, __n=1234)
    at /usr/local/gcc-3.0.4/include/g++-v3/bits/ostream.tcc:157
#2  0x10000848 in std::ostream::operator<<(int) (this=0x2ff22898, __n=1234)
    at /usr/local/gcc-3.0.4/include/g++-v3/bits/std_ostream.h:120
#3  0x100004e4 in main (argc=1, argv=0x2ff229e8) at t.cc:6
#4  0x100001dc in __start ()

----------------------------------------------------------

storab@kansai ~/nikhild/test>g++ -v
Reading specs from /usr/local/gcc-3.0.4/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --prefix=/usr/local/gcc-3.0.4 --enable-threads=posix --enable-languages=c,c++ --disable-libgcj
Thread model: single
gcc version 3.0.4
----------------------------------------------------------

storab@kansai ~/nikhild/test>g++ -v -pthread
Reading specs from /usr/local/gcc-3.0.4/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --prefix=/usr/local/gcc-3.0.4 --enable-threads=posix --enable-languages=c,c++ --disable-libgcj
Thread model: posix
gcc version 3.0.4
g++: No input files
>How-To-Repeat:
1. Compile t.cc example source code with g++ 3.0.4
   g++ -pthread -g t.cc
2. Run (which results in to seg fault).
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="t.cc"
Content-Disposition: inline; filename="t.cc"

#include <sstream>

int main(int argc, char* argv[]) {
    int i = 1234;
    std::ostringstream os;
    os << i;
    os.str();
    return 0;
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-06 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-03 17:55 libstdc++/6991: Seg fault in std::num_put (called from ostringstream::operator<<) while putting numbers bkoz
  -- strict thread matches above, loose matches on Subject: below --
2002-11-06 11:57 dje
2002-07-19  8:26 Nikhil R. Deshpande
2002-06-11  7:06 nikhild

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).