This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bash process remains after I close rxvt in certain ways


On Dec  6 03:57, Charles Wilson wrote:
> [nothin' like resurrecting a month-old thread...]
> 
> Christopher Faylor wrote:
> 
> >This is handled in dcrt0.cc:do_exit().  I'm wondering if rxvt is not
> >dealing with the SIGHUP that cygwin should be sending to it on
> >CTRL_CLOSE, though.
> 
> Well, rxvt *does* respond to SIGHUP:
> 
> $ ps -eaf # output snipped
>  cwilson    3796       1 con  01:22:47 /usr/bin/rxvt
>  cwilson     392    3796   3  01:22:47 /usr/bin/bash
> 
> $ kill -HUP 3796
> 
> $ ps -eaf # output snipped
>  cwilson     392       1   3  01:22:47 /usr/bin/bash
> 
> but leaves behind a zombified bash.  Further, because rxvt is compiled 
> as a console app, Windows does not send a WM_CLOSE message when you 
> press Alt-F4 or click the 'x' button: for console apps it sends a 
> CTRL_CLOSE_EVENT, which is intercepted by cygwin and translated into 
> SIGHUP -- so my discussion here:
> http://cygwin.com/ml/cygwin/2006-11/msg00312.html

I just debugged this a little bit purely from the Cygwin perspective and
I found that Cygwin does not get a CTRL_CLOSE_EVENT when you press the X
button of the rxvt window or press Alt-F4.  The explanation for the
orphaned shell must be a bit more tricky.

When running strace, I'm wondering about the below when, for instance,
Alt-F4 is pressed:

   24 1990559 [main] rxvt 3748 kill_pgrp: pid 3748, signal -1
   [...]
   31 1991910 [main] rxvt 3748 __set_errno: int kill_pgrp(pid_t, siginfo_t&):314 val 3
   23 1991933 [main] rxvt 3748 kill_pgrp: -1 = kill (3748, -1)

So, what happens is that rxvt only tries to kill its own process group.
This won't kill the shell which is the process group leader of its own
process group. 

So there's something missing in the picture here...  What does happen in
rxvt when Alt-F4 is pressed.  Nothing?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]