Red Hat Bugzilla – Bug 481072
Tree view doesn't work with threads hidden
Last modified: 2009-02-06 21:51:09 EST
Created attachment 329674 [details]
ensure tgid is always set
Description of problem:
When htop is configured to show a tree view
Version-Release number of selected component (if applicable):
This is a regression -- 0.7.x didn't have this problem.
Very easy to reproduce
Steps to Reproduce:
1. Edit or create ~/.htoprc, and set hide_userland_threads=1 and tree_view=1.
2. Start htop
3. Note that it is not actually displaying a tree view.
Processes are shown without threads in a flat view. Pressing F5 to toggle tree view will change the order, but it remains flat. Pressing H twice to toggle user threads on and off again will restore the proper tree hierarchy (until htop is restarted).
Processes are shown without threads in a tree view to begin with.
The problem is that when htop is hiding user threads, it doesn't go through the enumeration that sets the tgid in its process structures. Every process is left with tgid=0, which prevents the tree generator from working.
The attached patch fixes the problem by setting tgid=pid when the parent pointer is NULL.
I've posted this to the upstream mailing list and bug tracker as well, but haven't gotten any response.
Ubuntu accepted this patch for jaunty from LP #298232.
Rafal submitted the patch for upstream/current fedora builds. I have applied the patch to the EPEL branches. Updates to follow...
htop-0.8.1-3.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
htop-0.8.1-3.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
I got the update today and confirmed that the problem is fixed. Thanks very much!