[libvirt] [PATCH] Ignore SIGWINCH in remote client call to poll(2) (RHBZ#567931).

Paolo Bonzini pbonzini at redhat.com
Wed Feb 24 14:39:20 UTC 2010


On 02/24/2010 02:06 PM, Richard W.M. Jones wrote:
> The correct solution is to mask out SIGWINCH for the duration
> of the poll(2) system call.  The per-thread mask is changed and
> restored immediately after the call.  Since we are using
> pthread_sigmask, this should not affect other threads, and
> since we restore the signal mask immediately afterwards it should
> not affect the current thread visibly either.

This is interesting.  No signal handler will necessarily do things like 
longjmp-ing out of the remote driver, so every signal could give rise to 
a similar bug.

In particular, SIGCHLD would be an obvious candidate for being handled 
the same way, since both SIGWINCH and SIGCHLD are default-ignored 
signals.  On the other hand, while for SIGWINCH it would be mostly 
harmless(*), for SIGCHLD it would leave a zombie until the remote 
libvirtd answers.  Any ideas?

    (*) Unless you have more than one thread using curses, and a thread
    other than the one calling libvirt has blocked SIGWINCH.

Paolo




More information about the libvir-list mailing list