Bug 1321344

Summary: [abrt] hamster-time-tracker: overview.py:226:_draw:ZeroDivisionError: float division by zero
Product: [Fedora] Fedora Reporter: mastaiza <mastaizawfm>
Component: hamster-time-trackerAssignee: Ankur Sinha (FranciscoD) <sanjay.ankur>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: fschwarz, kparal, sanjay.ankur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/481b39cf3df4485629975ece4e2bbb2ec2b2b021
Whiteboard: abrt_hash:229d2eefbba4df6326535680eb19ab160a5b662b;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-25 15:26:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description mastaiza 2016-03-25 17:09:58 UTC
Version-Release number of selected component:
hamster-time-tracker-2.0-0.7.rc1.fc23

Additional info:
reporter:       libreport-2.6.4
cmdline:        python2 /usr/bin/hamster-windows-service
executable:     /usr/bin/hamster-windows-service
kernel:         4.4.6-300.fc23.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
overview.py:226:_draw:ZeroDivisionError: float division by zero

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/hamster/lib/graphics.py", line 1975, in do_draw
    sprite._draw(context)
  File "/usr/lib/python2.7/site-packages/hamster/lib/graphics.py", line 1282, in _draw
    sprite._draw(context, self.opacity * opacity, matrix * parent_matrix)
  File "/usr/lib/python2.7/site-packages/hamster/lib/graphics.py", line 1282, in _draw
    sprite._draw(context, self.opacity * opacity, matrix * parent_matrix)
  File "/usr/lib/python2.7/site-packages/hamster/overview.py", line 226, in _draw
    w = (self.alloc_w - 110) * value.total_seconds() / self._max.total_seconds()
ZeroDivisionError: float division by zero

Local variables in innermost frame:
opacity: 1
matrix: cairo.Matrix(1, 0, 0, 1, 10, 100)
g: <hamster.lib.graphics.Graphics object at 0x7f2a0d33f848>
i: 0
self: <HorizontalBarChart 139818601628928>
label_h: 15
value: datetime.timedelta(0)
label: dbus.String(u'\u043f\u043e\u0438\u0441\u043a \u0440\u0430\u0431\u043e\u0442\u044b')
label_w: 94
context: <cairo.Context object at 0x7f2a2a0a3df0>
y: 0

Comment 1 mastaiza 2016-03-25 17:10:04 UTC
Created attachment 1140340 [details]
File: backtrace

Comment 2 mastaiza 2016-03-25 17:10:06 UTC
Created attachment 1140341 [details]
File: environ

Comment 3 Raphael Groner 2016-03-25 19:48:42 UTC
Thanks for your report.

Unfortunately, there's not enough information to let us reproduce the crash. As far as I understand the provided backtrace and relevant sources, this must be related to your custom database for hamster. Did you create entries with zero values? Maybe you could provide your hamster.db file, that could be found in following path: ~/.local/share/hamster-applet/hamster.db

Otherwise, you could just delete that file and hamster should work again. Alternatively, open the database with an editor and remove the bogus entries, e.g. use sqlitebrowser or sqliteman.

We saw a similar issue recently and it clearly showed to be related to bogus database somehow.

Comment 4 Kamil Páral 2016-08-20 23:59:48 UTC
*** Bug 1368747 has been marked as a duplicate of this bug. ***

Comment 5 Kamil Páral 2016-08-21 00:01:41 UTC
I have the same issue. I have deleted ~/.local/share/hamster-applet/hamster.db, started a fresh hamster with no old data, picked one of the predefined activities, started tracking it, and it crashed again. For the moment, I can't use hamster at all.

Comment 6 Kamil Páral 2016-08-21 00:18:51 UTC
This crash seems to occur when the main window is displayed and completely empty (no previous activity), and an activity is started (either from GUI or CLI). If I close the main window, start a new activity from CLI, and then display the window, it seems to render fine and no crash occurs.

I have still not figured out how to stop an activity in GUI, though...

Comment 7 Fedora End Of Life 2016-11-24 16:14:25 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.