Tree view malfunctions when started with hide_userland_threads=1

Bug #298232 reported by Andy Brody
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
htop (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Intrepid by Alexander Chemeris
Nominated for Jaunty by Alexander Chemeris

Bug Description

Binary package hint: htop

Ubuntu 8.10
htop 0.8-0ubuntu1

When htop is started using a .htoprc file with "hide_userland_threads=1", tree view doesn't work. Enabling the view doesn't actually make a tree. It sorts processes appropriately (e.g. init is first), but there is no indentation.

Workaround:
Unchecking "Hide userland threads" in the settings dialog fixes the problem for the current htop instance. Tree view will continue to work properly until exit even if hiding of userland threads is re-enabled.

The tree view behavior was normal in Ubuntu 8.04 (htop 0.6.6+svn20070915-1)
Normal screenshot: http://htop.sourceforge.net/htop-0.5.png
Attached screenshot: tree view enabled but not working

Related branches

Revision history for this message
Andy Brody (abrody) wrote :
Revision history for this message
Alexander Chemeris (alexander-chemeris) wrote :

I found this boring too. I have to use htop often to kill hanged processes (e.g. awful PulseAudio and VirtualBox) and it's hard to do without proper tree view.

Revision history for this message
Andy Brody (abrody) wrote :

I found some code changes pertaining to this bug:

336c334
< if (process->ppid == pid) {
---
> if (process->tgid == pid || (process->tgid == process->pid && process->ppid == pid)) {

Specifically:
htop_0.6.6+svn20070915/ProcessList.c - line 336
htop-0.8.1/ProcessList.c - line 334

I recompiled 0.8.1 but reverted that change, and tree view works normally again.

Revision history for this message
Alexander Chemeris (alexander-chemeris) wrote :

Hum, I recompiled htop_0.8-0ubuntu1 with this change and it does not help.
htop_0.8-0ubuntu1 is an official version for Intrepid. Where have you got 0.8.1?

Revision history for this message
Andy Brody (abrody) wrote :
Revision history for this message
Alexander Chemeris (alexander-chemeris) wrote :

Oops, it was my bad - I incorrectly applied your patch. Now it works as expected even with 0.8.
Thanks. :)

Revision history for this message
Alexander Chemeris (alexander-chemeris) wrote :

Btw, I've made patched version available in my PPA:
https://launchpad.net/~alexander-chemeris/+archive

Revision history for this message
Josh Stone (cuviper) wrote :

I posted an alternate fix to the htop mailing list which doesn't require reverting any code.

http://sourceforge.net/mailarchive/message.php?msg_name=c1ed4c490901022030u35e959b4te3b585d4958270e9%40mail.gmail.com

I tested it on Fedora and upstream sources, but I expect this fix should work on Ubuntu as well.

Andy Brody (abrody)
Changed in htop:
assignee: nobody → abrody
status: New → In Progress
Revision history for this message
Andy Brody (abrody) wrote :

Attaching debdiff for Intrepid that applies Josh's patch.

The htop package doesn't use any patch system, so I just made the change in the source. (I think that's the recommended approach.)

Changed in htop:
assignee: abrody → nobody
status: In Progress → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package htop - 0.8.1-0ubuntu3

---------------
htop (0.8.1-0ubuntu3) jaunty; urgency=low

  * Add patch (inline) to fix tree view when userland threads are hidden
    Thanks to Josh Stone and Andy Brody. (LP: #298232)
  * debian/rules: Pass '--enable-openvz' to ./configure to compile with OpenVZ support
  * debian/copyright: Fix path for GPLv2 license

 -- David Futcher <email address hidden> Tue, 18 Nov 2008 20:42:48 +0000

Changed in htop:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.