[PATCH] D31883: Don't assume PTHREAD_CREATE_JOINABLE is 0 on all systems

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:26:36 PDT 2017


fjricci added inline comments.


================
Comment at: lib/lsan/lsan_interceptors.cc:289
+    int tid = ThreadCreate(GetCurrentThread(), *(uptr *)th,
+                           IsStateDetached(detached));
     CHECK_NE(tid, 0);
----------------
alekseyshl wrote:
> fjricci wrote:
> > alekseyshl wrote:
> > > fjricci wrote:
> > > > alekseyshl wrote:
> > > > > What about !SANITIZER_POSIX case? Who's going to provide this function?
> > > > Lots of other things in this function will also break in the !SANITIZER_POSIX case - pthread_attr_getdetachstate, pthread_create, etc. I don't think this file is currently designed to work at all in non-posix cases.
> > > Let's remove #if SANITIZER_POSIX around include then, it's misleading.
> > > 
> > > What about tsan_interceptors.cc? Is it also posix only?
> > Yeah, tsan is also posix only, and there is definitely quite a bit of posix-specific code in that file. Interestingly, they do use the SANITIZER_POSIX guard on the header inclusion in that file, perhaps for future-proofing?
> I don't know why. It's trivial to add back and in case of future changes, the failure is more explicit when there's no ifdef around the include.
Ok, sounds good. I'll remove it from the tsan file as well then, for consistency.


https://reviews.llvm.org/D31883





More information about the llvm-commits mailing list