[PATCH] D35704: added reset feature to dfsan

Farah Hariri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:27:44 PDT 2017


farahhariri added inline comments.


================
Comment at: lib/dfsan/dfsan.cc:179
+  // reset label count
+  atomic_store(&__dfsan_last_label, 0, memory_order_relaxed);
+}
----------------
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..


https://reviews.llvm.org/D35704





More information about the llvm-commits mailing list