[PATCH] D21609: [tsan] Intercept libcxx __release_shared to avoid false positive with weak_ptrs and destructors in C++

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 02:46:00 PDT 2016


dvyukov added a comment.

I can't make my mind. I well understand that saying users "build your own tsan-instrumented libcxx" is close to having no answer at all. So I guess if that's the solution you want to maintain, I am OK with it.

Does it make sense to add a runtime flag that turns the interceptor off for emergency cases?

Also please document all alternatives that we've considered and why they don't work.

I would also write some kind of a stress test that creates/destroys shared_ptrs from different threads and takes/releases strong/weak references.

One other alternative is to insert empty non-inlinable hook functions into libcxx so that tsan can intercept them. But that will slow down normal execution, so I guess people will complain.


http://reviews.llvm.org/D21609





More information about the llvm-commits mailing list