[PATCH] D35704: added reset feature to dfsan

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:33:34 PDT 2017


kcc added inline comments.


================
Comment at: lib/dfsan/dfsan.cc:179
+  // reset label count
+  atomic_store(&__dfsan_last_label, 0, memory_order_relaxed);
+}
----------------
farahhariri wrote:
> kcc wrote:
> > Add some code to check-fail in case __dfsan_last_label has changed (i.e. to check that no other threads are messing around)
> > 
> > Then, add a test with threads that will trigger that check-fail.
> > Then, add a test with threads that will trigger that check-fail.
> 
> That means I will have to add a flaky test that sometimes passes and sometimes fails.
> I cannot guarantee that the scheduler will switch context between the atomic store and 
> the check-fail to another thread, and then switch back to the check-fail. That's the only
> way to guarantee it will fail..
You can create a test that runs a very long loop in a thread and thus guarantee that the test will crash 9999999999999999 our of 100000000000000 times. 


https://reviews.llvm.org/D35704





More information about the llvm-commits mailing list