[PATCH] D67738: [lsan] Fix deadlock in dl_iterate_phdr.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 18:41:27 PDT 2019


hctim accepted this revision.
hctim added inline comments.
This revision is now accepted and ready to land.


================
Comment at: compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp:5
+
+#include <link.h>
+#include <stdlib.h>
----------------
Nit: order includes


================
Comment at: compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp:13
+
+int cb(struct dl_phdr_info *info, size_t size, void *data) {
+  bool first = true;
----------------
nit: `int Callback`


================
Comment at: compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp:20
+
+    if (first)
+      in.unlock();
----------------
nit: replace with `if (step == 0)`


================
Comment at: compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp:32
+void Watchdog() {
+  // This is just a fail-safe to turn a deadlock (in case the bug reappears) into a (slow) test failure.
+  usleep(10000000);
----------------
Nit: 80chars


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67738





More information about the llvm-commits mailing list