WSL icon indicating copy to clipboard operation
WSL copied to clipboard

LXTask does not show any processes

Open segin opened this issue 10 years ago • 2 comments

Take a look at this running instance of LXTask, notice anything off?

2016-07-06

There's no processes! Although it does correctly show CPU and memory usage, it's not correctly reading the process list from WSL's implementation of /proc.

Compare with htop, which shows processes just fine:

image

This is LXTask 0.1.4, which ships with Ubuntu 14.04 (which is what is installed as part of WSL.)

I've not done much digging into the LXTask source, although it does seem to have been forked from XFCE's task manager in the past. The relevant functions for scraping process information from /proc are located in src/xfce-taskmanager-linux.c

If I had to guess, a comment on line 308 of that file, // don't show error or kenerl threads gives a hint as to the possible cause of the unusual behaviour: LXTask doesn't show processes that it detects as kernel threads. It does this by scraping /proc/${PID}/statm and checking the task size. If it is zero, it assumes that the process is a kernel thread.

However, WSL returns 0 for all values in statm and thus LXTask (and possibly also the XFCE task manager, I've not checked yet) see ALL processes as kernel threads and not user-mode processes, and thus does not enumerate any of them into it's list of running processes.

segin avatar Jul 06 '16 06:07 segin

Thanks for digging into the cause! /proc/${PID}/statm was recently implemented and I confirmed that LxTask works on internal builds. The fix should be out soon for insiders.

stehufntdev avatar Jan 06 '17 18:01 stehufntdev

Awesome! And it was actually quite educational for me to analyse and describe the bug. Thanks for getting things sorted!

segin avatar Jan 06 '17 19:01 segin