Page MenuHomePhabricator

Crash of MITK Workbench on startup if NavigationModules are enabled
Closed, ResolvedPublic

Description

When building MITK using the build configuration "NavigationModules", the resulting MITK Workbench application crashes on first start. Any following startups work.

Event Timeline

seitela triaged this task as High priority.Feb 2 2018, 5:11 PM
seitela created this task.
seitela moved this task from Backlog to Wishlist on the IGT board.

Problem can be narrowed down to the activation of plugin UltrasoundSupport and its depending modules. It seems to have to do with the persistence framework used for US devices. See following application log:

Mon Feb 5 12:25:00 2018
6.11 core.mod.us.devicepersistence: Input String: Unknown Manufacturer|Unknown Model|None|0|none|1|0|0|0|0|0|0|0|default$0%1%1%0
6.13 core.mod.us.devicepersistence: Restoring 1 US devices.
6.14 core.mod.us.device: Control interface Probes does not exist for this object.
6.16 core.mod.us.devicepersistence: Trying to save 1 US devices.
6.17 core.mod.us.devicepersistence: Output String: Unknown Manufacturer|Unknown Model|None|0|none|1|0|0|0|0|0|0|0|default$0%1%1%0
6.20 core.mod.us.devicepersistence: Successfully saved 1 US devices.
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.LogLevel=2 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:215
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.CacheSize=30 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:217
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.ThreadPoolSize=20 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:219
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.Timeout=5000 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:221
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.RequireTopic=true in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:223
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.LogLevel=2 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:215
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.CacheSize=30 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:217
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.ThreadPoolSize=20 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:219
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.Timeout=5000 in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:221
Mo Feb 5 12:25:00 2018 Debug: org.commontk.eventadmin.RequireTopic=true in ctkEAConfiguration::startOrUpdate, D:\dev\MITKb_x64\ep\src\CTK\Plugins\org.commontk.eventadmin\ctkEAConfiguration.cpp:223
6.47 core.mod.core.log: Logfile: C:/Users/seitela/AppData/Local/DKFZ/MITK Workbench_1563284860/data/9/mitk-0.log

eisenman moved this task from Wishlist to In Progress on the IGT board.
seitela added a project: Restricted Project.Feb 15 2018, 6:03 PM

The persistence framework seems to work fine. The segmentation fault occurs in file berryQtStyleManager.cpp (l. 357) when calling

qApp->setStyleSheet(currentStyle->stylesheet);

The stylesheet is initialized correctly (the workbench successfully starts the second time). I tried to use the light theme as default and the workbench also crashed the first time.

I can confirm that the issue does not occur if the ultrasound plugin is disabled.

When disabling line 69 (m_Controls->setupUi(parent);) in file QmitkUltrasoundSupport.cpp and the body of QmitkUltrasoundSupport::CreateControlWidgets(), the workbench starts successfully.

This needs to be further investigated...

When enabling line 69 (m_Controls->setupUi(parent);) in file QmitkUltrasoundSupport.cpp again, and removing both QmitkUSDeviceManagerWidget and QmitkUSNewVideoDeviceWidget from QmitkUltrasoundSupportControls.ui, the workbench also starts successfully. QmitkServiceListWidget (which is the third custom QWidget used in QmitkUltrasoundSupportControls.ui) does not have to be removed.

Crash seems to be related to the registration of multiple USUICustomWidgetFactory instances in USUIActivator.cpp. It has to be investigated how the factory can be used to correctly provide the CustomDeviceWidget for the current widget.
When only having one factory, the application does not crash anymore. However, it couldn't be tested yet whether the CustomDeviceWidget shows up correctly for all devices.