Open tavianator opened 6 months ago
I'm guessing what's happening is tsan wants to defer the signal handler until after the atomic op, but then this line in FreeBSD's threading library calls memcpy()
: https://github.com/freebsd/freebsd-src/blob/75529910f77a1623b83599de0518d39c5fb789df/lib/libthr/thread/thr_sig.c#L310.
This is after the actual signal handler has been invoked, but before sigreturn()
. memcpy()
is intercepted and the tsan runtime thinks now would be a good time to run the deferred signal handler, except we're still in the actual signal handler that interrupted __tsan_atomic64_store()
, and it deadlocks.
I had to kill it from another terminal. GDB gives this stack trace: