Bug 72484

Summary: valgrind leaves it's own signal mask in place when execing
Product: [Developer tools] valgrind Reporter: Tom Hughes <tom>
Component: generalAssignee: Jeremy Fitzhardinge <jeremy>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.1 CVS   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch to restore the target's signal mask on exec
Updated version of signal mask patch

Description Tom Hughes 2004-01-12 16:13:53 UTC
If a process run under a valgrind does an exec then valgrind leaves it's own
signal mask in place regardless of whether or not it is going to be tracing the
new program. This is wrong as POSIX says that the signal mask is preserved on
exec  so the new program is entitled to expect the signal mask that the target
program being run by valgrind had.
Comment 1 Tom Hughes 2004-01-12 16:14:31 UTC
Created attachment 4122 [details]
Patch to restore the target's signal mask on exec
Comment 2 Tom Hughes 2004-01-12 16:47:00 UTC
Created attachment 4123 [details]
Updated version of signal mask patch

It was a mistake to make the restoration of the signal mask condition on the
value of VG_(clo_trace_children) as we always want to do it - the new valgrind
instance will then apply the mask to the traced target if we are tracing
children.
Comment 3 Jeremy Fitzhardinge 2004-01-16 03:18:21 UTC
Fixed in CVS.  The change also needs to clear the pending signal set before setting the signal mask, so we don't get any unexpected signals before the exec.  There's still a race if a new signal appears in that window.