Data race scenario:
Thread 1 | Thread 2
ReportTagMismatch() |
Call VisitAllLiveThreads() to scan all |
threads' ring buffers to find |
if it's a heap-use-after-free. |
Lock live_list_mutex_ |
| Thread 2 exit
| ReleaseThread() calls Thread::Destroy() for Thread 2,
| which frees heap alloctions ring buffer
| RemoveThreadFromLiveList() tries to take live_list_mutex_ again
Iterate the heap alloctions ring buffer |
of Thread 2, which is already freed |