Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Conversation

@joder
Copy link

@joder joder commented Dec 14, 2019

I suggest the following small fix with the following reasoning:

  • the conditionals with amtRead in function LinuxProcessList_readCmdlineFile are meant to protect the execution of the for loop (and what follows it), which is not supposed to be run with amtRead == 0 (if I understand correctly),
  • the command for zombie processes is then set in function LinuxProcessList_recurseProcTree at line 883 after the "offending" call to LinuxProcessList_readCmdlineFile at line 856.

To me this is a quick fix and the setting of command name of processes seems a little bit clumsy (i.e. readCmdlineFile is not just reading, but actually setting the command name of a process and classifying it as a kernel thread), however, I lack the insight as well as experience to write it better. Maybe setting the command name of a zombie process should also be moved to readCmdlineFile and the function renamed. Please, let me know what you think about it.

This closes issue #930.

@natoscott
Copy link
Collaborator

Merged here: htop-dev/htop@fed14a5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants