zsh-workers
 help / color / mirror / code / Atom feed
From: Jure Varlec <jure@varlec.si>
To: zsh-workers@zsh.org
Subject: Combination of pipes and &! leaks file descriptors
Date: Tue, 2 May 2017 16:19:25 +0200	[thread overview]
Message-ID: <20170502161925.03e9f794@leopold.lan> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 542 bytes --]

Hello,

I noticed a file descriptor leak today in a script that was forking
jobs in a loop and ceased to work after 1000 jobs. A (quick, admittedly)
search of the mailing list found nothing relevant. A minimal example is
attached, using `lsof` to demonstrate the problem. I also attached its
output in case there are difficulties reproducing the problem. It is
interesting to see that only the `&!` operator causes the problem, the
`disown` command does not. A pipe needs to be present in the
backgrounded command.

Regards
Jure

[-- Attachment #1.2: forkleak.sh --]
[-- Type: application/x-shellscript, Size: 422 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 1898 bytes --]

Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=forkleak.out

V2l0aCB0aGVgZGlzb3duYCBrZXl3b3JkOgoxYzEKPCBmb3JrbGVhay4gMjcwNjYgZXh6b21iaWUg
ICAxN3IgIEZJRk8gICAgICAgICAgICAgICAwLDEwICAgICAgMHQwICAxOTg4ODE5IHBpcGUgMjcw
NjcsZm9ya2xlYWsuLDF3IDI3MDY5LGdyZXAsMXcKLS0tCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9t
YmllICAgMTdyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4OTA5MSBwaXBl
IDI3MDkyLGZvcmtsZWFrLiwxdyAyNzA5NCxncmVwLDF3CgpXaXRoIHRoZSBgJiFgIG9wZXJhdG9y
OgoxYzEsMTEKPCBmb3JrbGVhay4gMjcwNjYgZXh6b21iaWUgICAxN3IgIEZJRk8gICAgICAgICAg
ICAgICAwLDEwICAgICAgMHQwICAxOTg4ODE5IHBpcGUgMjcwNjcsZm9ya2xlYWsuLDF3IDI3MDY5
LGdyZXAsMXcKLS0tCj4gZm9ya2xlYWsuIDI3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ZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4MzI0MiBwaXBlIDI3MTE3LGZv
cmtsZWFrLiwxdyAyNzExOSxncmVwLDF3Cg==

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2017-05-02 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170502142014epcas2p3a442db31cf0a8c28b27e89a4cf188e10@epcas2p3.samsung.com>
2017-05-02 14:19 ` Jure Varlec [this message]
2017-05-03 10:04   ` Peter Stephenson

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=20170502161925.03e9f794@leopold.lan \
    --to=jure@varlec.si \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).