bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AIX and Interix also do early PID recycling.


From: Andreas Schwab
Subject: Re: AIX and Interix also do early PID recycling.
Date: Wed, 25 Jul 2012 17:33:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Chet Ramey <chet.ramey@case.edu> writes:

> And that's the problem.  Bash assumes that there's a PID space at least as
> large as CHILD_MAX, and that the kernel will use all of it before reusing
> any PID in the space.  Posix says that shells must remember up to CHILD_MAX
> statuses of terminated asynchronous children (the description of `wait'),
> so implicitly the kernel is not allowed to reuse process IDs until it has
> exhausted CHILD_MAX PIDs.

I cannot see how CHILD_MAX is related to pid reuse.  CHILD_MAX is a
per-user limit, but the pid namespace is global.  If the shell forks a
new process, and the pid of it matches one of the previously used pids
for asynchronous jobs it can surely discard the remembered status for
that job.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]