Valgrind implements exit (i.e. the syscall sys_exit_group) by terminating all threads.
This means registers in the threads that are not calling exit are not considered by the
leak search, which can lead to false positive leak.
See discussion in http://sourceforge.net/mailarchive/message.php?msg_id=31265957
Attached patch solves the problem by changing the way sys_exit_group is implemented,
ensuring the other live threads are marked specially for the leak search to still consider
the registers of the non_exiting threads. Note that the stack of these threads were already
considered by the leak search.
Created attachment 82011 [details]
uses VgSrc_ExitProcess (that was not used anymore) for marking live threads for sys_exit_group
Fixed in revision 13670