[svlug] Reuse of pid's.

Chris Miller lordsauronthegreat at gmail.com
Thu Jan 22 18:08:44 PST 2009


On Thu, Jan 22, 2009 at 12:00 PM, Florin Andrei <florin at andrei.myip.org> wrote:
> Greg Lindahl wrote:
>> On Wed, Jan 21, 2009 at 11:20:12AM -0800, Don Marti wrote:
>>
>>> Not really, since you don't know what pid the kernel
>>> will give the next process it creates.
>>
>> 'cept they're traditionally handed out round-robin, which is why
>> killall works most of the time. It's only when you have a very fast
>> rate of process creation that you get into trouble.
>
>  From a practical standpoint, if that's the case, it means the s**t has
> really hit the fan, a lot of assumptions will break anyway, and you
> should be prepared to deal with major weirdness as a matter of course.
> Then killall having an unexpected behavior might well be just a
> relatively minor issue.

IIRC, Linux handles PIDs as 32-bit unsigned integers.  You'd have to
create somewhere around 4,294,967,295 processes in the few seconds
that killall is running in order to encounter this issue.

IIRC, process forking is somewhat slow in Linux (as opposed to
threading, which is entirely different and much faster).  I seriously
doubt that you could create enough new processes fast enough to wrap
around in order to experience this issue with killall.  I seriously
doubt you'd have the memory or clock cycles necessary to experience
this bug.

> I'm not surprised they haven't bothered to fix the "bug".

Nor am I.

-- 
Registered Linux Addict #431495
http://profile.xfire.com/mrstalinman | John 3:16!
http://www.fsdev.net/ | http://www.fsdev.net/~cmiller
Parents, Take Responsibility For Your Kids! http://www.whattheyplay.com/




More information about the svlug mailing list