public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug
@ 2004-05-26 4:51 andrew at walrond dot org
2004-05-26 7:35 ` [Bug c++/15645] " pcarlini at suse dot de
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: andrew at walrond dot org @ 2004-05-26 4:51 UTC (permalink / raw)
To: gcc-bugs
This bug causes a segfault in my full application.This testcase does not crash,
but it does cause Valgrind to complain.
Testcase built with "gcc -lstdc++ test.cpp":
#include <sstream>
#include <iomanip>
using namespace std;
int main()
{
ostringstream oss;
oss << internal << setw(2) << 0;
}
Interestingly, the '0' triggers the behaviour. Substitute a non-zero number and
it runs without incident.
andrew@bob andrew $ valgrind --tool=memcheck a.out
==296== Memcheck, a memory error detector for x86-linux.
==296== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==296== Using valgrind-2.1.1, a program supervision framework for x86-linux.
==296== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==296== For more details, rerun with: -v
==296==
==296== Conditional jump or move depends on uninitialised value(s)
==296== at 0x3C07D9A6: std::__pad<char, std::char_traits<char>
>::_S_pad(std::ios_base&, char, char*, char const*, int, int, bool)
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07DA83: std::num_put<char, std::ostreambuf_iterator<char,
std::char_traits<char> > >::_M_pad(char, int, std::ios_base&, char*, char
const*, int&) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07E94A: std::ostreambuf_iterator<char, std::char_traits<char>
> std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> >
>::_M_convert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char>
>, std::ios_base&, char, long) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07E4CF: std::num_put<char, std::ostreambuf_iterator<char,
std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char,
std::char_traits<char> >, std::ios_base&, char, long) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296==
==296== Conditional jump or move depends on uninitialised value(s)
==296== at 0x3C07D9DD: std::__pad<char, std::char_traits<char>
>::_S_pad(std::ios_base&, char, char*, char const*, int, int, bool)
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07DA83: std::num_put<char, std::ostreambuf_iterator<char,
std::char_traits<char> > >::_M_pad(char, int, std::ios_base&, char*, char
const*, int&) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07E94A: std::ostreambuf_iterator<char, std::char_traits<char>
> std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> >
>::_M_convert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char>
>, std::ios_base&, char, long) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296== by 0x3C07E4CF: std::num_put<char, std::ostreambuf_iterator<char,
std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char,
std::char_traits<char> >, std::ios_base&, char, long) const
(in /pkg/gcc.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5)
==296==
==296== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 17 from 1)
==296== malloc/free: in use at exit: 0 bytes in 0 blocks.
==296== malloc/free: 2 allocs, 2 frees, 1138 bytes allocated.
==296== For a detailed leak analysis, rerun with: --leak-check=yes
==296== For counts of detected errors, rerun with: -v
andrew@bob andrew $
--
Summary: stringstream/ostream/iomanip memory scribble bug
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew at walrond dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/15645] stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
@ 2004-05-26 7:35 ` pcarlini at suse dot de
2004-05-26 11:08 ` [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-05-26 7:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-05-25 08:45 -------
Hi. This is a duplicate of libstdc++/11352, already fixed in 3_4-branch and
mainline. I'm testing a back port to 3_3 and will post it soon for Gaby's
approval.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-05-25 08:45:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
2004-05-26 7:35 ` [Bug c++/15645] " pcarlini at suse dot de
@ 2004-05-26 11:08 ` pinskia at gcc dot gnu dot org
2004-05-28 10:06 ` bkoz at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-26 11:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|stringstream/ostream/iomanip|[3.3
|memory scribble bug |only]stringstream/ostream/io
| |manip memory scribble bug
Target Milestone|--- |3.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
2004-05-26 7:35 ` [Bug c++/15645] " pcarlini at suse dot de
2004-05-26 11:08 ` [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip " pinskia at gcc dot gnu dot org
@ 2004-05-28 10:06 ` bkoz at gcc dot gnu dot org
2004-05-28 10:48 ` pcarlini at suse dot de
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-05-28 10:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bkoz at gcc dot gnu dot org 2004-05-27 18:33 -------
any luck on the backport?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (2 preceding siblings ...)
2004-05-28 10:06 ` bkoz at gcc dot gnu dot org
@ 2004-05-28 10:48 ` pcarlini at suse dot de
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-05-28 10:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-05-27 19:04 -------
Hi Benjamin. I'm linking the patch here, for our convenience:
http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01582.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (3 preceding siblings ...)
2004-05-28 10:48 ` pcarlini at suse dot de
@ 2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-06-13 9:31 ` andrew at walrond dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-11 22:22 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.3.4 |3.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (4 preceding siblings ...)
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
@ 2004-06-13 9:31 ` andrew at walrond dot org
2004-06-13 9:37 ` pcarlini at suse dot de
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: andrew at walrond dot org @ 2004-06-13 9:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From andrew at walrond dot org 2004-06-13 09:31 -------
I see this has been pushed back from 3.3.4
Very dissappointing since iostream is, let face it, pretty fundamental stuff as
far as c++ is concerned. It should be included as a matter of urgency.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (5 preceding siblings ...)
2004-06-13 9:31 ` andrew at walrond dot org
@ 2004-06-13 9:37 ` pcarlini at suse dot de
2004-06-13 10:05 ` andrew at walrond dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-06-13 9:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-06-13 09:37 -------
When your PR arrived, 3_3-branch was already frozen for the release of 3.3.4...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (6 preceding siblings ...)
2004-06-13 9:37 ` pcarlini at suse dot de
@ 2004-06-13 10:05 ` andrew at walrond dot org
2004-06-13 10:08 ` pcarlini at suse dot de
2004-07-08 8:57 ` pcarlini at suse dot de
9 siblings, 0 replies; 11+ messages in thread
From: andrew at walrond dot org @ 2004-06-13 10:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From andrew at walrond dot org 2004-06-13 10:05 -------
Yes, I see. I'd noted that the euquivalent 11352 was around for 12months or so,
but reading the commentary I understand the progression.
Is this really fixed in 3.4.0 (as indicated in bugzilla entry) or just
3_4-branch and mainline as per your earlier email?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (7 preceding siblings ...)
2004-06-13 10:05 ` andrew at walrond dot org
@ 2004-06-13 10:08 ` pcarlini at suse dot de
2004-07-08 8:57 ` pcarlini at suse dot de
9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-06-13 10:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-06-13 10:08 -------
Yes, it's fixed in 3.4.0:
2004-02-15 David Asher <david.asher@cavium.com>
PR libstdc++/11352
* include/bits/locale_facets.tcc (__pad<>::_S_pad): Don't
access __olds beyond __oldlen.
Thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip memory scribble bug
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
` (8 preceding siblings ...)
2004-06-13 10:08 ` pcarlini at suse dot de
@ 2004-07-08 8:57 ` pcarlini at suse dot de
9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-07-08 8:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-07-08 08:57 -------
Fixed for 3.3.5 too.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15645
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-07-08 8:57 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-26 4:51 [Bug c++/15645] New: stringstream/ostream/iomanip memory scribble bug andrew at walrond dot org
2004-05-26 7:35 ` [Bug c++/15645] " pcarlini at suse dot de
2004-05-26 11:08 ` [Bug libstdc++/15645] [3.3 only]stringstream/ostream/iomanip " pinskia at gcc dot gnu dot org
2004-05-28 10:06 ` bkoz at gcc dot gnu dot org
2004-05-28 10:48 ` pcarlini at suse dot de
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-06-13 9:31 ` andrew at walrond dot org
2004-06-13 9:37 ` pcarlini at suse dot de
2004-06-13 10:05 ` andrew at walrond dot org
2004-06-13 10:08 ` pcarlini at suse dot de
2004-07-08 8:57 ` pcarlini at suse dot de
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).