pybootchartgui crashed with ZeroDivisionError in draw_chart()

Bug #441660 reported by Jason Gerard DeRose
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
pybootchartgui (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: pybootchartgui

I'm running pybootchartgui_0+r124 under karmic beta + current updates as of 2009-10-03. Trying to use pybootchart results in this traceback:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/pybootchartgui/gui.py", line 51, in do_expose_event
    self.draw(cr, self.get_allocation())
  File "/usr/lib/pymodules/python2.6/pybootchartgui/gui.py", line 59, in draw
    draw.render(cr, *self.res)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 237, in render
    draw_chart(ctx, IO_COLOR, True, chart_rect, [(sample.time, sample.util) for sample in disk_stats], proc_tree)
  File "/usr/lib/pymodules/python2.6/pybootchartgui/draw.py", line 167, in draw_chart
    yscale = float(chart_bounds[3]) / max(y for (x,y) in data)
ZeroDivisionError: float division

I'm running the amd64 version under a KVM virtual machine.

ProblemType: Crash
Architecture: amd64
Date: Sat Oct 3 13:32:10 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/pybootchartgui
InterpreterPath: /usr/bin/python2.6
Package: pybootchartgui 0+r124
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/pybootchartgui /var/log/bootchart/username-desktop-karmic-20091003-2.tgz
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
PythonArgs: ['/usr/bin/pybootchartgui', '/var/log/bootchart/username-desktop-karmic-20091003-2.tgz']
SourcePackage: pybootchartgui
Title: pybootchartgui crashed with ZeroDivisionError in draw_chart()
Uname: Linux 2.6.31-11-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Related branches

Revision history for this message
Jason Gerard DeRose (jderose) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
Jason Gerard DeRose (jderose) wrote :
Revision history for this message
Anders Norgaard (anders-norgaard) wrote :

If you upload the datafile /var/log/bootchart/username-desktop-karmic-20091003-2.tgz then I'll have a look too.

Best
Anders (upstream)

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I attached the most recent bootchart data I was testing on, but I've personally encountered this bug consistently for about the last month during I've been testing Karmic in a VM.

I also revised my fix, please see revno 5 in lp:~jderose/ubuntu/karmic/pybootchartgui/fix-441660 (it now shows up in the merge proposal).

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

Hi Jason,

It looks like the disk use and disk throughput is all zeroes. I wonder if the parsing code in pybootchartgui is broken or if somehow the dumping of diskusage data is broken when running in QEMU.

I'll look a bit more and run bootchart in some VM's.

Otherwise maybe just doing

 yscale = float(chart_bounds[3]) / max(0.00001, max(y for (x,y) in data))

would also do? (at least as a workaround)

Best
Anders

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

Hi again,

The parsing was wrong - missing the virtual disks. This should now be fixed in r139

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

"Make sure parsing also matches virtual disks, conventionally called vda, vdb
etc. - should fix https://bugs.launchpad.net/bugs/441660"

Best
Anders

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Anders,

Thanks for looking at this and thanks for the fix! I should have looked closer at the bootchart data. ;)

Yeah, the Linux virtio para-virtual block devices are /dev/vd{a,b,c,...}

Cheers,
Jason

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

One other thought: some kind of fix for potential division-by-zero errors should probably still be added. I didn't look closely at the meaning of the data, but if very short time intervals have the potential to be zero (depending on the time granularity available), this could still be a problem on a VM.

Many hosts will have enough RAM to cache all areas of the guest disk used during boot, so subsequent boots of the VM will be entirely from memory... so it seems feasible to have zero-time events.

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

Hmm, since the divisor is the maximum of the timeseries of {CPU-use, I/O wait, disk-throughput, disk utilization}, and neither of those series should be all zeroes, I don't think there is any possibility of divide-by-zero for properly parsed data.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Ubuntu updated to -r139

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

Other bug subscribers

Remote bug watches

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