pybootchartgui crashed with ValueError in get_proc_state()

Bug #343215 reported by Martin Mai
262
This bug affects 14 people
Affects Status Importance Assigned to Milestone
pybootchartgui (Ubuntu)
Fix Released
Medium
Unassigned
Declined for Jaunty by Nathan Handler

Bug Description

Binary package hint: pybootchartgui

I am running Ubuntu 9.04 and have bootchart installed. The first reboot just worked fine and a chart (.png file) was generated. Today I booted again, but there was no new chart in /var/log/bootchart/, just the .tgz file.

After that I was notified about the crash.

ProblemType: Crash
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/pybootchartgui
InterpreterPath: /usr/bin/python2.6
Package: pybootchartgui 0+r102-2
PackageArchitecture: all
ProcAttrCurrent: unconfined
ProcCmdline: /usr/bin/python /usr/bin/bootchart -f png -o /var/log/bootchart /var/log/bootchart/hostname-jaunty-20090315-1.tgz
ProcEnviron: PATH=(custom, no user)
PythonArgs: ['/usr/bin/bootchart', '-f', 'png', '-o', '/var/log/bootchart', '/var/log/bootchart/hostname-jaunty-20090315-1.tgz']
SourcePackage: pybootchartgui
Title: pybootchartgui crashed with ValueError in get_proc_state()
Uname: Linux 2.6.28-9-generic i686
UserGroups:

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :
Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

I now tried to run the command that's in the bug description to generate the png file and it crashed again, so this is reproducable.

Changed in pybootchartgui:
importance: Undecided → Medium
Revision history for this message
Anders Norgaard (anders-norgaard) wrote :

Hi Martin,

If you upload your bootchart.tgz file, then I'll have a look.

Best
Anders

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Sure...the first attachment is the .tgz file which causes the crash and the second one is a .tgz file from which a .png could be created at startup (I restarted again).

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :
Revision history for this message
Anders Norgaard (anders-norgaard) wrote :

It seems that a new process state 'X' is possible in Jaunty (?).

Henning committed a fix for this in revision 107

http://code.google.com/p/pybootchartgui/source/detail?r=107

Thanks for the report.
Anders

Revision history for this message
Sune Keller (sune-keller) wrote :

Revision 107 works for me.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Wow...thank you all for the fast processing of this bug. Setting to "fix commited" since you vaildated it is fixed upstream in revision 107.

Changed in pybootchartgui:
status: New → Fix Committed
Revision history for this message
Jeremy (jeremy-durge) wrote :

I can also confirm that the patch works with an existing bootchart tarball which had previously unrecognised states.

(Maybe a separate feature request would be in order for these states to be also added to the legend at the top of draw_process_bar_chart...)

Revision history for this message
jan2ary (jan2ary) wrote :

An error has happen on my updated jaunty today.
Does it mean fix is not in repository yet?

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

jan2ary, yes, the fix is not yet in Ubuntu as it shipps pybootchartgui revision 102 while the fix is in revision 107.

Revision history for this message
David Gaarenstroom (david-gaarenstroom) wrote :

I'm having this issue too. Can pybootchartgui be updated to revision 107 in time before the Jaunty final release?

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Please include the new version before final Jaunty release since the current r102 is broken!

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Ok, here is a debdiff for updating pybootchartgui to revision 113, which is the newest.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

I subscribed the sponsors for universe. Since the new revision fixes a crash, I am confident that it will be uploaded for Jaunty.

Changed in pybootchartgui (Ubuntu):
milestone: none → ubuntu-9.04
Revision history for this message
Anders Norgaard (anders-norgaard) wrote :

Hi Martin,

Nice with the debdiff - can you update it to note that bugs

https://bugs.launchpad.net/bugs/342593
https://bugs.launchpad.net/bugs/355954

would also be fixed?

And if you add python-cairo and python-gtk2 as runtime dependencies then

https://bugs.launchpad.net/ubuntu/+source/pybootchartgui/+bug/353699

would also be fixed.

Thanks
Anders

Revision history for this message
Tomasz Czapiewski (xeros) wrote :

I've get the same problem today - Kubuntu Jaunty with newest updates. I've used bootchart and bootchartgui from 2009.03.31 on this system and it had no problems until now. There is no 'png' file generated, only 'tgz' and pybootchartgui crashed few times (~10 - one right after another).
pybootchartgui version 0+r102-2

