Page MenuHomePhabricator

Assertion failure in GDCM in MitkCore unit test
Closed, ResolvedPublic

Description

I have seen it with our MITK-based app first, but I could reproduce it with the current MITK master as well.

This used to work. Did it brake with a GDCM upgrade or it's some wrong configuration on my system?

This is on Mac 10.11, El Capitan.

CTest output below.

Start testing: Sep 19 16:20 BST
----------------------------------------------------------
114/352 Testing: mitkRotatedSlice4DTest
114/352 Test: mitkRotatedSlice4DTest
Command: "/Users/mespak/src/mitk-master-debug/MITK-build/bin/MitkCoreTestDriver" "mitkRotatedSlice4DTest" "/Users/mespak/src/mitk-master-debug/MITK-Data/UltrasoundImages/4D_TEE_Data_MV.dcm"
Directory: /Users/mespak/src/mitk-master-debug/MITK-build/Modules/Core/test
"mitkRotatedSlice4DTest" start time: Sep 19 16:20 BST
Output:
----------------------------------------------------------
Assertion failed: (GetVR().Compatible( de.GetVR() ) || de.GetVR() == VR::INVALID), function SetFromDataElement, file /Users/mespak/src/mitk-master-debug/ep/src/GDCM/Source/DataStructureAndEncodingDefinition/gdcmAttribute.h, line 445.
<end of output>
Test time =  17.25 sec
----------------------------------------------------------
Test Failed.
"mitkRotatedSlice4DTest" end time: Sep 19 16:20 BST
"mitkRotatedSlice4DTest" time elapsed: 00:00:17
----------------------------------------------------------

End testing: Sep 19 16:20 BST

MITK =  17.25 sec

MITK-Core =  17.25 sec

Event Timeline

Several other unit tests fail with the same error:

114 - mitkRotatedSlice4DTest (OTHER_FAULT)
137 - mitkDicomSeriesReaderTest_CTImage (OTHER_FAULT)
161 - mitkDCMTestingSanityTest_CTImage (OTHER_FAULT)
162 - mitkDCMTestingSanityTest_MRImage (OTHER_FAULT)
163 - mitkDCMTestingSanityTest_SCImage (OTHER_FAULT)
164 - mitkDCMTestingSanityTest_NoImagePositionPatient (OTHER_FAULT)
165 - mitkDCMPreloadedVolumeTest_Slice (OTHER_FAULT)
179 - DCM_Load_head_ct_tilt (OTHER_FAULT)
180 - DCM_Load_tilted_gantry_one_block (OTHER_FAULT)
181 - DCM_Load_tilted_gantry_synthetic (OTHER_FAULT)
182 - DCM_Load_tilted_gantry_synthetic_2 (OTHER_FAULT)
183 - DCM_Load_tilted_gantry_two_blocks (OTHER_FAULT)
184 - DCM_Load_basic (OTHER_FAULT)

