delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/05/04/03:20:02

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BG,TW_BH,TW_BK,TW_BL,TW_BX,TW_EG,TW_IB,TW_KR,TW_YG
X-Spam-Check-By: sourceware.org
Authentication-Results: mailgw7.ericsson.se x-tls.subject="/CN=esessmw0237"; auth=fail (cipher=AES128-SHA)
From: Rob Burgers <rob DOT burgers AT ericsson DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Date: Fri, 4 May 2012 09:19:27 +0200
Subject: 1.7.13/1.7.14: Issue with command prompt not returning when forking process
Message-ID: <A1960FFE0F9B444B8512E826965B70763A934CE004@ESESSCMS0362.eemea.ericsson.se>
MIME-Version: 1.0
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q447JvJn001602

Hi,

I am having trouble with a not returning command prompt after termination of a process when this process forked another process. In such case the return of the command prompt is bound to life time of the forked process i.e. when the forked process terminates the command prompt returns.

The problem seems to have appeared in more recent versions of Cygwin and appearing both on Vista and Windows 7. I do have systems with and without this problem.
All systems without the problem have either kernel version 1.7.9(0.237/5/3) 2011-03-29 10:10 or 1.7.10(0.259/5/3) 2012-02-05 12:36
All systems showing the problem have either kernel version 1.7.13(0.260/5/3) 2012-04-05 12:43 or 1.7.14(0.260/5/3) 2012-04-24 17:22

The attached test application demonstrates the issue. By running "java Launcher" java process is started, which itself forks another java process. This second process runs for 2 minutes until it terminates. On systems without the problem the command prompt returns immediately, whereas on troubled systems it takes 2 minutes to return.
Running the same command from a dos prompt causes the command prompt to return immediately.

Running "ps" on a troubled system while waiting for the prompt to return still shows the java process running the Launcher, while the Windows task-manager and resource monitor do longer show this process (but only the Server).

A system originally not showing this issue, started showing the issue when new packages (openssh, rsync, libxslt and unzip) were installed. As part of this the kernel version was updated from 1.7.10 to 1.7.14. Removal of those packages had no effect on the problem; the kernel version remained at 1.7.14.

Test application
% javac *.java
% java Launcher
=======================
Lancher.java
-----------------------
public class Launcher {
  public static void main(String[] args) throws Exception {
    System.out.println("Launching Server");
    Runtime.getRuntime().exec(new String[] { "javaw", "Server" });
    System.out.println("Launched Server");
}}
=======================
Server.java
-----------------------
public class Server {
  public static void main(String[] args) throws Exception { 
    System.out.println("Started: " + Server.class.getName());
    Thread.sleep(120000);
}}
=======================

% uname -srv
CYGWIN_NT-6.0 1.7.14(0.260/5/3) 2012-04-25 09:41

% cygcheck -cd
Cygwin Package Information
Package              Version
_autorebase          000050-1
_update-info-dir     01046-1
alternatives         1.3.30c-10
base-cygwin          3.1-1
base-files           4.1-1
bash                 4.1.10-4
bzip2                1.0.6-2
coreutils            8.15-1
crypt                1.1-1
csih                 0.9.6-1
cygrunsrv            1.40-2
cygutils             1.4.10-2
cygwin               1.7.14-2
cygwin-doc           1.7-1
dash                 0.5.7-1
diffutils            3.2-1
dos2unix             5.3.3-1
editrights           1.01-2
file                 5.11-1
findutils            4.5.9-2
gawk                 4.0.1-1
gettext              0.18.1.1-2
grep                 2.6.3-1
groff                1.21-2
gzip                 1.4-1
ipc-utils            1.0-1
less                 444-1
libasn1_8            1.5.2-2
libattr1             2.4.43-1
libbz2_1             1.0.6-2
libcom_err2          1.41.14-1
libedit0             20090923-1
libgcc1              4.5.3-3
libgcrypt11          1.4.6-1
libgmp3              4.3.2-1
libgpg-error0        1.10-1
libgssapi3           1.5.2-2
libheimbase1         1.5.2-2
libheimntlm0         1.5.2-2
libhx509_5           1.5.2-2
libiconv2            1.14-2
libintl8             0.18.1.1-2
libkafs0             1.5.2-2
libkrb5_26           1.5.2-2
liblzma5             5.0.2_20110517-1
libncurses10         5.7-18
libncursesw10        5.7-18
libopenssl100        1.0.1b-2
libpcre0             8.21-2
libpopt0             1.6.4-4
libreadline7         6.1.2-2
libroken18           1.5.2-2
libsigsegv2          2.10-1
libsqlite3_0         3.7.3-1
libssp0              4.5.3-3
libstdc++6           4.5.3-3
libwind0             1.5.2-2
libwrap0             7.6-21
libxml2              2.7.8-3
libxslt              1.1.26-3
login                1.10-10
man                  1.6g-1
mintty               1.0.3-1
openssh              6.0p1-1
rebase               4.1.0-1
rsync                3.0.9-1
run                  1.1.13-1
sed                  4.2.1-1
tar                  1.25-1
terminfo             5.7_20091114-14
texinfo              4.13-4
tzcode               2012b-1
unzip                6.0-10
which                2.20-2
xz                   5.0.2_20110517-1
zlib0                1.2.5-1


Best regards,
Rob Burgers


--
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