Bug 521134 - Bash doesn't wait for backgrounded process if its PID is recycled
Summary: Bash doesn't wait for backgrounded process if its PID is recycled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: bash
Version: 4.8
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Roman Rakus
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks: 531235
TreeView+ depends on / blocked
 
Reported: 2009-09-03 19:30 UTC by Albert Hopkins
Modified: 2018-10-20 04:12 UTC (History)
6 users (show)

Fixed In Version: bash-3.0-23.el4
Doc Type: Bug Fix
Doc Text:
Cause: Backgrounded process PID is the same as the previous backgrounded process PID. Consequence: Bash doesn't wait for backgrounded process. Fix: Force bash to forgot last backgrounded process PID. Result: Bash waits for backgrounded process.
Clone Of:
Environment:
Last Closed: 2011-02-16 14:30:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0261 0 normal SHIPPED_LIVE Low: bash security and bug fix update 2011-02-16 14:29:52 UTC

Description Albert Hopkins 2009-09-03 19:30:50 UTC
The following condition occurs on RHEL4.8:

    [root@IT324086 ~]# uname -r ; rpm -q bash
    2.6.9-89.0.9.EL
    bash-3.0-21.el4
    [root@IT324086 ~]# echo 1000 > /proc/sys/kernel/pid_max  # for example
    [root@IT324086 ~]# while true; do sleep 1d & done
    [1] 300
    [2] 301
    [3] 302
    [4] 303
    [5] 304
    ...
    [696] 996
    [697] 997
    [698] 998
    [699] 999
    -bash: fork: Resource temporarily unavailable
    [root@IT324086 ~]# # kill some processes
    [root@IT324086 ~]# kill %1
    [root@IT324086 ~]# kill %2
    [1]   Terminated              sleep 1d
    [root@IT324086 ~]# man ps
    popen: Resource temporarily unavailable
    Attempt [/usr/bin/gunzip -c /usr/share/man/man1/ps.1.gz] to expand man page failed
    No manual entry for ps
    [2]   Terminated              sleep 1d
    [root@IT324086 ~]# ll
    [root@IT324086 ~]# ll
    total 88
    -rw-r--r--  1 root root  1068 Sep  3 15:03 anaconda-ks.cfg
    -rw-r--r--  1 root root 65029 Sep  3 15:03 install.log
    -rw-r--r--  1 root root  3062 Sep  3 15:03 install.log.syslog
    total 88
    -rw-r--r--  1 root root  1068 Sep  3 15:03 anaconda-ks.cfg
    -rw-r--r--  1 root root 65029 Sep  3 15:03 install.log
    -rw-r--r--  1 root root  3062 Sep  3 15:03 install.log.syslog

This only happens for the current bash shell. Other bash shells running simultaneously respond fine.

Comment 11 Roman Rakus 2010-10-28 22:06:36 UTC
It's fixed in bash-3.0-23.el4

Comment 14 Florian Nadge 2011-01-13 14:53:41 UTC
Please be so kind and add a few key words to the technical note of this
bugzilla entry using the following structure:

Cause:

Consequence:

Fix:

Result:

For more details on CCFR texts, see:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Comment 15 Florian Nadge 2011-01-13 14:53:41 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause

Consequence:

Fix:

Result:

Comment 16 Roman Rakus 2011-01-14 17:04:11 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1,11 @@
-Cause
+Cause:
+Backgrounded process PID is the same as the previous backgrounded process PID.
 
 Consequence:
+Bash doesn't wait for backgrounded process.
 
 Fix:
+Force bash to forgot last backgrounded process PID.
 
-Result:+Result:
+Bash waits for backgrounded process.

Comment 17 errata-xmlrpc 2011-02-16 14:30:03 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/RHSA-2011-0261.html


Note You need to log in before you can comment on or make changes to this bug.