[PATCH] D39619: Correct atexit(3) support in TSan/NetBSD

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 08:42:39 PST 2017


On Wed, Nov 8, 2017 at 5:29 PM, Kamil Rytarowski via Phabricator
<reviews at reviews.llvm.org> wrote:
> krytarowski added a comment.
>
> Thanks for review, I will commit it tonight!
>
> The remaining problems with TSan/NetBSD:
>
> - Mutex tracking is broken, they seem to be not registered (in ScopedReport::AddMemoryAccess we always get mset->Size() equal to 0)


This is strange.
If pthread_mutex/spinlock, etc interceptors work, then it should be
enough for mset's to work. The interceptors call
MutexPre/PostLock/Unlock and from that point everything is
platform-independent.



> - Thread Deatch and Thread Joined can race and assert that they go in the wrong order (we destroy a thread before marking it Finished)

That's probably because we now call ThreadFinish too late (from
_lwp_exit), and at that point pthread_join for this thread has already
returned.
For pthread_join maybe we could wait for _lwp_exit completion before
calling ThreadJoin.
Not yet sure what to do for detach.


>
> Less important ones:
>
> - setjmp/longjmp unimplemented for NetBSD
> - StartBackgroundThread() is not executed (need to be deferred)
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D39619
>
>
>


More information about the llvm-commits mailing list