[Top][All Lists]

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

Re: AIX and Interix also do early PID recycling.

From: Chet Ramey
Subject: Re: AIX and Interix also do early PID recycling.
Date: Wed, 25 Jul 2012 10:56:13 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 7/25/12 9:20 AM, Michael Haubenwallner wrote:
> On 07/25/2012 09:59 AM, Michael Haubenwallner wrote:
>> On 07/25/2012 03:05 AM, Chet Ramey wrote:
>>> Bash holds on to the status of all terminated processes, not just
>>> background ones, and only checks for the presence of a newly-forked PID
>>> in that list if the list size exceeds CHILD_MAX.
>> The AIX 6.1 I've debugged on has:
>>   #define CHILD_MAX 128
>> I'm going to run this build job with 'truss -t kfork' again, to eventually 
>> find
>> some too small count of different PIDs before PID-recycling by the kernel...
> Tracing shows:
> The minimum fork count (including grand-childs to any depth) before PID 
> recycling starts
> looks like 255 (once), but usually 256 and more.
> However, one process does see a PID recycled after *at least* 128 forks,
> that is exactly the value of CHILD_MAX.
> First thought is of some off-by-one bug, but reducing js.c_childmax in jobs.c 
> (2 times)
> by one doesn't help.

It wouldn't. Bash prefers sysconf(_SC_CHILD_MAX) to the CHILD_MAX define,
and those two are apparently different.  You could replace js.c_childmax
in tests against its value (three places in jobs.c) with CHILD_MAX and
see whether that makes a difference.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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