Revision history for this message
Tomasz Czapiewski (xeros) wrote :

Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/pybootchartgui/gui.py", line 51, in do_expose_event
    self.draw(cr, self.get_allocation())
  File "/var/lib/python-support/python2.6/pybootchartgui/gui.py", line 59, in draw
    draw.render(cr, *self.res)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 242, in render
    draw_process_bar_chart(ctx, proc_tree, curr_y + bar_h, w, h)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 261, in draw_process_bar_chart
    draw_processes_recursively(ctx, root, proc_tree, y, proc_h, chart_rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 297, in draw_processes_recursively
    child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 297, in draw_processes_recursively
    child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 297, in draw_processes_recursively
    child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 297, in draw_processes_recursively
    child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 291, in draw_processes_recursively
    draw_process_activity_colors(ctx, proc, proc_tree, x, y, w, proc_h, rect)
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 316, in draw_process_activity_colors
    state = get_proc_state( sample.state )
  File "/var/lib/python-support/python2.6/pybootchartgui/draw.py", line 82, in get_proc_state
    return "RSDTZ".index(flag) + 1
ValueError: substring not found

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

That was a good idea, biehl. Here is the new debdiff including notes about the other two fixes and the additional two depencies.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

With revision 120 another two bugs get fixed, so I made a new debdiff and added them as well.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

For those who want to test the package, I uploaded it to my ppa: https://launchpad.net/~mrkanister/+archive/ppa.

@Sponsors: Maybe this diff is better because it contains the removal of the .bzr directory which was present in revision 102 which is the repositories at the moment:

http://launchpadlibrarian.net/25382159/pybootchartgui_0%2Br102-2_0%2Br120.diff.gz

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

A new diff, two more bugs that gets fixed :)

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

To summerize it for the MOTUs:

