Bug 481072 - Tree view doesn't work with threads hidden
Summary: Tree view doesn't work with threads hidden
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: htop
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rafał Psota
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-22 00:06 UTC by Josh Stone
Modified: 2009-02-07 02:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-06 05:19:54 UTC
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Launchpad 298232 0 None None None Never

Description Josh Stone 2009-01-22 00:06:46 UTC
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 20:01:35 UTC
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 05:19:52 UTC
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 05:23:25 UTC
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-07 02:51:09 UTC
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.