[RTEMS Project] #3012: Global C++ IO streams are broken (cout, cin, cerr)

RTEMS trac trac at rtems.org
Wed May 10 06:05:58 UTC 2017


#3012: Global C++ IO streams are broken (cout, cin, cerr)
-----------------------------+--------------------------
 Reporter:  Sebastian Huber  |       Owner:  Chris Johns
     Type:  defect           |      Status:  assigned
 Priority:  normal           |   Milestone:  Indefinite
Component:  GCC              |     Version:  4.12
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+--------------------------

Comment (by Sebastian Huber):

 Replying to [comment:3 Chris Johns]:
 > I have considered this and it is attractive. Is this something libstdc++
 supports out of the box or do we need to make changes?

 No, I guess it needs a some work and it is not clear if this is acceptable
 for libstdc++. The maintainer have a strong view if it comes to standard
 compliance.

 >
 > I would like to understand the issue a little more and how cygwin solves
 the problem.

 I guess the main thread is never deleted, so cout can use its stdout
 safely.

 > Joel has been testing some code on cygwin and it would be nice to get it
 to run on RTEMS and see how it breaks.
 >
 > I am concerned the current implementation's behavior is undefined if a
 thread calls {{{std::cout}}} and then is deleted leaving libstdc++ with a
 reference to invalid memory.

 This is why one option is to use the _GLOBAL_REENT.

--
Ticket URL: <http://devel.rtems.org/ticket/3012#comment:4>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list