On 10/15/19 9:25 PM, Wang Yechao wrote:
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal
handlers to the defaults. But child process may write logs to
stderr/stdout, that may generate SIGPIPE if journald has stopped.
So block SIGPIPE in virFork, and unblock it before execve.
How does that help? If writing to stderr hits EOF, it will queue up a
SIGPIPE to be delivered as soon as you unblock SIGPIPE.
The correct fix is to not unblock SIGPIPE until after any point at which
you would be performing I/O that must not fail due to SIGPIPE, rather
than messing with signal masks to just delay when SIGPIPE is delivered.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org