When an error is printed, valgrind remembers the tid of the thread. Only when the tid is different it prints a message about the current thread. But new threads reuse free tids immediately (like file descriptors). It would be better to either change the allocation order of tids, or to remember a generation number and compare that also. In combination with threadnames introduced by bug #322254, that gives a better output. Reproducible: Always
Created attachment 81066 [details] Testcase that shows current behaviour of not printing thread tid This testcase shows that the in the second thread reusing tid=2 no new "Thread 2:" line is printed.