|
From: Konstantin S. <kon...@gm...> - 2010-06-29 14:34:13
|
Hi Julian, Bart, Helgrind and DRD does not seem to detect races between a memory access and free(). (memcheck will find such bug only if free() happens before the access during a particular run). Do you plan to implement such functionality? (basically, free() should be treated as a write) I implemented such feature in ThreadSanitizer but was hit by libstdc++: the string implementation is unfriendly to race detectors because it uses atomic reference counting in the destructor. http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00762_source.html#l00228 Have you observed any issues around reference counting in string<>? Any thoughts? Thanks, --kcc P.S. Unittest where ThreadSanitizer correctly finds a race between a read and free(): http://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc?spec=svn2278&r=2278#6473 Unittest where ThreadSanitizer reports a false warning in ~basic_string: http://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc?spec=svn2278&r=2278#3186 |