[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#832593: apt-listbugs: Ctrl-C is not handled correctly



On Fri, 29 Jul 2016 00:41:47 +0200 Vincent Lefevre wrote:

> On 2016-07-28 22:48:54 +0200, Francesco Poli wrote:
> > This was somewhat intended: hitting [Ctrl-C] was supposed to interrupt
> > the bug report retrieval, while giving the user a chance to decide what
> > to do (retry and/or aborting and/or going on with the
> > installation/upgrade)...
> 
> So, apt-listbugs traps SIGINT.

Yes, it does.

> 
> > > but apt-listbugs is still running and attached to the terminal:
> > > 
> > > UID        PID  PPID  C STIME TTY          TIME CMD
> > > root       702   701  1 12:36 pts/6    00:00:00 /usr/bin/ruby /usr/sbin/apt-listbugs apt
> > 
> > ... this is instead unexpected!
> > I managed to reproduce the misbehavior, but I have no idea why it
> > happens.   :-(
> > 
> > The shell prompt should not reappear, while apt-listbugs is still
> > running!
> 
> Perhaps a problem on how SIGINT is handled, similar to what is
> described here if /bin/sh is involved somewhere:
> 
>   https://www.cons.org/cracauer/sigint.html
> 
> I suspect that some process (aptitude or a descendant) runs
> apt-listbugs with system(), which is based on /bin/sh

I noticed that the bug may be reproduced only when apt-listbugs is
invoked by a package manager (such as aptitude or apt or ...).

On the other hand, when apt-listbugs is invoked directly by the user,
as in:

  $ apt-listbugs list -s all aptitude

the bug is not triggered.

Hence, I am suspecting that the misbehavior has something to do with
the way the package manager invokes its hooks...

> , thus
> dash in most cases. So, it could be a consequence of this bug:
> 
>   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683671

Maybe, but I performed the following test:

  # cd /bin
  # ln -sf bash sh

and then I tried to reproduce the bug (with apt-listbugs invoked by
aptitude).
I was again able to reproduce the misbehavior, although dash was not
involved, as far as I can tell...

So I am more and more puzzled.


I am Cc-ing the APT Development Team: could any of you take a look at
bug #832593, please?
Any ideas on why a hook that traps SIGINT runs into troubles, when it
catches such signal, but does not immediately exit?

Please let me know, thanks a lot for your time and patience.



-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpcfsLpPTE4P.pgp
Description: PGP signature


Reply to: