View Issue Details

IDProjectCategoryView StatusLast Update
0003445Slicer4Core: Base Codepublic2018-03-02 11:06
Reporterlassoan Assigned Tosankhesh  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version 
Target VersionSlicer 4.6.0Fixed in VersionSlicer 4.6.0 
Summary0003445: Slicer crash when restoring a scene view
Description

After loading/closing a scene and restoring scene views Slicer crashes.
See the exact steps in the script in the additional information section.

The crash is always reproducible with the script on the latest slicer trunk, while the crash does not happen with 4.3.1.

The crash is caused by a null pointer dereference in
vtkMRMLModelDisplayableManager::OnMRMLDisplayableModelNodeModifiedEvent
in the line:
bool visible = (dnode->GetVisibility() == 1) && this->IsModelDisplayable(dnode);

Stack trace:

MRMLDisplayableManager.dll!vtkMRMLModelDisplayableManager::OnMRMLDisplayableModelNodeModifiedEvent+0x6e
MRMLDisplayableManager.dll!vtkMRMLModelDisplayableManager::ProcessMRMLNodesEvents+0x105
MRMLLogic.dll!vtkMRMLAbstractLogic::MRMLNodesCallback+0x50
vtkCommon.dll!vtkCallbackCommand::Execute+0x24
MRMLCore.dll!vtkEventBroker::InvokeObservation+0xb1
MRMLCore.dll!vtkEventBroker::ProcessEvent+0x1c4
MRMLCore.dll!vtkEventBroker::Callback+0x41
vtkCommon.dll!vtkCallbackCommand::Execute+0x24
vtkCommon.dll!vtkObject::PrintSelf+0x9da
MRMLCore.dll!vtkMRMLDisplayableNode::OnNodeReferenceRemoved+0x74
MRMLCore.dll!vtkMRMLNode::SetAndObserveNthNodeReference+0x12b
MRMLCore.dll!vtkMRMLNode::UpdateNthNodeReference+0x1f4
MRMLCore.dll!vtkMRMLNode::UpdateNthNodeReference+0x7c
MRMLCore.dll!vtkMRMLNode::GetNthNodeReference+0xd9
MRMLCore.dll!vtkMRMLDisplayableNode::GetNthDisplayNode+0x26
MRMLDisplayableManager.dll!vtkMRMLModelSliceDisplayableManager::AddDisplayableNode+0x70
MRMLDisplayableManager.dll!vtkMRMLModelSliceDisplayableManager::UpdateFromMRML+0xee
MRMLDisplayableManager.dll!vtkMRMLAbstractDisplayableManager::RequestRender+0x1c
MRMLDisplayableManager.dll!vtkMRMLModelSliceDisplayableManager::OnMRMLSceneNodeRemoved+0x8a
MRMLLogic.dll!vtkMRMLAbstractLogic::MRMLSceneCallback+0x60
vtkCommon.dll!vtkCallbackCommand::Execute+0x24
MRMLCore.dll!vtkEventBroker::InvokeObservation+0xb1
MRMLCore.dll!vtkEventBroker::ProcessEvent+0x1c4
MRMLCore.dll!vtkEventBroker::Callback+0x41
vtkCommon.dll!vtkCallbackCommand::Execute+0x24
vtkCommon.dll!vtkObject::PrintSelf+0x9da
MRMLCore.dll!vtkMRMLScene::RemoveNode+0xe9
MRMLCore.dll!vtkMRMLSceneViewNode::RestoreScene+0x77a

Additional Information

download the file from MIDAS and specify the full path in the next line

file="BrainAtlas2012.mrb"
ioManager = slicer.app.ioManager()
m = slicer.util.mainWindow()
ioManager.loadFile(file)
ioManager.loadFile(file)
slicer.mrmlScene.Clear(0)
m.moduleSelector().selectModule('Data')
m.moduleSelector().selectModule('Models')
ioManager.loadFile(file)
slicer.mrmlScene.Clear(0)
ioManager.loadFile(file)
ioManager.loadFile(file)
sceneViewNode = slicer.mrmlScene.GetNthNodeByClass(0, 'vtkMRMLSceneViewNode')
sceneViewNode.RestoreScene()

TagsNo tags attached.

Relationships

related to 0004199 closedjcfr Creating a ruler then entering Annotations module causes a crash 
related to 0004081 assignedjcfr Ensure reference are updated before NodeAddedEvent is invoked 

Activities

jcfr

jcfr

2014-03-07 06:24

administrator   ~0011328

I was able to reproduce the problem.

sankhesh

sankhesh

2016-06-01 15:28

developer   ~0013923

Pushed a pull request here: https://github.com/Slicer/Slicer/pull/517

Once the assert is removed (as in the pull request), cannot reproduce the crash described in this bug report

jcfr

jcfr

2016-06-01 15:33

administrator   ~0013924

Last edited: 2016-06-01 15:38

View 2 revisions

Thanks for the PR.

Makes sense, the introduction of the Q_ASSERT was an oversight from my part when integrating http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25049

That said, I wonder which commit actually fix the underlying problem.

jcfr

jcfr

2016-06-01 23:15

administrator   ~0013932

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

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

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
2013-10-15 06:11 lassoan New Issue
2013-10-15 06:11 lassoan Status new => assigned
2013-10-15 06:11 lassoan Assigned To => jcfr
2014-03-07 06:24 jcfr Note Added: 0011328
2014-03-07 06:24 jcfr Status assigned => acknowledged
2015-11-12 15:24 jcfr Relationship added related to 0004081
2015-11-12 15:24 jcfr Target Version => Slicer 4.5.1
2016-06-01 12:51 sankhesh Assigned To jcfr => sankhesh
2016-06-01 12:51 sankhesh Status acknowledged => assigned
2016-06-01 15:28 sankhesh Note Added: 0013923
2016-06-01 15:33 jcfr Note Added: 0013924
2016-06-01 15:38 jcfr Note Edited: 0013924 View Revisions
2016-06-01 16:20 jcfr Relationship added related to 0004199
2016-06-01 23:15 jcfr Note Added: 0013932
2016-06-01 23:15 jcfr Status assigned => resolved
2016-06-01 23:15 jcfr Fixed in Version => Slicer 4.6.0
2016-06-01 23:15 jcfr Resolution open => unable to reproduce
2016-10-13 01:28 jcfr Target Version Slicer 4.5.1 => Slicer 4.6.0
2017-06-10 08:51 jcfr Changeset attached => Slicer master a3f241ec
2018-03-02 11:06 jcfr Status resolved => closed