This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Ok, just a request for explanation/clarification then ...
- From: "Houder" <houder at xs4all dot nl>
- To: cygwin at cygwin dot com
- Date: Fri, 24 Jul 2015 16:50:37 +0200
- Subject: Ok, just a request for explanation/clarification then ...
- Authentication-results: sourceware.org; auth=none
Hi Corinna,
I hesitate to ask ... yes, I am aware you have enough on your plate. If you cannot explain
the phenomenon from the top of your head, let it rest, please.
In an attempt to understand what needs to be "done" to mintty, I decided to use the "setsid"
utility (util-linux) to invoke mintty ...
This is what I do:
- invoke 'setsid mintty' from bash
... a new window opens
- terminate (i.c. exit) bash from the _original_ window
There are 2 possibilities to get a bash prompt:
1. 'a dos console (shortcut) in which mintty is started', and
2. 'a dos console in which bash is started'
Now in the FIRST case, if bash (the original window) is terminated (i.c. exit), the window
does NOT close, as if the 'first mintty' is waiting for bash (which is already a zombie).
Termination (i.c. exit) of bash in the SECOND case, does not only terminate bash, but also
closes the window !! (as expected)
Can you EXPLAIN (first case) why the 'first mintty' does not terminate ?????
Is it Cygwin? Is it Window?
(explain, i.e. not solve the bug, if it is one)
Henri
-----
Details:
1.
= dos console in which mintty is started
PATH (32)= /usr/local/bin:/usr/bin:/drv/c/...
Executing .bash_profile
Executing .bashrc, $- = himBH, login_shell on
@@ ps ax
PID PPID PGID WINPID TTY UID STIME COMMAND
2300 5000 2300 4588 pty0 1000 13:05:11 /usr/bin/ps
4976 1 4976 4976 ? 1000 13:05:02 /usr/bin/mintty-v113
5000 4976 5000 4992 pty0 1000 13:05:02 /usr/bin/bash
@@ setsid mintty-v113 # mintty should be able to manage this (i.e. w/o using setsid)
@@ exit
logout <==== mintty? (parent: explorer) waits ????? (i.e. window does not close)
... what is it waiting for? the zombie bash ????? (that process has gone
acc. to Windows) ... No, somehow the processes in the new window prevent
the 'first mintty' from terminating ...
View by Process Explorer:
explorer
mintty only option after bash has been terminated, is killing mintty (from the new window: kill -9 4976)
bash acc. to Cygwin a child of mintty
mintty <==== new window
bash
... new window
PATH (32)= /usr/local/bin:/usr/bin:/drv/c/WINDOWS/System32:/drv/c/WINDOWS:/drv/c/WINDOWS/System32/Wbem:/home/Henri/bin
Executing .bashrc, $- = himBH, login_shell off
@@ ps ax
PID PPID PGID WINPID TTY UID STIME COMMAND
4976 1 4976 4976 ? 1000 13:05:02 /usr/bin/mintty-v113 ... waiting? for what? (after
term. of bash)
I 5000 4976 5000 4992 pty0 1000 13:05:02 /usr/bin/bash <==== zombie (<defunct>) after exit
1844 400 1844 812 pty1 1000 13:05:25 /usr/bin/ps
400 2032 400 3848 pty1 1000 13:05:17 /usr/bin/bash
2032 1 2032 4308 ? 1000 13:05:17 /usr/bin/mintty-v113 <==== "new window"
@@ # now terminate bash in the original window
2.
= dos console in which bash is started
PATH (32)= /usr/local/bin:/usr/bin:/drv/c/...
Executing .bash_profile
Executing .bashrc, $- = himBH, login_shell on
@@ ps ax
PID PPID PGID WINPID TTY UID STIME COMMAND
4616 4648 4616 4336 cons0 1000 13:33:54 /usr/bin/ps
4648 1 4648 4648 cons0 1000 13:33:51 /usr/bin/bash
@@ setsid mintty-v113
@@ exit ... and yes, the window closes (as expected)
View by Process Explorer:
explorer
bash
mintty
bash acc. to Cygwin a child of mintty
... new window
PATH (32)= /usr/local/bin:/usr/bin:/drv/c/WINDOWS/System32:/drv/c/WINDOWS:/drv/c/WINDOWS/System32/Wbem:/home/Henri/bin
Executing .bashrc, $- = himBH, login_shell off
@@ ps ax
PID PPID PGID WINPID TTY UID STIME COMMAND
4152 1 4152 4720 ? 1000 13:34:07 /usr/bin/mintty-v113
I 4648 1 4648 4648 cons0 1000 13:33:51 /usr/bin/bash <==== gone! after exit
796 4152 796 988 pty0 1000 13:34:07 /usr/bin/bash
4484 796 4484 3388 pty0 1000 13:34:14 /usr/bin/ps
@@ # now terminate bash in the original window
@@ ps ax
PID PPID PGID WINPID TTY UID STIME COMMAND
4152 1 4152 4720 ? 1000 13:34:07 /usr/bin/mintty-v113
2644 796 2644 4680 pty0 1000 13:38:01 /usr/bin/ps
796 4152 796 988 pty0 1000 13:34:07 /usr/bin/bash
=====
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple