hishamhm / htop

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.
GNU General Public License v2.0
5.84k stars 581 forks source link

Zombies that don't have a parent-process are not shown #930

Open UlrichEckhardt opened 5 years ago

UlrichEckhardt commented 5 years ago

Zombies without a parent process occur when running without an init process that reaps the orphaned child processes. Normally, this shouldn't occur, because orphaned children are adopted by init (PID 1) which reaps those orphans on termination. However, there are two scenarios where this can happen:

Note that I'm guessing what's causing the differences between the ps auxf output and that of htop, but I'd say it's a reasonable explanation of what I can observe.

joder commented 4 years ago

I just encountered a similar problem on linux. However, in my case the zombie process is shown when showing kernel threads, but not otherwise. When digging into it with a debugger, I noticed that the cmdline file for the process is empty. However, if this file is empty then in the function LinuxProcessList_readCmdlineFile in line 695 the process is redefined as a kernel thread.

I hope this helps.