Bug 481072 - Tree view doesn't work with threads hidden
Tree view doesn't work with threads hidden
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: htop (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Rafał Psota
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-21 19:06 EST by Josh Stone
Modified: 2009-02-06 21:51 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-06 00:19:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ensure tgid is always set (687 bytes, patch)
2009-01-21 19:06 EST, Josh Stone
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 298232 None None None Never

  None (edit)
Description Josh Stone 2009-01-21 19:06:46 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):
htop-0.8.1-2.fc10
This is a regression -- 0.7.x didn't have this problem.

How reproducible:
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.
  
Actual results:
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).

Expected results:
Processes are shown without threads in a tree view to begin with.

Additional info:
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.
http://sourceforge.net/tracker/?func=detail&atid=651633&aid=2022810&group_id=108839

Ubuntu accepted this patch for jaunty from LP #298232.
Comment 1 Adam Miller 2009-02-05 15:01:35 EST
Rafal submitted the patch for upstream/current fedora builds. I have applied the patch to the EPEL branches. Updates to follow...
Comment 2 Fedora Update System 2009-02-06 00:19:52 EST
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.
Comment 3 Fedora Update System 2009-02-06 00:23:25 EST
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.
Comment 4 Josh Stone 2009-02-06 21:51:09 EST
I got the update today and confirmed that the problem is fixed.  Thanks very much!

Note You need to log in before you can comment on or make changes to this bug.