[PATCH] [dfsan] Add custom function for pthread_create.

Peter Collingbourne peter at pcc.me.uk
Tue Aug 27 14:41:06 PDT 2013



================
Comment at: lib/dfsan/dfsan_custom.cc:285
@@ +284,3 @@
+  free(p);
+  dfsan_label ret_label;
+  return pci.start_routine_trampoline(pci.start_routine, pci.arg, 0,
----------------
Evgeniy Stepanov wrote:
> I'm slightly confused. This would be the label for the thread return value, right? Don't you need to keep it somewhere for pthread_join()?
I think that propagating labels through pthread_create and pthread_join can be done in a separate change.  But for now I am fixing the more fundamental bug that the pthread_create callback argument can receive an invalid nonzero label due to an ABI mismatch.

================
Comment at: lib/dfsan/lit_tests/custom.c:138
@@ +137,3 @@
+  pthread_join(pt, &cbrv);
+  assert(cbrv == (void *)2);
+
----------------
Evgeniy Stepanov wrote:
> You are not testing any label-passing behavior of pthread_create() at all.
I now test that the argument is unlabelled.


http://llvm-reviews.chandlerc.com/D1504



More information about the llvm-commits mailing list