Bug 72484 - valgrind leaves it's own signal mask in place when execing
Summary: valgrind leaves it's own signal mask in place when execing
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 2.1 CVS
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Fitzhardinge
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-12 16:13 UTC by Tom Hughes
Modified: 2004-01-16 03:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to restore the target's signal mask on exec (730 bytes, patch)
2004-01-12 16:14 UTC, Tom Hughes
Details
Updated version of signal mask patch (684 bytes, patch)
2004-01-12 16:47 UTC, Tom Hughes
Details

Note You need to log in before you can comment on or make changes to this bug.
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.