public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/50703] New: std::stringstream not thread-safe
@ 2011-10-12 15:35 Hoenle2007@kayser-threde.com
  2011-10-12 15:37 ` [Bug libstdc++/50703] " Hoenle2007@kayser-threde.com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Hoenle2007@kayser-threde.com @ 2011-10-12 15:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50703

             Bug #: 50703
           Summary: std::stringstream not thread-safe
    Classification: Unclassified
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: Hoenle2007@kayser-threde.com


Our multi-threaded software (running on the SPARC compatible LEON3 processor
for space applications under the RTEMS 4.9.4 operating system) always locks up
at the same location outside the application software in libstdc++. See
attached debugger screenshot. The error arises between several minutes and
several hours of operation.

We were able to reproduce the problem with GCC/libstdc++ 4.2.4 and with 4.3.2.
We haven't tested newer versions.

The error apparently happens when the GNU library function __atomic_add() in
atomicity.cc is called very often, probably when being called from different
threads.
It could also be possibe that the error is not located in atomicity.cc but
already in its caller std::stringstream (in basic_ios.h).

We are pretty sure the application software can't do anything wrong at this
time as just the std::stringstream constructor is being called for an object on
the stack. See attached debugger screenshot.

We fixed the problem by replacing "std::stringstream" with our own class that
uses "printf" internally. Since then the application software never again
locked up.


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

end of thread, other threads:[~2013-08-04 10:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 15:35 [Bug libstdc++/50703] New: std::stringstream not thread-safe Hoenle2007@kayser-threde.com
2011-10-12 15:37 ` [Bug libstdc++/50703] " Hoenle2007@kayser-threde.com
2011-10-12 15:39 ` paolo.carlini at oracle dot com
2011-10-13  7:57 ` Hoenle2007@kayser-threde.com
2011-10-13  8:12 ` redi at gcc dot gnu.org
2011-10-13 12:02 ` redi at gcc dot gnu.org
2011-10-13 12:23 ` paolo.carlini at oracle dot com
2011-10-17  8:17 ` Hoenle2007@kayser-threde.com
2013-08-04 10:48 ` liuxiaopi349 at hotmail dot com

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