ps arg+env limit of 1016 characters

Guy Harris guy at auspex.auspex.com
Wed Apr 19 04:51:10 AEST 1989


>	As I have no root access I can't analyze the problem. However,
>	since a local process reporter (sps(1)) shows similar symptoms,
>	the problem may lie in /dev/*mem rather than /bin/ps.

Not likely.  "/dev/mem" wouldn't know an argument list or environment
list if it came up and bit it in the ass; it just hands you data from
physical memory.  However, the 4.3BSD "ps" *does* quite explicitly limit
the amount of argument/environment data it'll print to CLSIZE*NBPG
(i.e., one "operating system's notion of a page", or 1024 bytes) minus
a couple or so longwords of other stuff, which accounts quite nicely for
the 1016.

"sps" probably either lifted much of the code from "ps", or works
similarly to "ps", which would account for it having a similar
limitation.

Printing more of the argument list may or may not be a win (especially
on systems such as SunOS 4.0, with a "max arg list" size of about 1
megabyte - no, that's not a typo); after a while, it'd probably be like
reading the phone book.  It might be nice if it could avoid getting
fouled up by large environments, although it might be a bit more effort
to read in more than one page of the stack. 



More information about the Comp.bugs.4bsd.ucb-fixes mailing list