View Issue Details

IDProjectCategoryView StatusLast Update
0004199Slicer4Core: GUIpublic2018-03-02 11:07
Reporternicole Assigned Tojcfr  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in VersionSlicer 4.6.0 
Summary0004199: Creating a ruler then entering Annotations module causes a crash
Description

If you open Slicer and start in the Welcome module, add a new Ruler either programatically or via mouse clicks, then enter the Annotations module for the first time, Slicer crashes on an assert in qMRMLSceneModel:

ASSERT: "index == d->RowCache.count()" in file /Users/nicole/Slicer4-svn/Slicer/Libs/MRML/Widgets/qMRMLSceneModel.cxx, line 781

I traced it back a bit, it's a problem with the ruler hierarchy nodes and insertNode, there's a recursive call to insertNode that adds a parent node and throws off the count. The extra item does get added to the misplaced nodes list, but the crash happens before that can get resolved.

Steps To Reproduce

In the python console:

Start in the Welcome module

slicer.util.mainWindow().moduleSelector().selectModule('Welcome')

Add a ruler

rulerNode = slicer.vtkMRMLAnnotationRulerNode()
rulerNode.SetPosition1(0, 0, 0)
rulerNode.SetPosition2(1, 1, 1)
rulerNode.Initialize(slicer.mrmlScene)

Enter the Annotations module

slicer.util.mainWindow().moduleSelector().selectModule('Annotations')

Additional Information

Not a problem with Fiducials in the Markups module, but is reproducible with an ROI.
Crash does not happen if you enter the Annotations module first and then add a ruler.

TagsNo tags attached.

Relationships

related to 0003445 closedsankhesh Slicer crash when restoring a scene view 

Activities

nicole

nicole

2016-05-25 11:45

administrator   ~0013895

The hierarchy node for a new ruler is added to the scene using vtkMRMLScene::InsertBeforeNode.

jcfr

jcfr

2016-06-01 23:14

administrator   ~0013930

Crash does not happen if you enter the Annotations module first and then add a ruler.

This is explained by the fact populateScene is called only

jcfr

jcfr

2016-06-01 23:14

administrator   ~0013931

Fixed in r25143
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25143

Test added in r25145
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25145

Related Changesets

Import 2017-06-07 23:51:09: master a3f241ec

2016-06-01 23:12:38

jcfr

Details Diff
BUG: Remove invalid assert while populating the scene. Fixes 0003445, 0004199

This commit fixes a regression introduced in r25049 (COMP: qMRMLSceneModel:
Fix -Woverloaded-virtual and add comment.)

The assert was checking whether the index of the current node
matches the row count. However, while inserting nodes, the
logic adds a parent node if there isn't one. This insertion of
parent node increments the RowCache size. Next time the assert
was encountered, it would fail.

From: Sankhesh Jhaveri <sankhesh.jhaveri@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25143 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Widgets/qMRMLSceneModel.cxx Diff File

Issue History

Date Modified Username Field Change
2016-05-24 18:59 nicole New Issue
2016-05-24 18:59 nicole Status new => assigned
2016-05-24 18:59 nicole Assigned To => jcfr
2016-05-25 11:45 nicole Note Added: 0013895
2016-06-01 16:20 jcfr Relationship added related to 0003445
2016-06-01 23:14 jcfr Note Added: 0013930
2016-06-01 23:14 jcfr Note Added: 0013931
2016-06-01 23:14 jcfr Status assigned => resolved
2016-06-01 23:14 jcfr Fixed in Version => Slicer 4.6.0
2016-06-01 23:14 jcfr Resolution open => fixed
2017-06-10 08:51 jcfr Changeset attached => Slicer master a3f241ec
2018-03-02 11:07 jcfr Status resolved => closed