Slicer crashes during loading, error in Python?

Hi everyone,
I am a brand new user of Slicer 3D and I first want to tell you I am amazed by this soft! A lots of people did a great job !

I am actually editing a scripted module with Python, and after a minor change, I cannot start 3D Slicer anymore. It is the second time it happens to me and I had to reinstall Slicer last time.
Since Slicer is loading the module I am editing and my previous change in the code did not affect the soft before that, I guess my problem is due to a code mistake (simple error in a loop or something like that). When I execute Slicer, I still see the first small image but then the Slicer windows never appears and nothing loads. Deleting the associated .pyc before to execute Slicer didn’t chnage anything.

I am running Slicer 4.9.0 on Windows 10

Any idea how to fix that ?

Thank you a lot,
Thomas

Can you please provide a log file? If you can start Slicer you can get it in Help / Report a bug, otherwise it’s in c:\Users[USER]\AppData\Local\Temp\ or …\Temp\Slicer.

To get a clean slate, you need to remove c:\Users\(YourUserName)\AppData\Roaming\NA-MIC\Slicer.ini file.

Thank you for your fast answers.

This problem happened to me again this morning. I joined the last log file I could find.
Maybe you can get some info from this screenshot but this log is about the previous session of Slicer. I had some bug in my code so I closed it, made some change on the module and then it was impossible to open Slicer again, like last time.
Slicer cannot get to even create the log file.
Removing the Slicer.ini file in AppDatra/Roaming… didn’t change anything.

Maybe it the way I am working on the module, closing slicer, making some change in the code and the opening Slicer and this for many times ?

Thanks for your help
Slicer_26631_20171120_121038

Could you please copy-paste the text here instead of attaching a screenshot? If the log is too long to be included in the post in full, then upload to dropbox/onedrive/gdrive/pastebin/github-gist and post the link.

Ok sorry.
Here the begining of the log. But again this is the log from the session before the one that crashed, everything seems to be good on it. I haven’t included the end of the log file, which is about info stream of the module and should not concern my problem since I printed many variables and matrices.