214 - mitkDICOMITKSeriesGDCMReaderBasicsTest_Basics (OTHER_FAULT)
216 - mitkDICOMTestingSanityTest_CTImage (OTHER_FAULT)
217 - mitkDICOMTestingSanityTest_MRImage (OTHER_FAULT)
218 - mitkDICOMTestingSanityTest_SCImage (OTHER_FAULT)
219 - mitkDICOMTestingSanityTest_NoImagePositionPatient (OTHER_FAULT)
220 - mitkDICOMPreloadedVolumeTest_Slice (OTHER_FAULT)
234 - DICOM_Load_head_ct_tilt (OTHER_FAULT)
235 - DICOM_Load_tilted_gantry_one_block (OTHER_FAULT)
236 - DICOM_Load_tilted_gantry_synthetic (OTHER_FAULT)
237 - DICOM_Load_tilted_gantry_synthetic_2 (OTHER_FAULT)
238 - DICOM_Load_tilted_gantry_two_blocks (OTHER_FAULT)
239 - DICOM_Load_basic (OTHER_FAULT)
255 - mitkViewportRenderingTest_rSvSwS (OTHER_FAULT)
256 - mitkViewportRenderingTest_rSvSwL (OTHER_FAULT)
257 - mitkViewportRenderingTest_rSvSwP (OTHER_FAULT)
258 - mitkViewportRenderingTest_rSvLwS (OTHER_FAULT)
259 - mitkViewportRenderingTest_rSvLwL (OTHER_FAULT)
260 - mitkViewportRenderingTest_rSvLwP (OTHER_FAULT)
261 - mitkViewportRenderingTest_rSvPwS (OTHER_FAULT)
262 - mitkViewportRenderingTest_rSvPwL (OTHER_FAULT)
263 - mitkViewportRenderingTest_rSvPwP (OTHER_FAULT)
264 - mitkViewportRenderingTest_rLvSwS (OTHER_FAULT)
265 - mitkViewportRenderingTest_rLvSwL (OTHER_FAULT)
266 - mitkViewportRenderingTest_rLvSwP (OTHER_FAULT)
267 - mitkViewportRenderingTest_rLvLwS (OTHER_FAULT)
268 - mitkViewportRenderingTest_rLvLwL (OTHER_FAULT)
269 - mitkViewportRenderingTest_rLvLwP (OTHER_FAULT)
270 - mitkViewportRenderingTest_rLvPwS (OTHER_FAULT)
271 - mitkViewportRenderingTest_rLvPwL (OTHER_FAULT)
272 - mitkViewportRenderingTest_rLvPwP (OTHER_FAULT)
273 - mitkViewportRenderingTest_rPvSwS (OTHER_FAULT)
274 - mitkViewportRenderingTest_rPvSwL (OTHER_FAULT)
275 - mitkViewportRenderingTest_rPvSwP (OTHER_FAULT)
276 - mitkViewportRenderingTest_rPvLwS (OTHER_FAULT)
277 - mitkViewportRenderingTest_rPvLwL (OTHER_FAULT)
278 - mitkViewportRenderingTest_rPvLwP (OTHER_FAULT)
279 - mitkViewportRenderingTest_rPvPwS (OTHER_FAULT)
280 - mitkViewportRenderingTest_rPvPwL (OTHER_FAULT)
281 - mitkViewportRenderingTest_rPvPwP (OTHER_FAULT)
283 - mitkImageStatisticsCalculatorTest (OTHER_FAULT)

goch added a subscriber: goch.

We currently do not have a lot of (read, basically no active) developers on mac, so it might take a bit to get someone on this. Have you been able to reproduce this on other OSes?

I tried Linux just now. I randomly picked a few of the tests and they all passed.

I will try to rebuild MITK on Mac 10.11 using the 10.10 system environment to see if that helps.

Can you load "/Users/mespak/src/mitk-master-debug/MITK-Data/UltrasoundImages/4D_TEE_Data_MV.dcm" without issue?

A similar problem has been reported on the mailing list.

https://www.mail-archive.com/mitk-users@lists.sourceforge.net/msg06753.html

The suggested solution was to build MITK in release mode, as then the assertions are not processed.

What about building only GDCM in release mode even if MITK is built in debug mode? At least on Mac?

I give it a try.

On Linux I get this error when trying to run MitkWorkbench from the current master:

espakm@pass:~/src/mitk-master-debug/MITK-build > bin/MitkWorkbench ../MITK-Data/UltrasoundImages/4D_TEE_Data_MV.dcm 
Pre-loading library "liborg_mitk_gui_qt_ext" failed: "Cannot load library liborg_mitk_gui_qt_ext: (liborg_mitk_gui_qt_ext: cannot open shared object file: No such file or directory)" 
Check your library search paths.
Startup error: ctkPluginException: The plugin "/home/espakm/src/mitk-master-debug/MITK-build/lib/plugins/liborg_mitk_gui_qt_common.so" could not be loaded: Cannot load library /home/espakm/src/mitk-master-debug/MITK-build/lib/plugins/liborg_mitk_gui_qt_common.so: (/home/espakm/src/mitk-master-debug/MITK-build/lib/plugins/liborg_blueberry_core_expressions.so: undefined symbol: _ZN5berry14ElementHandlerD1Ev)

bin/MitkWorkbench: symbol lookup error: /home/espakm/src/mitk-master-debug/MITK-build/lib/plugins/liborg_blueberry_ui_qt.so: undefined symbol: _ZN5berry10ExpressionD2Ev

A similar problem has been reported on the mailing list.

https://www.mail-archive.com/mitk-users@lists.sourceforge.net/msg06753.html

The suggested solution was to build MITK in release mode, as then the assertions are not processed.

What about building only GDCM in release mode even if MITK is built in debug mode? At least on Mac?

Pull request:
https://github.com/MITK/MITK/pull/143

The change disables the assertions in GDCM for debug builds on Mac.

It is tested, it works well.

Looks good to me. Could you sign off the commit?

Weird. I did it yesterday and force pushed the branch.

You can see it here:
https://github.com/MITK/MITK/compare/master...NifTK:bug-19995-disable-assertions-in-gdcm-on-mac

I try to close the pull request and create a new one. Normally, the PR should be updated after forced push.

goch claimed this task.

Thank you for the contribution