Subject: [Boost-bugs] [Boost C++ Libraries] #5699: boost::thread_specific_ptr will reuse a value if allocated with the same this pointer
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-15 01:28:52
#5699: boost::thread_specific_ptr will reuse a value if allocated with the same
this pointer
------------------------------+---------------------------------------------
Reporter: delong.j@⦠| Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.47.0 | Severity: Problem
Keywords: thread |
------------------------------+---------------------------------------------
Since this cast to void* is used as the key in the tss data, if you delete
a thread_specific_ptr, and then another one is allocated with the same
address, it will reuse the value (even if it is of the wrong type).
Attaching repro case.
It seems like part of the issue is the design to only delete the calling
thread's value. Maybe it would make sense to run through a linked list
running through the thread_data_base instances and delete associated
values during ~thread_specific_ptr?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5699> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC