From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57429 invoked by alias); 30 Jan 2020 19:04:06 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 57413 invoked by uid 89); 30 Jan 2020 19:04:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=ppid, cygwins, cygwin's, H*c:alternative X-HELO: mail-ed1-f50.google.com Received: from mail-ed1-f50.google.com (HELO mail-ed1-f50.google.com) (209.85.208.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Jan 2020 19:04:04 +0000 Received: by mail-ed1-f50.google.com with SMTP id v28so4954001edw.12 for ; Thu, 30 Jan 2020 11:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=upp/73WEd3kShMwEQytLQDLK3GJu85U3e+vR5lGMZH8=; b=nWJwxf3XflnJtJbhafDGKkYdoV1fGzE5/Qj0PejUAmjKsl53Y3S8SYZrGF7ovJPYH+ 1/Eh2TZ4RJh6VZ3OebOJATYaLPIMjDAssSHwhhkQBf+npaj3wNRYqrbpQeEeATQqX7GR dS0PW0wcXeeTm/zfnT7Dkq0ZEwlFQEBMhYT/GBWsmncxAqhrYa3hRwRj8oZ5V+i3WOeI /dH+H+XIPnaetlYqh7EYxK26XEF7EJJkSeZMomzLlvp0wh8u8WF/EULz2eUdvJxXGH5C GCufipR1sUmsz3EQ2iuNws5zZ007/zWHgVJcoIoWvk+hUrzdTTkkWqkaauiCKWjV05Kc i4hA== MIME-Version: 1.0 From: Edward Lam Date: Thu, 30 Jan 2020 19:04:00 -0000 Message-ID: Subject: Pipes bug when spawning non-cygwin processes To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00315.txt.bz2 Hi Folks, I'm getting a problem where cygwin parent processes spawning non-cygwin child processes no longer detect when stdin has been closed. Please see the sample python code at the end where I've isolated the problem. I've got cygwin's python2 running spawn_bar.py that popen's a native non-cygwin python2 running bar.py. The steps to reproduce are to run this command using the two files detailed at the end of this email: $ python2 spawn_bar.py On Windows 10, this command quits right away as expected when using cygwin 3.0.7 but hangs when using cygwin 3.1.2 (version number as reported from running `cygcheck -c cygwin`). Looking through the release logs, nothing sticks out except for the change in 3.1.0 that mentions PTY changes. However, when I originally ran into this, it wasn't even being done through a terminal but some background script. Any ideas? Thanks, -Edward # spawn_bar.py import os import subprocess import sys python = "python2" # this works python = "/path/to/native/python2" # this hangs p = subprocess.Popen([python, 'bar.py'], stdin=subprocess.PIPE) p.stdin.close() pid, status = os.waitpid(p.pid, 0) # bar.py import sys for line in sys.stdin: print 'got: ' + line -- 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