Boost logo

Boost :

Subject: Re: [boost] [thread] thread_specific_ptr, dangerous conflation of identity and address
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-02-15 18:38:26


----- Original Message -----
From: <strasser_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, February 15, 2010 11:54 PM
Subject: Re: [boost] [thread] thread_specific_ptr, dangerous conflation of identity and address

>
> Zitat von Edd Dawson <lists_at_[hidden]>:
>> The bigger problem though, is that it might not be *their* old data.
>> It can just as easily be someone else's old data due to coincidental
>> alignment of different thread_specific_ptrs on the stack at entirely
>> unrelated points in the program, or even in different libraries that
>> each happen to use boost::thread_specific_ptr!
>
>> It's easy to see the problem here as the calls are very close to one
>> another. In general, however, this strikes me as being really rather
>> dangerous behaviour.
>>
>> Would it be fair to call it a bug?
>
> I have reported this bug here, including a simpler test case:
> https://svn.boost.org/trac/boost/ticket/3837
>
> and posted a (more efficient) implementation of thread_specific_ptr
> which doesn't have this bug here:
> http://www.boostpro.com/vault/index.php?action=downloadfile&filename=tss.hpp&directory=&
>
> no reaction from the Boost.Thread maintainer so far.

Hi,
I find this a rather severe design bug. I will propose you to change the severity to showstopper as we can not use thread_specific_ptr other than statically. Anthony, what do you think?

Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk