Closed jktjkt closed 1 year ago
How come you have discovered it only now? Also, adding an option just cause a diagnostic tool is faulty does not seem right, I have always been against over-reliance on these tools. But I suppose I would let this slide. Perhaps the C flags could be examined for the TSAN flag instead of the option.
How come you have discovered it only now?
Recently TSAN changed their internal implementation from runtime v2 to runtime v3. Or it could be a glibc difference, I don't know.
Also, adding an option just cause a diagnostic tool is faulty does not seem right, I have always been against over-reliance on these tools.
We've reported quite a few real bugs with these, both in the libyang/sysrepo/libnetconf2/netopeer2 stack, in external libraries and in our code. I would be very unhappy if we lost access to a tool that is very useful.
But I suppose I would let this slide. Perhaps the C flags could be examined for the TSAN flag instead of the option.
Sure, I can do it that way if that's what you prefer. I was thinking that explicit is better than implicit here, but it's your call.
Sure, I can do it that way if that's what you prefer. I was thinking that explicit is better than implicit here, but it's your call.
Please do, there is enough options as it is.
Sure, I can do it that way if that's what you prefer. I was thinking that explicit is better than implicit here, but it's your call.
Please do, there is enough options as it is.
Done.
As per the docs, the SIGEV_THREAD sigevent option instructs the kernel to create a thread in this process when that timer expires (in fact this is done by the C library, and the kernel "just" wakes up that thread AFAICT). However, this newly created thread appears to have completely bypassed TSAN, and when the just-created thread hits any TSAN interceptor which assumes that some per-thread TSAN structures have been already set up, the application segfaults (for example like this):
That's with the latest clang, or, in another case, with GCC:
I have no clue on how to fix this properly within TSAN.
Bug: https://github.com/google/sanitizers/issues/1612