delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/07/24/10:50:59

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:subject:from:to:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=pYw
Dw0gBGrO5mnVOjuw3l+wN/CpYytvh3Cdg4CXVHH0/VBufSA6GhStXlywoX89M47g
6eXOYvutKYm1hkJrX50zrFTaEql7DpesB3t4EsmEl0mrw8zBTKlWoc3+45ZcG//Q
DwWqGbrJvB/WxChclEkH00gWzdcuxaZr71LeJfuY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:subject:from:to:mime-version
:content-type:content-transfer-encoding; s=default; bh=D1Od/S3K0
Mu3I3kIxi5uXPWs3Xw=; b=JQ+7oxIY4ikwf6TU0DcDoIzxWyu+iOv1NfgmDft2/
wBKtcHLJq8tFqF/YwQPhaUe+XcKZs4i8TKMpMePAkwWkr3c9tPyOAq2TaOdLKYsu
MuT8m+Ol/ADeFXYjcwtwWAt0uvfnNyh5QzEU4ezSlCUkFPmfrSwQilEsn0Nb71SF
6g=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: lb3-smtp-cloud6.xs4all.net
Message-ID: <3ed419ccba56059cbd336b192df7d844.squirrel@oude-webmail.xs4all.nl>
Date: Fri, 24 Jul 2015 16:50:37 +0200
Subject: Ok, just a request for explanation/clarification then ...
From: "Houder" <houder AT xs4all DOT nl>
To: cygwin AT cygwin DOT com
User-Agent: SquirrelMail/1.4.22
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019