View Issue Details

IDProjectCategoryView StatusLast Update
0002664Slicer4Module Annotationspublic2017-06-07 23:27
Reporterpieper Assigned Tojcfr  
PriorityhighSeveritycrashReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0002664: crash on second point of ruler
Description

Go into rule mode, place first point and get crash when placing second point. Replicated on mac and linux.

TagsNo tags attached.

Relationships

related to 0002663 closednicole Cannot put down fiducials on windows 

Activities

jcfr

jcfr

2012-10-18 11:54

administrator   ~0006622

Pushed a topic removing the usage of m_SliceNode.
See https://github.com/jcfr/Slicer/tree/2664-fix-fiducial-placement

jcfr

jcfr

2012-10-18 13:50

administrator   ~0006623

After reverting all the commits of Jim and myself, adding ruler widget in the threed view leads to a crash.

It seems the Ruler widget never worked if there are threeD view. It should probably be split into two widgets:

  • vtkAnnotationRulerWidget
  • vtkAnnotationRulerWidget2D

There is function named "CreateDefaultRepresentation3D" that is called from nowhere.

A fix to prevent a crash would be to not register the ruler displayable manager with the threeD view.

jcfr

jcfr

2012-10-18 14:06

administrator   ~0006624

Last edited: 2012-10-18 14:12

After reverting the commit of Julien, Ruler widget works ! Currently investigating.

nicole

nicole

2012-10-18 14:13

administrator   ~0006625

re note 66624 which commit did you revert?

The digging that I'm doing is showing that I'm only getting 3d representations during the crashes, they're created manually in the displayable manager. The main problem to me seems to be that the Is2DDisplayableManager check is failing and the safe downcasts are assuming a 2d/3d viewer that's not correct.

nicole

nicole

2012-10-18 14:14

administrator   ~0006626

Last edited: 2012-10-18 14:16

I've got some checks that prevent crashing, but not sure of the base cause yet. Your switch to not using the slice node didn't make a difference?
see svn 21212.

jcfr

jcfr

2012-10-18 14:29

administrator   ~0006627

The source of the crash has been discovered.

In vtkAnnotationRulerWidget::CreateDefaultRepresentation(),

the commit of Julien change from:

reinterpret_cast<vtkAnnotationRulerRepresentation*>(this->WidgetRep)->InstantiateHandleRepresentation();

into:

vtkAnnotationRulerRepresentation::SafeDownCast(this->WidgetRep)
->InstantiateHandleRepresentation();

Given the update of Julien, it was then impossible for a vtkAnnotationRulerRepresentation3D to be casted into a vtkAnnotationRulerRepresentation !

Using "reinterpret_cast" was by "great luck" working and the appropriate function was called.

jcfr

jcfr

2012-10-18 14:31

administrator   ~0006628

Just looked at your commit and it works because "vtkDistanceRepresentation" is the base class common to both vtkAnnotationRulerRepresentation3D and vtkAnnotationRulerRepresentation.

nicole

nicole

2012-10-18 14:34

administrator   ~0006629

The problem is that it doesn't fix the 2d/3d check problem, try putting down a fid and a ruler then switching to compare view mode. It crashes in a different place with the representation not being the expected 2d one.

jcfr

jcfr

2012-10-18 16:22

administrator   ~0006630

Fixed in r21213 and r21214
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=21213
and http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=21214

jcfr

jcfr

2012-10-19 10:17

administrator   ~0006649

Simplify code.
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=21217

jcfr

jcfr

2014-03-06 04:50

administrator   ~0010739

Closing resolved issues that have not been updated in more than 3 months

jcfr

jcfr

2017-06-07 23:27

administrator   ~0014543

Fix committed to 1683-launcher-with-output branch.

Related Changesets

Slicer: 1683-launcher-with-output 56376324

2012-10-18 18:16:18

naucoin

Details Diff
BUG: issue 0002664 avoid a crash stemming from the wrong 2d/3d check for the ruler widget. Use the superclass to avoid a null pointer on safe down cast

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21212 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Annotations/VTKWidgets/vtkAnnotationRulerWidget.cxx Diff File

Slicer: 1683-launcher-with-output 5fd34f4d

2012-10-18 20:21:06

jcfr

Details Diff
BUG: Update vtkAnnotationRulerWidget to adequately distinguish 2D and 3D case

Add functions "GetIs2Widget" and "SetIs2DWidget" allowing to build
the appropriate representation.

Note that calling "SetIs2DWidget" after a representation has been built
as a no-op.

See http://www.na-mic.org/Bug/view.php?id=2664

Fixes 0002664

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21214 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Annotations/MRMLDisplayableManager/vtkMRMLAnnotationRulerDisplayableManager.cxx Diff File
mod - Modules/Loadable/Annotations/VTKWidgets/vtkAnnotationRulerWidget.cxx Diff File
mod - Modules/Loadable/Annotations/VTKWidgets/vtkAnnotationRulerWidget.h Diff File

Issue History

Date Modified Username Field Change
2012-10-18 11:52 pieper New Issue
2012-10-18 11:52 pieper Status new => assigned
2012-10-18 11:52 pieper Assigned To => nicole
2012-10-18 11:52 pieper Relationship added related to 0002663
2012-10-18 11:54 jcfr Note Added: 0006622
2012-10-18 13:50 jcfr Note Added: 0006623
2012-10-18 14:06 jcfr Note Added: 0006624
2012-10-18 14:12 jcfr Note Edited: 0006624
2012-10-18 14:13 nicole Note Added: 0006625
2012-10-18 14:14 nicole Note Added: 0006626
2012-10-18 14:16 nicole Note Edited: 0006626
2012-10-18 14:29 jcfr Note Added: 0006627
2012-10-18 14:31 jcfr Note Added: 0006628
2012-10-18 14:34 nicole Note Added: 0006629
2012-10-18 16:22 jcfr Note Added: 0006630
2012-10-18 16:22 jcfr Status assigned => resolved
2012-10-18 16:22 jcfr Fixed in Version => Slicer 4.2.0 - coming release
2012-10-18 16:22 jcfr Resolution open => fixed
2012-10-19 10:17 jcfr Note Added: 0006649
2014-03-06 04:50 jcfr Note Added: 0010739
2014-03-06 04:51 jcfr Status resolved => closed
2017-06-07 23:27 jcfr Changeset attached => Slicer 1683-launcher-with-output 5fd34f4d
2017-06-07 23:27 Changeset attached => Slicer 1683-launcher-with-output 56376324
2017-06-07 23:27 jcfr Note Added: 0014543
2017-06-07 23:27 jcfr Assigned To nicole => jcfr