ThreadSanitizer misses data races when you cross 255 threads
Data races and the limits of ThreadSanitizer in C and Go
ThreadSanitizer is the race detector behind Clang, GCC, Go, Swift, and OCaml, but it has blind spots. The author builds a Python interpreter for a C subset and a FastTrack-style race detector to show how TSan works, then demonstrates that it can fail to report races when more than 255 threads are involved—a common situation in Go web services with one goroutine per request. The article also covers a sync.Pool design that hides races between goroutines whose pooled objects hash to the same slot.
ThreadSanitizer cannot reliably report data races while crossing a 255 total thread boundary.