[Bug libstdc++/70276] New: Writing to standard output concurrently through `std::cout` triggers a datarace

2016-03-19 Thread stefan at vectorfabrics dot com
: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: stefan at vectorfabrics dot com Target Milestone: --- Consider the following C++11 program: #include #include #include int main() { std

[Bug libstdc++/70276] Writing to standard output concurrently through `std::cout` triggers a datarace

2016-03-19 Thread stefan at vectorfabrics dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70276 --- Comment #1 from Stefan Holdermans --- A possible solution would be to make the accesses to `std::ios_base::_M_width` from `std::ios_base::width()` and `std::ios_base::width(streamsize)` atomic. Currently, these functions are defined by st

[Bug libstdc++/70276] Writing to standard output concurrently through `std::cout` triggers a datarace

2016-03-19 Thread stefan at vectorfabrics dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70276 --- Comment #2 from Stefan Holdermans --- Note that the C++11 Standard (§27.4.1) prescribes that "Concurrent access to a synchronized (§27.5.3.4) standard iostream object’s formatted and unformatted input (§27.7.2.1) and output (§27.7.3.1) funct