Bug 465455

Summary: zsh may hang when re-using PIDs
Product: Red Hat Enterprise Linux 5 Reporter: Tomas Smetana <tsmetana>
Component: zshAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: James Antill <james.antill>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: sghosh, syeghiay, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-06 15:31:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Tomas Smetana 2008-10-03 12:40:33 UTC
It may happen that with many processes one PID may appear in zsh's job table twice -- one marked as done.  In such a case zsh may not be able to pick the other process and mark it as done and would wait for it to finish forever. This would cause the zsh scripts to hang.

Much better explanation together with the patch can be found here:
http://www.zsh.org/cgi-bin/mla/wilma_hiliter/users/2008/msg00432.html

It may not be easy to reproduce the problem since this happens only with many processes being spawned and the PID numbers being reused.

Customer was hitting this bug and confirms that the patch provided in the mentioned mailing list post fixes the issue.

I was able to reproduce the bug once with the following script (from http://www.zsh.org/cgi-bin/mla/wilma_hiliter/users/2008/msg00431.html):

export IFS="\
" ;find -type d -not -name cur -not -name tmp -not -name new -not -name "." \
-not -name ".." | while read q ; do echo $q ; find "$q" -maxdepth 2 \
-type f |while read w ; do  find "$q"

Comment 1 Tomas Smetana 2008-10-03 12:41:34 UTC
Created attachment 319357 [details]
Proposed patch

Comment 10 errata-xmlrpc 2009-05-06 15:31:38 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0463.html