
17 Oct
2019
17 Oct
'19
7:53 p.m.
The fork'd child process inherits all signal handlers from the parent. These handlers may no longer be valid since we are mass-closing all file descriptors. We thus need to kill off all the signal handlers in the forkd child.
There's a window between fork & sigaction where signals can still get delivered to the child & run the undesirable handlers. So we must mask all signals immediately before fork, only unmasking them after we have set all signal handlers back to their defaults.
We just need to set SIGPIPE to a dummy no-op handler before this unmask
If do that, i think the SIGPIPE ignored code before running hooks in virExec() can be removed. --- Best wishes Wang Yechao