Re: ps shows wrong command line

Frank Racis (racis@psu.edu)
Fri, 29 Sep 1995 02:50:49 -0400


[ swapped out processes don't display properly in "ps" ]

This isn't a kernel problem, it's a problem with "procps". In stat.c
the function parse_stat() reads the command name in with the line:
sscanf(S, "%d %40c", &P->pid, P->cmd);
The "c" format specification does not include the terminating 0x00.
I preceded this line with:
memset(P->cmd,0,40);
which will give the correct zero-termination.

While we're on the subject of /proc, I've run into a problem with
recent (1.3.29, 1.3.30) kernels and the /proc/self/fd. The /proc/self/fd/*
entries exist, but any attempt to do I/O on them will give an error,
"file not found". The only older kernel I have is 1.2.10, which doesn't
have this problem.

-FwR