Closed hjmjohnson closed 1 month ago
@malaterre I don't have proof, but I feel that this is a compiler optimization bug where the logic of the function is incorrectly compiled away. In Release and RelWithDebInfo compilations the function always returns false and does not seem to perform the DES.find() function.
Given the commented out line that explicitly assigned an iterator, it feels like perhaps this has been a problem in the past as well.
My workaround allows the test to pass reliably in all compilation modes and seems like a reasonable approach to solving the same problem.
If you agree that this is an acceptable approach, I'll work on making and upstream GDCM patch.
@thewtex I don't know how to deal with the clang-format failure. It would require a lot of changes to that file that are unrelated.
@hjmjohnson we should ignore the clang-format warning for this PR, editing the GDCM sources. After the v5.4.0 I will make improvements to the linting infrastructure. Ideally, we get this into upstream GDCM before merging, as you suggested, but we can merge as-is if there is insufficient time before the release.
@thewtex @malaterre merged upstream. https://github.com/malaterre/GDCM/pull/173.
Matt, I'll let you determine the best approach.
1). add this patch now, and then update GDCM after 5.4.0 2) update GDCM now, close this PR without merging.
@hjmjohnson @malaterre awesome, thank you for getting these issues resolved!
We should update GDCM from upstream in ITK. We want to:
@hjmjohnson if you have the cycles and interest, please go ahead. Otherwise, I will start the update Monday.
Three tests fail in ITK for Release and RelWithDebInfo builds on Ubuntu 24.04 with GCC 13.2: itkGDCMLegacyMultiFrameTest (Failed) itkGDCMImageReadWriteTest_MultiFrameMRIZSpacing (Failed) itkGDCM_ComplianceTest_singlebit (Failed)
(Note: Debug builds do not fail these tests)
The initial review of the code did not indicate a problem, but it looks like perhaps an over-optimization that removes variables and causes the incorrect behavior to occur.
The function "FindDataElement" had duplicate code from "GetDataElement" so made "FindDataElement" use the "GetDataElement" working function.
PR Checklist