Boost logo

Boost Users :

Subject: [Boost-users] [atomic] ThreadSanitizer reports a data race when using the code from "reference counting" example
From: Adam Romanek (romanek.adam_at_[hidden])
Date: 2014-06-29 15:16:45


Hi Boosters!

I'd like to draw your attention to an issue with Boost.Atomic that I
encountered when using ThreadSanitizer. The problem is that when using
the code shown in "reference counting" example [1] from the docs, the
ThreadSanitizer reports a data race. Everything is described in detail
in a StackOverflow thread [2] so I don't want to repeat all that here.

Please help me determine whether it's a false positive, an issue in
Boost.Atomic or a wrong usage of the code.

Additionally, I don't understand this:

Write of size 1 at 0x7d040000f7f0 by thread T2:
     #0 operator delete(void*) <null>:0 (a.out+0x00000004738b)

What kind of write does ThreadSanitizer might refer to?

WBR,
Adam Romanek

[1]
http://www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html#boost_atomic.usage_examples.example_reference_counters
[2]
http://stackoverflow.com/questions/24446561/threadsanitizer-reports-data-race-on-operator-deletevoid-when-using-embedde


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net