Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Combination of pipes and &! leaks file descriptors



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: forkleak.sh
Description: application/shellscript

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

V2l0aCB0aGVgZGlzb3duYCBrZXl3b3JkOgoxYzEKPCBmb3JrbGVhay4gMjcwNjYgZXh6b21iaWUg
ICAxN3IgIEZJRk8gICAgICAgICAgICAgICAwLDEwICAgICAgMHQwICAxOTg4ODE5IHBpcGUgMjcw
NjcsZm9ya2xlYWsuLDF3IDI3MDY5LGdyZXAsMXcKLS0tCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9t
YmllICAgMTdyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4OTA5MSBwaXBl
IDI3MDkyLGZvcmtsZWFrLiwxdyAyNzA5NCxncmVwLDF3CgpXaXRoIHRoZSBgJiFgIG9wZXJhdG9y
OgoxYzEsMTEKPCBmb3JrbGVhay4gMjcwNjYgZXh6b21iaWUgICAxN3IgIEZJRk8gICAgICAgICAg
ICAgICAwLDEwICAgICAgMHQwICAxOTg4ODE5IHBpcGUgMjcwNjcsZm9ya2xlYWsuLDF3IDI3MDY5
LGdyZXAsMXcKLS0tCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMTdyICBGSUZPICAgICAg
ICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4MzE4NiBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4
em9tYmllICAgMThyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4ODAxMCBw
aXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMTlyICBGSUZPICAgICAgICAgICAgICAg
MCwxMCAgICAgIDB0MCAgMTk4ODAxMyBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAg
MjByICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4ODAxNiBwaXBlCj4gZm9y
a2xlYWsuIDI3MDY2IGV4em9tYmllICAgMjFyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAg
IDB0MCAgMTk4ODAxOSBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMjJyICBGSUZP
ICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4ODAyMiBwaXBlCj4gZm9ya2xlYWsuIDI3
MDY2IGV4em9tYmllICAgMjNyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4
ODAyNSBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMjRyICBGSUZPICAgICAgICAg
ICAgICAgMCwxMCAgICAgIDB0MCAgMTk4MzE4OSBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9t
YmllICAgMjVyICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4MzE5MSBwaXBl
Cj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMjZyICBGSUZPICAgICAgICAgICAgICAgMCwx
MCAgICAgIDB0MCAgMTk4ODAzMCBwaXBlCj4gZm9ya2xlYWsuIDI3MDY2IGV4em9tYmllICAgMjdy
ICBGSUZPICAgICAgICAgICAgICAgMCwxMCAgICAgIDB0MCAgMTk4MzI0MiBwaXBlIDI3MTE3LGZv
cmtsZWFrLiwxdyAyNzExOSxncmVwLDF3Cg==

Attachment: pgp8WK_1HiqgB.pgp
Description: OpenPGP digital signature



Messages sorted by: Reverse Date, Date, Thread, Author