Subject: Re: ps hangs?
To: None <current-users@NetBSD.ORG>
From: Bert Driehuis <driehuis@playbeing.org>
List: current-users
Date: 11/06/1995 20:43:48
Chris G Demetriou <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU> wrote:

>I've seen it on x86 machines, but only when they're under very heavy
>load.  It's likely due to the fact that the kernel data structures that
>'ps' uses can change when ps is running, and ps doesn't (can't) get
>them atomically.  Were ps more careful, it might be able to avoid the
>infinite(?) loops, but that's not entirely clear.

The simple (yet ugly) workaround is to limit the number of fetches for
process structs to maxprocesscnt, and warn if that limit is exceeded. If
memory serves me, this is what BSDI did. The problem will manifest itself
for sure if you have scripts from cron that use ps output on a Web server.

                                        -- Bert Driehuis

------
Bert Driehuis                 God, grant me the serenity to accept the things
driehuis@playbeing.org        I can't change, courage to change the things I
                              can, and the wisdom to know the difference.