[PATCH] D54889: Fiber support for thread sanitizer

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 08:24:45 PST 2018


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_rtl_thread.cc:62
   // Can't increment epoch w/o writing to the trace as well.
-  TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0);
+  TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0, false);
   ReleaseImpl(args->thr, 0, &sync);
----------------
args->thr is parent (current) thread (?), so why can't we use hacky call?


================
Comment at: lib/tsan/rtl/tsan_rtl_thread.cc:115
   // TraceAddEvent will reset stack0/mset0 in the new part for us.
-  TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0);
+  TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0, false);
 
----------------
I think we should execute start on the fiber itself. This is what we do for normal threads. This should resolve the hacky call problem (right?) and also prevent fibers from breaking in future.
We can do this either by briefly switching to the fiber context and back when we create a new fiber. Or, start it lazily on first switch.


================
Comment at: lib/tsan/rtl/tsan_rtl_thread.cc:138
     // Can't increment epoch w/o writing to the trace as well.
-    TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0);
+    TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0, false);
     ReleaseImpl(thr, 0, &sync);
----------------
Fibers created detached. How does it happen that fibers affect this?


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54889/new/

https://reviews.llvm.org/D54889





More information about the llvm-commits mailing list