public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/7942: ostream core dump with hex/internal/showbase formatted output
@ 2002-11-05 19:33 bkoz
  0 siblings, 0 replies; 4+ messages in thread
From: bkoz @ 2002-11-05 19:33 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, llib, nobody

Synopsis: ostream core dump with hex/internal/showbase formatted output

State-Changed-From-To: feedback->analyzed
State-Changed-By: bkoz
State-Changed-When: Tue Nov  5 19:33:22 2002
State-Changed-Why:
    Can you try this with gcc or gcc-3_2-branch on solaris? I can't reproduce this on linux either. 

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


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

* Re: libstdc++/7942: ostream core dump with hex/internal/showbase formatted output
@ 2002-11-10 21:56 Bill Clarke
  0 siblings, 0 replies; 4+ messages in thread
From: Bill Clarke @ 2002-11-10 21:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

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

From: Bill Clarke <llib@computer.org>
To: bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
        nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org, paolo@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/7942: ostream core dump with hex/internal/showbase
	formatted output
Date: 11 Nov 2002 16:47:36 +1100

 On Wed, 2002-11-06 at 14:33, bkoz@gcc.gnu.org wrote:
 >     Can you try this with gcc or gcc-3_2-branch on solaris? I can't reproduce this on linux either. 
 
 i can confirm this on a recent checkout of gcc-3_2-branch (20021110) on
 solaris 2.9, configured with --with-cpu=ultrasparc (also has the same
 effect with same branch but configured without the cpu flag).  gdb stack
 trace is included in the output shown below (gdb 4.17, yes that's old
 but a build of gdb 5.2.1 dumps core when doing the stack trace; *sigh*
 another bug report to do )-:  
 
 note: i've changed the test code: changed line 16 from "cout << 1" to
 "cout << 9"; this makes it clearer that the program is reusing buffers
 (since the string "0x 9" appears in the stack trace, despite the core
 dump occuring during execution of the following "cout << 0").
 
 also note: the stack trace gets lost after level 6.
 
 $ ~/incoming/gcc-cvs/install/bin/g++ -static -g -o iosbug iosbug.cc
 [static so when i run it i'm sure to get the right library]
 
 Current directory is /space/bill/work/tests/
 GNU gdb 4.17
 Copyright 1998 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
 Starting program: /space/bill/work/tests/iosbug 
 
 0x9
 
 Program received signal SIGSEGV, Segmentation fault.
 0x43da4 in memcpy ()
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/sparc-sun-solaris2.9/bits/atomicity.h:89
 (gdb) bt
 #0  0x43da4 in memcpy ()
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/sparc-sun-solaris2.9/bits/atomicity.h:89
 #1  0x5db74 in
 _ZNSt5__padIcSt11char_traitsIcEE6_S_padERSt8ios_basecPcPKciib (
     __io=@0x1, __fill=58 ':', __news=0xffbff2ba " 9", 
     __olds=0xffbff338 "\210ÿ¿óPÿ¿õ`", __newlen=2, __oldlen=<incomplete
 type>, 
     __num=<incomplete type>)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/char_traits.h:147
 #2  0x584f4 in
 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertES3_RSt8ios_basecPKci (this=<incomplete type>, 
     __s={<iterator<std::output_iterator_tag,void,void,void,void>> = {}, 
       _M_sbuf = 0x60000000, _M_failed = false}, __io=@0x989e0, __fill=32
 ' ', 
     __ws=0xffbff2b8 "0x 9", __len=2)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/locale_facets.tcc:843
 #3  0x5838c in
 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_widen_intES3_RSt8ios_basecPci (this=<incomplete type>, 
     __s={<iterator<std::output_iterator_tag,void,void,void,void>> = {}, 
       _M_sbuf = 0xa000978, _M_failed = 84}, __io=@0x989e0, __fill=32 '
 ', 
     __cs=0xffbff330 "", __len=1)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/locale_facets.tcc:825
 #4  0x58cec in
 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecccT_ (this=<incomplete type>, 
     __s={<iterator<std::output_iterator_tag,void,void,void,void>> = {}, 
       _M_sbuf = 0x987, _M_failed = 8}, __io=@0x989e0, __fill=32 ' ', 
     __mod=117 'u', __modl=0 '\000', __v=1140853129)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/locale_facets.tcc:716
 #5  0x58968 in
 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecm (this=<incomplete type>, 
     __s={<iterator<std::output_iterator_tag,void,void,void,void>> = {}, 
       _M_sbuf = 0xffbff5, _M_failed = 248}, __io=@0x989e0, __fill=32 '
 ', __v=0)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/locale_facets.tcc:895
 #6  0x60fd8 in _ZNSolsEm (this=<incomplete type>, __n=0)
     at
 /space/bill/incoming/gcc-cvs/gcc-obj/sparc-sun-solaris2.9/libstdc++-v3/include/bits/locale_facets.h:745
 Cannot access memory at address 0x5cffc02e.
 (gdb) 
 
 cheers,
 /lib
 -- 
 /lib: Bill Clarke  ResearchScientist CAPResearch DeptCompSci ANU .au
 http://llib.cjb.net llib@computer.org  tel:+61-2-6125x5687 fax:x0010
 PGPid:B381EE7DB7D3E58F17248C672E2DA124ADADF444 GNU unix LaTeX XPilot
 Buffy DrWho Goodies StarTrek XFiles Origami SML SMP MPI mozilla tcsh
 Asimov Bear Clarke Donaldson Volleyball Ultimate Cricket emacs C++ X
 Jordan Kay Lackey Martin Stasheff DeepPurple H&C KLF Queen PinkFloyd
 


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

* Re: libstdc++/7942: ostream core dump with hex/internal/showbase formatted output
@ 2002-11-01  9:36 paolo
  0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2002-11-01  9:36 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, llib, nobody

Synopsis: ostream core dump with hex/internal/showbase formatted output

State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Fri Nov  1 09:36:28 2002
State-Changed-Why:
    Cannot reproduce on i686-pc-linux-gnu with current 3.2.1
    pre and 3.3 exp, seems target specific.
    In a few days gcc-3.2.1 will be out: could you possibly
    test again with that compiler and report?
    Thanks, Paolo.

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


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

* libstdc++/7942: ostream core dump with hex/internal/showbase formatted output
@ 2002-09-16 20:46 llib
  0 siblings, 0 replies; 4+ messages in thread
From: llib @ 2002-09-16 20:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7942
>Category:       libstdc++
>Synopsis:       ostream core dump with hex/internal/showbase formatted output
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 16 20:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Bill Clarke
>Release:        3.1.1
>Organization:
Australian National University
>Environment:
System: SunOS bullet 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

both 32 and 64-bit targets fail
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.1.1/configure --with-cpu=ultrasparc --enable-lanaguages=c,c++,f77 : (reconfigured) ../gcc-3.1.1/configure --with-cpu=ultrasparc --enable-languages=c,c++,f77
>Description:
a program that uses a particular combination of formatted output (ostream)
dumps core.

>How-To-Repeat:
// iosbug.cc:
#include <iostream>
#include <iomanip>

int main() {
  using namespace std;

  cout.flags(ios_base::showbase);
  cout << internal;
  cout << hex;

  cout << setw(2);		// must be >1 for bug! (5 also dumps)
  //  cout << 0;		// can print out a number (doesn't change bug)
  cout << endl;			// must be endl for bug, !flush!

  cout << 1;			// must be non-zero for bug!
  cout << endl;			// must be endl for bug, !flush!

  cout << setw(2);		// must be >1 for bug! (5 also dumps)
  cout << 0;			// dumps core in std::__put
  cout << endl;

  return 0;
}
// end of iosbug.cc

$ g++ -Wall -m32 -g iosbug.cc -o iosbug
$ ./iosbug

0x1
Segmentation fault (core dumped)
Exit 139
$ 

according to dbx:
$ dbx iosbug core
Reading iosbug
core file header read successfully
Reading ld.so.1
Reading libstdc++.so.4
Reading libm.so.1
Reading libgcc_s.so.1
Reading libc.so.1
Reading libdl.so.1
Reading libc_psr.so.1
program terminated by signal SEGV (no mapping at the fault address)
0xff3206cc: __align_cpy_1+0x00dc:       ldd     [%g1], %f0
dbx: warning: invalid frame pointer
(/usr/local/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
=>[1] __align_cpy_1(0xffbeff80, 0xffbeffff, 0xfffff21a, 0x7, 0xfffff210, 0xffbef19b), at 0xff3206cc
  [2] _ZSt5__padIcSt11char_traitsIcEEvRSt8ios_baseT_PS4_PKS4_iib(0x2b, 0xffbef21a, 0xffbef19a, 0xffbef218, 0x2, 0x1), at 0xff2c98a8
  [3] _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertES3_RSt8ios_basecPKci(0xff3091a8, 0xffbef220, 0x21628, 0x20, 0xffbef198, 0x2), at 0xff2c3cac
(/usr/local/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) exit
$ 

64-bit build of iosbug does similar.

(if you really want preprocessor output for the above source, then email me!)
>Fix:
workaround: none known.

i'm guessing it's a bug somewhere in std::__pad; when installed:
${prefix}/include/c++/3.1.1/bits/locale_facets.tcc, in source:
gcc/libstdc++-v3/include/bits/locale_facets.tcc.  i note from cvsweb that
__pad has changed recently (1.77->1.78) but i don't know if that will
affect the bug.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-11-11  5:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 19:33 libstdc++/7942: ostream core dump with hex/internal/showbase formatted output bkoz
  -- strict thread matches above, loose matches on Subject: below --
2002-11-10 21:56 Bill Clarke
2002-11-01  9:36 paolo
2002-09-16 20:46 llib

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