public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Erik Bray <erik.m.bray@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Problem with zombie processes
Date: Fri, 17 Feb 2017 11:00:00 -0000	[thread overview]
Message-ID: <CAOTD34Z7VM=6=Ss_gCLS97c4sFNpnaT-+RgJq+xme-VyWYbbpw@mail.gmail.com> (raw)
In-Reply-To: <58A3598F.2020405@maxrnd.com>

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

On Tue, Feb 14, 2017 at 8:25 PM, Mark Geisert <mark@maxrnd.com> wrote:
> Erik Bray wrote:
>>
>> The attached Python script
>
>
> ??

D'oh!  Here is the script.  It at least demonstrates the problem.

[-- Attachment #2: test.py --]
[-- Type: application/octet-stream, Size: 594 bytes --]

from __future__ import print_function
import os
import subprocess as sp
devnul = open(os.devnull, 'r+')
print("Test 1: stdout piped to parent")
p = sp.Popen(['yes'], stdout=sp.PIPE)
print("child pid: %d" % p.pid)
print("sending SIGKILL")
p.send_signal(9)
stat = '/proc/%d/stat' % p.pid
print("reading", stat)
print(open(stat).read())
p.wait()

print("=" * 80)

print("Test 2: stdout piped to /dev/null")
p = sp.Popen(['yes'], stdout=devnul)
print("child pid: %d" % p.pid)
print("killing")
p.send_signal(9)
stat = '/proc/%d/stat' % p.pid
print("reading", stat)
print(open(stat).read())
p.wait()

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


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

  reply	other threads:[~2017-02-17 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 11:14 Erik Bray
2017-02-14 19:25 ` Mark Geisert
2017-02-17 11:00   ` Erik Bray [this message]
2017-02-17 15:06     ` Doug Henderson
2017-02-17 22:06     ` Mark Geisert
2017-02-20  9:46       ` Erik Bray
2017-02-20 10:54         ` Mark Geisert
2017-02-20 15:23           ` Erik Bray
2017-02-20 22:54             ` Mark Geisert
2017-02-21 11:59               ` Erik Bray
2019-04-04 12:44                 ` E. Madison Bray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOTD34Z7VM=6=Ss_gCLS97c4sFNpnaT-+RgJq+xme-VyWYbbpw@mail.gmail.com' \
    --to=erik.m.bray@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).