[libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process
Eric Blake
eblake at redhat.com
Wed Oct 16 02:43:58 UTC 2019
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
More information about the libvir-list
mailing list