Bug in ps

Bug in ps

Post by Adam Twi » Mon, 01 May 1995 04:00:00

There is a rather strange bug in ps that I don't have time to
investigate at the moment.  I have tested this on several slackware
2.1 based systems and found it a problem on all of them (using 1.2.x
based kernels).  The problem exists in the procps-0.97 version of ps.

If you type "ps 0x" (which is very close to "ps -x"), then the ps
process grows very rapidly and will very quickly start filling up your
swap space, put your load right up and basically kill your machine off.

The problem is that it treats 0x as a process number and it either
gets in some endless loop in trying to parse the argument or in trying
to get info on the process number.  "ps 0" does not cause the problem
but "ps 0q" does (q is not a valid paramater).

If I get the chance over the next couple of days, I will try and track
down the problem and post a patch.

- Adam