The changes in the diff are taken from upstream (http://code.google.com/p/pybootchartgui/source/list), so this is more or less like a sync request.

The diff fixes 8 bugs. 3 of them are crashers, which is the reason why it should go into Jaunty.

The changes regarding the .bzr directory are there, because the package in Jaunty (pybootchartgui 0+r102) contains a .bzr directory, which was obviously left their by misstake and which I removed from the new package.

I have uploaded the newest package to my ppa (https://launchpad.net/~mrkanister/+archive/ppa) from where it can be tested.

Revision history for this message
Nathan Handler (nhandler) wrote :

Since this is an upgrade, you do not want to create a debdiff. Instead, you will want to attach the .diff.gz. Also, since no formal tarball was released upstream, you will want to attach a .tar.gz that we can use for the upgrade. As a side note, 'Fix Committed' is not a proper status for the ubuntu bug. The patch for Ubuntu has not been committed to an Ubuntu VCS. Finally, when you attach the requested files, could you also explain what testing you have done with this new version? Thanks in advance.

Changed in pybootchartgui (Ubuntu):
status: Fix Committed → Incomplete
Revision history for this message
Michael Kogan (michael-kogan) wrote :

As to the testing of the new version: I've tested it a bit (not that long though...) and there are several improvements and the crashes of r102 didn't appear till now. However, r102 _is_ broken so it has to be replaced till final jaunty release I think. But I'm sure that Martin can report of more accurate testing than me.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Nathan, sorry for the bad preparation. The attached original .tar.gz is based on

"svn export -r 124 http://pybootchartgui.googlecode.com/svn/trunk/ pybootchartgui-0+r124"

For every bug I have listed in the changelog, I tested if the bug is still present after upgrading to the latest revision. Additionally sometimes other launchpad users confirmed the bug being fixed with a new revision, too.

Regarding the "fix comitted" thing...I followed the short discussion on the mailing list on it and I found that I am not the only one using "fix comitted" for bugs fixed upstream. Most of the time this just helps when looking through some older bugs, verifying if the fix has made it into ubuntu. But that's something that needs to be discussed somewhere else...

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :
Changed in pybootchartgui (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Nathan Handler (nhandler) wrote :

The changes look pretty sane. However, the patch needs some work. For instance, the version currently in the repositories is a native package, but you are proposing uploading a non-native package (.orig.tar.gz and .diff.gz). You also are making some non-necessary clean-up changes (i.e. "Bump Standards-Version to 3.8.0" and "Remove dh_make boilerplate"). These changes should not be made at this point in time. They should be held off until Karmic.

ACK from me, but make these changes to your patch before uploading.

Changed in pybootchartgui (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
Johan Euphrosine (proppy) wrote :

Here is an updated patch, that I believe implement the suggested changes.

Revision history for this message
Johan Euphrosine (proppy) wrote :

Here is an updated debdiff also including upstream changes
Generated using:
debdiff --exclude .bzr pybootchartgui_0+r102-2.dsc pybootchartgui_0+r124.dsc > pybootchartgui_0+r124.debdiff

Revision history for this message
James Westby (james-w) wrote :

Uploaded and in the queue. Thanks for your contribution.

James

Changed in pybootchartgui (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pybootchartgui - 0+r124

---------------
pybootchartgui (0+r124) jaunty; urgency=low

  * New upstream revision:
    - Fix some drawing issues (lp: #342593)
    - Fix drawing bug (lp: #343215)
    - Empty bootcharts are now discovered (lp: #355952)
    - Fix incorrect seconds value for 60+ second boots (lp: #355954)
    - Fix parsing issue for process lines with spaces (lp: #356537)
    - Update slider position when zooming (lp: #358364)
    - Fix some drawing issue (lp: #360943, thanks to Hernando Torque)
  (thanks to biehl and Henning Niss for their active development)
  * debian/control:
    - Add depencies to 'python-gtk2' and 'python-cairo' (lp: #353699)

 -- Martin Mai <email address hidden> Sat, 18 Apr 2009 22:48:24 +0200

Changed in pybootchartgui (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
emas (emas80spam) wrote :

Hi, this bug "reappeared" suddenly yesterday, pybootchartgui cannot generate a .png for some .tgz, the error reported is

parsing '/var/log/bootchart/ima-zen-lucid-20100506-4.tgz'
parsing 'header'
parsing 'proc_stat.log'
parsing 'proc_diskstats.log'
parsing 'proc_ps.log'
warning: no parent for pid '2' with ppid '0'
merged 0 logger processes
pruned 240 process, 0 exploders, 247 threads, and 30 runs
False
Traceback (most recent call last):
  File "/usr/bin/pybootchartgui", line 23, in <module>
    sys.exit(main())
  File "/usr/lib/pymodules/python2.6/pybootchartgui/main.py", line 137, in main
    render()
  File "/usr/lib/pymodules/python2.6/pybootchartgui/main.py", line 128, in render
    batch.render(writer, res, options, filename)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/batch.py", line 41, in render
    draw.render(ctx, options, *res)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 299, in render
    draw_process_bar_chart(ctx, proc_tree, times, curr_y + bar_h, w, h)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 319, in draw_process_bar_chart
    draw_processes_recursively(ctx, root, proc_tree, y, proc_h, chart_rect)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 357, in draw_processes_recursively
    child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 349, in draw_processes_recursively
    draw_process_activity_colors(ctx, proc, proc_tree, x, y, w, proc_h, rect)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 376, in draw_process_activity_colors
    state = get_proc_state( sample.state )
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 105, in get_proc_state
    return "RSDTZXW".index(flag) + 1
ValueError: substring not found

For some .tgz it works (if I run pybootchartgui XXX it can generate a .png) but for some others files it fails.

I've the last version of bootchart/pybootchart with Ubuntu Lucid Lynx 10.04, 64-bit.
I've using a custom vanilla kernel 2.6.33.3.

I attach two files, one that can be translated into .png and one that can not.

Revision history for this message
emas (emas80spam) wrote :
Revision history for this message
Anders Norgaard (anders-norgaard) wrote :

Hi Emas,

I think the bug you are seeing now is this one.

https://bugs.launchpad.net/ubuntu/+source/pybootchartgui/+bug/512172

(there is also a workaround until the package is updated)

Best
Anders

Revision history for this message
emas (emas80spam) wrote :

Hi, thanks Anders!

I made some tests with my different kernel configurations, and I discovered that with original Ubuntu kernel 2.6.32 bootchart generates correctly the png, while with my custom kernel Ubuntu-2.6.32 and with my vanilla 2.6.33 it doesn't.

I had another problem with my custom kernels, both 2.6.32-ubuntu and 2.6.33-vanilla, which I considered more important, ureadahead was not working as expected, not generating its pack file in /var/lib/ureadahead and causing a really slow boot time.
On another bug report, which I can't found right now, I read that I should enable some features in kernel configuration, features that I disabled because .. why should I need a debug file system?!?

Enabling debug file system, kernel tracers and "Trace process context switches and events" inside kernel tracers solved.

So, fixing ureadahead by enabling those modules also fixed my problem with bootchart, now it works well with Ubuntu kernel 2.6.32-customized.

I still haven't tried with vanilla 2.6.33 because ureadahead needs a patch to be applied to kernel sources, and today I got a system perfectly running with at least one configutation, so maybe tomorrow I will patch the next kernel :-)

Hope it helps

Bye

emas

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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