Bug 324227

Summary: memcheck false positive leak when a thread calls exit+block only reachable via other thread live register
Product: [Developer tools] valgrind Reporter: Philippe Waroquiers <philippe.waroquiers>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: philippe.waroquiers
Priority: NOR    
Version: 3.9.0.SVN   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: uses VgSrc_ExitProcess (that was not used anymore) for marking live threads for sys_exit_group

Description Philippe Waroquiers 2013-08-29 15:59:14 UTC
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.
Comment 1 Philippe Waroquiers 2013-08-29 16:00:33 UTC
Created attachment 82011 [details]
uses VgSrc_ExitProcess (that was not used anymore) for marking live threads for sys_exit_group
Comment 2 Philippe Waroquiers 2013-10-21 19:57:41 UTC
Fixed in revision 13670