GTG

Crash when deleting all tasks (negative task count?)

Bug #582612 reported by Luca Invernizzi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
High
Unassigned

Bug Description

- start gtg with the default tasks set
- F9
- remove all task
you should see a negative number besides "All tasks" and "Tasks with no tags". This is obviously wrong.

Changed in gtg:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Bryce Harrington (bryce) wrote :
Download full text (3.8 KiB)

I tried reproducing this, but instead of seeing a negative number, it crashed. I started it up, selected all tasks, right clicked, picked 'Delete', and "Permanently remove tasks". Crash dump follows:

Setting XDG vars to use default dataset.
/home/bryce/src/gtg/gtg/GTG/taskbrowser/browser.py:855: GtkWarning: gtk_tree_model_sort_build_level: assertion `length > 0' failed
  self.ctask_tv.set_model(ctask_modelsort)
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/viewmanager/delete_dialog.py", line 42, in on_delete_confirm
    self.req.delete_task(tid)
  File "/home/bryce/src/gtg/gtg/GTG/core/requester.py", line 211, in delete_task
    for tag in task.get_tags():
AttributeError: 'NoneType' object has no attribute 'get_tags'

1@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

1@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

2@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

3@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

3@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

4@1 is modified in the filteredtree
Traceback (most recent call last):
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 195, in __task_modified
    inroot = self.__is_root(self.get_node(tid))
  File "/home/bryce/src/gtg/gtg/GTG/core/filteredtree.py", line 611, in __is_root
    if not self.flat and n.has_parent():
AttributeError: 'NoneType' object has no attribute 'has_parent'

5@1 is modified in the filteredtree
Traceback (most recent call last):
  F...

Read more...

Revision history for this message
Bryce Harrington (bryce) wrote :

Re-starting the program after the crash, the tasks were gone. The following warnings were shown:

$ ./scripts/debug.sh
Setting XDG vars to use default dataset.
/home/bryce/src/gtg/gtg/GTG/taskbrowser/browser.py:217: GtkWarning: gtk_tree_model_sort_build_level: assertion `length > 0' failed
  self.task_tv.set_model(self.task_modelsort)
/home/bryce/src/gtg/gtg/GTG/taskbrowser/browser.py:855: GtkWarning: gtk_tree_model_sort_build_level: assertion `length > 0' failed
  self.ctask_tv.set_model(ctask_modelsort)

Revision history for this message
Bryce Harrington (bryce) wrote :

I tested doing <Dismiss> on all tasks, and <Mark as Done> on all tasks using shortcut keys, menus, context menus, etc. but could not reproduce the original behavior of the negative counts.

However, <Delete> produces the same crash reliably whether from a menu, shortcut, etc.

Revision history for this message
Bryce Harrington (bryce) wrote :

I'm bumping up the priority on this and changing the title to match what I was able to reproduce. Hope that's ok.

Changed in gtg:
importance: Medium → High
milestone: none → 0.3
summary: - wrong count of tagged tasks
+ Crash when deleting all tasks (negative task count?)
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

fixed in rev 785

Changed in gtg:
assignee: nobody → Lionel Dricot (ploum)
status: Triaged → Fix Committed
Changed in gtg:
milestone: 0.3 → 0.2.9
Izidor Matušov (izidor)
Changed in gtg:
status: Fix Committed → 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.