[PATCH] D18132: [tsan] Detect uses of uninitialized, destroyed and invalid mutexes

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 05:57:28 PDT 2016


dvyukov accepted this revision.
dvyukov added a comment.
This revision is now accepted and ready to land.

LGTM

My only concern is that some pthread implementations will not detect this bug and the test will fail. But I guess the bots will tell.

We probably could do the same check in pthread_mutex_destroy. But FWIW my implementation does not detect double-destroy.

This show a flaw in the interceptors. If a mutex function fails, we don't execute COMMON_INTERCEPTOR_MUTEX_LOCK/DESTROY and don't catch use-after-free on mutex accesses. Always emulating the memory access is probably the right thing to do (esp for asan).


http://reviews.llvm.org/D18132





More information about the llvm-commits mailing list