Re: ps -p comm and zombies

Jim Warner <[email protected]> Fri, 9 Dec 2022 11:34:43 -0600
Newsgroups gmane.linux.procps.devel
Message-ID <[email protected]>
On 12/9/22 5:59 AM, Craig Small (csmall) wrote:
> The issue is that older versions of ps used to show <defunct> for the 
> comm field but only the cmd field does it. That's because the 
> escape_string in ps/output.c doesn't add that, but the
> older escape_command in proc/escape.c did.
> . . .
> I'd probably add it back to the ps command but not sure if it is needed.

Hi Craig,

This 7 year old change was almost certainly not intentional.  However, 
it does mean that ps (comm) and top (c toggle) now show the same output.

Under the current 3.3.17 ps, the '<defunct>' notation is only guaranteed 
to be worthwhile if COMMAND is the very last column displayed.  Even 
worse, that notation itself is favored over the actual program name.

For example, the following becomes less useful the closer a program name 
approaches the non-kernel limit of 16 characters.

     $ ps e -o comm,pid
     ...
     zombie_longcomm   22840
     zombi <defunct>   22841
     ...

You can decide if restoring such functionality is worth duplicating yet 
more library code in ps/output.c.

If you decide against that approach, we should at least change the ps.1 
'comm' description.

Regards,

Jim