On Fri, Oct 13, 2006 at 03:50:46PM -0700, Damon Buckwalter <[EMAIL PROTECTED]> 
was heard to say:
> Package: aptitude
> Version: 0.4.3-1
> Severity: important
> 
> 
> I've seen this problem repeatedly over time and found work of another
> that describes the symptoms:
> 
> http://lists.debian.org/debian-user/2006/07/msg00465.html
> 
> To sum up, in the aptitude source at src/vscreen/vscreen.cc:779
> 
>  // Block WINCH so the signal_thread can pick it up.
>    sigset_t signals;
>    sigemptyset(&signals);
>    sigaddset(&signals, SIGWINCH);
>    sigprocmask(SIG_BLOCK, &signals, NULL);
> 
> This causes processes installed to inherit the signal mask.  As
> mentioned in the mailing list post linked above, the classic
> manifestation of this in sshd and screen/mutt/top/etc.  Installing a new
> version of SSHd from aptitude leaves SIGWINCH blocked in the sshd
> process, making terminal resizes ignored from within curses-type
> applications.
> 
> I am not an expert (nor have I found the code or time to work on a
> patch), but conceptually it seems the per-thread sig mask needs to block
> SIGWINCH for all threads except the one that handles it.  I know that
> there's got to be some weirdness in the process/thread mixed world.
> 
> This is the article I'm basing my ideas on:
> 
> http://www.linuxjournal.com/article/2121

  Thanks for bringing this to my attention.  This is rather surprising
behavior, but I guess it's well-established.  (annoyingly, the fork()
manpage doesn't mention that signal masks are inherited; you need to
read the libc manual to find this out)

  BTW, that article dates to 1997 and probably is only useful for general
principles -- I'm pretty sure that Linux's threading architecture has been
rewritten at least once since then.

  It looks like unblocking the signal in the thread that exec()s dpkg
will work for now.  I think an ideal option would be to reset the signal
mask between fork() and exec(), but that would require cooperation from
libapt, since I don't actually execute the dpkg sub-process myself.
See also bug #214141.

  Daniel

Attachment: signature.asc
Description: Digital signature

Reply via email to