-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slicer crashes on Windows when volume with NaN voxel value is loaded #7737
Comments
The crash could be fixed in VTK by adding an explicit
|
If this crashes with an officially supported compiler then IMO it would be better to fix it rather than waiting for a compiler fix. Research codes sometimes generate NaNs. But it's not a super high priority for me. |
Yes, this crash happens with the latest MSVC compiler. A new version is expected within a few months, which may or may not have a fix for this. |
Summary
Slicer crashes when attempting to load a volume that has some NaN-valued voxels.
The crash is reproducible with vtkSlicerVolumesLogicTest1_TestNAN test, which fails on Windows since February 2024 due to a crash in VTK's
vtkImageHistogramExecute
function invtkImageHistogram.cxx
. This code should return a value between xmin and xmax if x is nan:However, x remains nan, therefore
xi
bin index is set to a negative number, and sooutPtr[xi]++;
causes access violation. x remains nan due to an MSVC compiler bug: https://stackoverflow.com/questions/77799136/msvc-2022-wrong-optimization-of-maxnan-somenumberSteps to reproduce
Load testNANInVolume.nrrd => Slicer crashes
Run vtkSlicerVolumesLogicTest1_TestNAN test => fails (for example: https://slicer.cdash.org/tests/27309466)
Environment
The text was updated successfully, but these errors were encountered: