Opened 10 years ago
Closed 10 years ago
#8336 closed Bugs (fixed)
fusion sequence io manipulators are thread un-safe
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | To Be Determined | Component: | fusion |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | fusion, sequence, io, manipulator, thread | Cc: |
Description
boost::detail::stream_data::attach uses a std::vector to store instances of data associated with the tuple_open, tuple_close, tuple_delimiter io manipulators. When streaming unrelated fusion sets to unrelated ostringstreams from different threads fails MSVC's debug iterator checks leading to an assert.
Additionally the stored data items once constructed remain in memory until program exit.
The attached patch removes the static vector instance, allowing the stream to properly manage the manipulator data lifetime by using std::ios_base::register_callback.
Attachments (3)
Change History (5)
by , 10 years ago
Attachment: | manip.hpp.patch added |
---|
by , 10 years ago
Attachment: | manip.hpp.2.patch added |
---|
updated patch replacing local static initialization with C++03 class static initialization
comment:1 by , 10 years ago
Replaced local static initialization with C++03 class static initialization similar to the boost units lib io.hpp implementation.
by , 10 years ago
Attachment: | io.cpp.patch added |
---|
added test for overwriting tuple_xxx io manipulater, using strings as values, fix compile warning
patch with thread safety fix