|
From: Dave G. <go...@mc...> - 2010-07-08 16:20:09
|
On Jul 8, 2010, at 1:50 AM CDT, Konstantin Serebryany wrote: > Hi Dave, > > If I run your test code under tsan (with dynamic annotations enabled) > I get the race report on flag and *don't* get a race report on > shared_data. > I.e. the annotations ANNOTATE_HAPPENS_BEFORE/AFTER work as expected. Sure, I wasn't obtaining a race on shared_data in any of the tools, IIRC. So in that sense the HB/HA annotations are indeed working. >> Q2: Is there a way to correctly annotate the store/load pair, ideally across all three tools? Or for helgrind am I stuck with suppressions? > > So, here you have two problems: > 1. Explain that Release_Store/Acquire_Load creates a happens-before > arc (you've done it right and it should work for all three) Right, that part was working for me all along. I don't recall receiving a race warning for "shared_data". My question in my original email was imprecise. > 2. Explain that the race on flag is benign. Yes, I afraid with current > helgrind you are stuck with suppressions. Julian? This is what I was more concerned about. For DRD and TSan it's easy to mark these as benign. However creating suppressions for a large library where this pattern occurs in many places is harder to do. I would be inclined to ditch Helgrind altogether because of this, but its lock-ordering checks are extremely helpful for me right now. Maybe I'll hack around it for now by changing the plain store to an atomic swap operation when building/running under valgrind. That ought to silence all three tools. Thanks, -Dave |