I'm trying to run htop on Ubuntu 16.04.1 LTS. Until the end of last week the command was working fine, and I haven't made any major changes to the system since then. Now, when I attempt to run htop, the screen goes black and I'm unable to exit using Ctrl-C, Ctrl-Z, q, or any of the standard escape characters. I'm forced to restart the terminal.
top still works just fine.
EDIT2: I ran
strace -o strace.log -f xterm -e htop
Examination of the output reveals that the htop reads all the existing processes until it gets to the last one, where it does
41049 read(5, "72165 (python) D 1 72113 72069 0"..., 2048) = 190
41049 read(5, "", 1858) = 0
41049 close(5) = 0
41049 stat("/proc/72113/task/72165", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
41049 open("/proc/72113/task/72165/cmdline", O_RDONLY) = 5
41049 read(5, <unfinished ...>
and then it never finishes reading the file.
Running ps -ef also causes the terminal to hang. It prints the names of all the processes before 72113, and then it freezes at 72113 and can't be escaped without closing the terminal.
If I type
sudo less /proc/72113/task/72165/cmdline
the terminal hangs. I have also tried
sudo kill -9 72113
which runs but does nothing; htop and ps -ef still freeze when run.
I'm puzzled about what's going on here.