[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Session start time …: 2017-11-20 12:10:38
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Slicer version …: 4.9.0-2017-11-14 (revision 26631) win-amd64 - installed
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Operating system …: Windows / Professional / (Build 9200) - 64-bit
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Memory …: 16282 MB physical, 18714 MB virtual
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - CPU …: GenuineIntel , 4 cores, 16 logical processors
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Developer mode enabled …: no
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Prefer executable CLI …: yes
[DEBUG][Qt] 20.11.2017 12:10:38 [] (unknown:0) - Additional module paths …: C:\Users\Lonjaret_PYTHEAS\Documents\DevInfo\Slicer3D\PedicleScrewSimulator-master\PedicleScrewSimulator
[DEBUG][Python] 20.11.2017 12:10:41 [Python] (C:\Program Files\Slicer 4.9.0-2017-11-14\lib\Python\Lib\site-packages\git\cmd.py:719) - Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)
[DEBUG][Python] 20.11.2017 12:10:41 [Python] (C:\Program Files\Slicer 4.9.0-2017-11-14\lib\Python\Lib\site-packages\git\cmd.py:719) - Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)
[DEBUG][Python] 20.11.2017 12:10:43 [Python] (C:\Program Files\Slicer 4.9.0-2017-11-14\lib\Slicer-4.9\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: Annotations
[DEBUG][Python] 20.11.2017 12:10:44 [Python] (C:\Program Files\Slicer 4.9.0-2017-11-14\lib\Slicer-4.9\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 20.11.2017 12:10:44 [Python] (C:\Program Files\Slicer 4.9.0-2017-11-14\lib\Slicer-4.9\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 20.11.2017 12:10:40 [] (unknown:0) - Number of registered modules: 136
[DEBUG][Qt] 20.11.2017 12:10:41 [] (unknown:0) - Number of instantiated modules: 136
[DEBUG][Qt] 20.11.2017 12:10:44 [] (unknown:0) - Number of loaded modules: 136
[DEBUG][Qt] 20.11.2017 12:10:44 [] (unknown:0) - Switch to module: “Welcome”
[DEBUG][Qt] 20.11.2017 12:10:48 [] (unknown:0) - Switch to module: “PedicleScrewSimulator”
[WARNING][Qt] 20.11.2017 12:10:48 [] (unknown:0) - addTransition - Cannot create a transition that matches a previously created transition
[WARNING][Qt] 20.11.2017 12:10:48 [] (unknown:0) - addTransition - Cannot create a transition that matches a previously created transition
[WARNING][Qt] 20.11.2017 12:10:48 [] (unknown:0) - addTransition - Cannot create a transition that matches a previously created transition
[INFO][Stream] 20.11.2017 12:10:48 [] (unknown:0) - currentStep in parameter node is empty!
[INFO][Stream] 20.11.2017 12:10:48 [] (unknown:0) - -> onEntry - current [LoadData] - comingFrom [None]
[INFO][Stream] 20.11.2017 12:10:51 [] (unknown:0) - File already exists in cache - reusing it.
[INFO][Stream] 20.11.2017 12:10:51 [] (unknown:0) - Requesting load CTChest from C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/RemoteIO/CT-chest.nrrd…
[INFO][Stream] 20.11.2017 12:10:51 [] (unknown:0) -
[INFO][VTK] 20.11.2017 12:10:51 [vtkMRMLVolumeArchetypeStorageNode (0000022C6878F070)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/RemoteIO/CT-chest.nrrd. Dimensions: 512x512x139. Number of components: 1. Pixel type: int.
[DEBUG][Qt] 20.11.2017 12:10:51 [] (unknown:0) - “Volume” Reader has successfully read the file “C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/RemoteIO/CT-chest.nrrd” “[0.87s]”
[INFO][Stream] 20.11.2017 12:10:51 [] (unknown:0) - Load finished
[INFO][Stream] 20.11.2017 12:10:51 [] (unknown:0) -
[INFO][Stream] 20.11.2017 12:10:52 [] (unknown:0) - [-389.6192625761033, 0.38085949420928966, -389.6192625761033, 0.38085949420928966, -1.25, 346.25]
[INFO][Stream] 20.11.2017 12:10:52 [] (unknown:0) - Done
[INFO][Stream] 20.11.2017 12:10:52 [] (unknown:0) - -> onExit - current [LoadData] - goingTo [DefineROI]
[INFO][Stream] 20.11.2017 12:10:52 [] (unknown:0) - -> onEntry - current [DefineROI] - comingFrom [LoadData]
[WARNING][VTK] 20.11.2017 12:10:53 [vtkMRMLLinearTransformNode (0000022C66F676E0)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkMRMLTransformNode.cxx:1515) - vtkMRMLTransformNode::SetAndObserveMatrixTransformToParent method is deprecated. Use vtkMRMLTransformNode::SetMatrixTransformToParent instead
[INFO][Stream] 20.11.2017 12:10:53 [] (unknown:0) - PedicleScrewSimulator VR: will observe ID vtkMRMLScalarVolumeNode1
[WARNING][VTK] 20.11.2017 12:10:53 [vtkObserverManager (0000022C6C7AA4F0)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkObserverManager.cxx:131) - The same object is already observed with the same priority. The observation is kept as is.
[WARNING][VTK] 20.11.2017 12:10:53 [vtkObserverManager (0000022C6C7AA4F0)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkObserverManager.cxx:131) - The same object is already observed with the same priority. The observation is kept as is.
[INFO][Stream] 20.11.2017 12:10:53 [] (unknown:0) - [0, 0, 0]
[WARNING][VTK] 20.11.2017 12:10:53 [vtkObserverManager (0000022C6C7AA4F0)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkObserverManager.cxx:131) - The same object is already observed with the same priority. The observation is kept as is.
[DEBUG][Qt] 20.11.2017 12:10:59 [] (unknown:0) - Found CommandLine Module, target is C:/Program Files/Slicer 4.9.0-2017-11-14/lib/Slicer-4.9/cli-modules/ResampleScalarVectorDWIVolume.exe
[DEBUG][Qt] 20.11.2017 12:10:59 [] (unknown:0) - ModuleType: CommandLineModule
[DEBUG][Qt] 20.11.2017 12:11:00 [] (unknown:0) - Resample Scalar/Vector/DWI Volume command line:

C:/Program Files/Slicer 4.9.0-2017-11-14/lib/Slicer-4.9/cli-modules/ResampleScalarVectorDWIVolume.exe --hfieldtype h-Field --interpolation linear --transform_order output-to-input --image_center input --spacing 0.38085949420929,0.38085949420929,0.38085949420929 --size 52,52,52 --origin 9.71192,9.71192,-9.71192 --direction_matrix -1,0,0,0,-1,0,0,0,1 --number_of_thread 0 --default_pixel_value 0 --window_function c --spline_order 3 --transform_matrix 1,0,0,0,1,0,0,0,1,0,0,0 --transform a C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/FFFG_vtkMRMLScalarVolumeNodeB.nrrd C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/FFFG_vtkMRMLScalarVolumeNodeC.nrrd
[DEBUG][Qt] 20.11.2017 12:11:01 [] (unknown:0) - Resample Scalar/Vector/DWI Volume completed without errors
[WARNING][VTK] 20.11.2017 12:11:01 [vtkSlicerCLIModuleLogic (0000022C67048380)] (D:\D\N\Slicer-1\Base\QTCLI\vtkSlicerCLIModuleLogic.cxx:2556) - Unable to delete temporary file C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/FFFG_vtkMRMLScalarVolumeNodeB.nrrd
[INFO][VTK] 20.11.2017 12:11:01 [vtkMRMLVolumeArchetypeStorageNode (0000022C6C68A7F0)] (D:\D\N\Slicer-1\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: C:/Users/LONJAR~1/AppData/Local/Temp/Slicer/FFFG_vtkMRMLScalarVolumeNodeC.nrrd. Dimensions: 52x52x52. Number of components: 1. Pixel type: int.
[INFO][Stream] 20.11.2017 12:11:01 [] (unknown:0) - -> onExit - current [DefineROI] - goingTo [Landmarks]

Log should be available for all sessions, even when there is a crash. Can you find that log? Does Slicer always fail to start up or just sometimes, randomly?

No way to find this log, at least in the folder c:\Users[USER]\AppData\Local\Temp\Slicer.
I understand that logs should be available for all sessions but apparently, in my case, Slicer crashed just before to create the log file. In total, since last week, Slicer Failed to start up 3 times but it is difficult to say if it was random or not. I was intensively closing and opening it for my development, that’s it.
Each time, it worked perfectly after reinstallation. Just to know, these reinstallation were just made from the windows configuration Panel, so a lot of files (like the logs…) were still in my hard drive.
If there is a logic in these failures, Slicer should not be able to start at some point tomorrow. If it is the case I will again double-check the logs and let you know if I find anything.
I really don’t understand this problem since I was doing nothing unusual before each failure…

Ok so again Slicer failed to start up 5 min ago.
If it is not random, it is faster and faster to fail. But maybe it is random.

Again, there is no log file for this session… And the previous log file doe not show any weird behaviour.
When I closes Slicer during the previous session, no error was indicated. I don’t think my modification on a module are affecting this, since the modules are loaded at the end, then after the time when my Slicer fail. And when all is working, code errors are well indicated in the python console, as expected.

Any clue on what could be the problem ? Do I do something wrong with my development (opening and closing the soft multiple times?)

Please follow these instructions for troubleshooting application startup problems:

https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Troubleshooting#Debugging_Slicer_application_startup_issues

Thank you for your answers Andreas.
I followed the first steps of troubleshooting instructions without success but then I figured out that my bug does not appear anymore with the newest release of the Nighty build.

I just have sometimes a slow starting time when I launch Slicer, but nothing problematic.
Of course, I shall follow the previous instructions if I ever found another problem.

Thank you anyway,

1 Like

anyone facing the issues that the Slicer crashes when trying to load or undo any operations ?
I am using slicer 4.8.1 and windows 10 OS for the segmentation .

Is there any issues with the graphics card ? Not sure if this is related

The only known reason Slicer would crash is when it runs out of memory (like all other applications). You can reduce the image size by cropping and/or resampling using Crop volume module. You may also upgrade to a recent Slicer Preview release, which contains several memory usage optimizations.

May I know how to resample sing crop volume module ?

Thanks

See documentation here: https://www.slicer.org/wiki/Documentation/Nightly/Modules/Crop_Volume