[PATCH] D95184: [ASan] Stop blocking child thread progress from parent thread in `pthread_create` interceptor.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 20:55:38 PST 2021


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:1141
+  // started.
+  if (atctx->status != ThreadStatusCreated || !asanThread)
+    return;
----------------
if we at asan_thread.cpp:260 arg is still invisible to lsan, and we can report false leak. So ThreadStatusRunning should be covered as well.


================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:1152-1167
+  // Add chunk to frontier and mark it as reachable.
+  Frontier *frontier = reinterpret_cast<Frontier *>(arg);
+  frontier->push_back(chunk);
+  LsanMetadata m(chunk);
+  m.set_tag(kReachable);
+
+  // __lsan::flags() has to be guarded by this macro because it uses data that
----------------
I would prefer we keep this logic in lsan


================
Comment at: compiler-rt/lib/asan/asan_interceptors.cpp:224
+    result = REAL(pthread_create)(thread, attr, asan_thread_start, t);
   }
   return result;
----------------
if (result != 0) {
   // destroy t;
}



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95184



More information about the llvm-commits mailing list