You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadlinetype:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances
Null passed to callee requiring non-null 1st parameter
✅ Fixed — added null check with itkExceptionMacro after ReadHeader (PR #5940)
Dead store findings (75 total)
The vast majority (75/91) are deadcode.DeadStores — variables written but never read. Analysis shows ~43 are false positives where the analyzer loses track of variables used far from their assignment or across complex conditional paths. The remaining ~32 are genuine dead stores split into categories:
Production code (3 files): ✅ Fixed — removed dead stores in itkPoolMultiThreader.cxx, itkCSVFileReaderBase.cxx, and itkGiftiMeshIO.cxx (PR #5940)
Test code (14 files): ✅ Fixed — removed dead stores via early-return, |= accumulation, direct initialization, ITK_TRY_EXPECT_EXCEPTION macro, and moving variables to narrower scope (PR #5940)
Many of the same dead-store patterns in test files remain from the original clang-8 report. Notable new findings not present in 2019:
cplusplus.Move in itkArray2DGTest.cxx (a new test file)
core.BitwiseShift in itkTIFFImageIO.cxx
core.uninitialized.* in itkDataObject.cxx and itkObject.cxx
nullability.NullPassedToNonnull in itkIPLCommonImageIO.cxx
The itkSmartPointer.h use-after-free findings (also present in the 2019 report) appear to be false positives triggered by the smart pointer reference-counting pattern.
status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadlinetype:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances
Activity
gdevenyi commentedon Sep 18, 2019
Copy and paste from the index.html, for the non-thirdparty lines:
stale commentedon Jan 16, 2020
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
hjmjohnson commentedon Mar 9, 2026
clang-22 scan-build report (2026-03-09)
Updated analysis using LLVM/clang 22.1.0 (
analyze-build) against the current ITKmainbranch.Modules/ThirdPartyis excluded from all results below.Tool:
analyze-buildfrom LLVM 22.1.0 homebrewBuild config:
cmake-build-clangtidy-22(all modules enabled,BUILD_TESTING=ON,BUILD_EXAMPLES=ON)SARIF output:
/tmp/itk-scan-build-20260309/Summary
deadcode.DeadStorescore.uninitialized.UndefReturncore.CallAndMessagecplusplus.NewDeletecore.UndefinedBinaryOperatorResultcore.DivideZerocore.uninitialized.Assignnullability.NullPassedToNonnullcore.NullDereferencecore.BitwiseShiftcplusplus.MoveModules/NumericsModules/IOModules/CoreModules/FilteringModules/SegmentationModules/RegistrationHigh-priority findings (non-dead-store)
These 16 findings represent potentially real bugs:
core.BitwiseShiftModules/IO/TIFF/src/itkTIFFImageIO.cxxbps > 16guard per TIFF spec and fixed operator precedence bug (1 << (bps*2)→(1 << bps) * sizeof(uint16_t)) (PR #5940)core.CallAndMessageModules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshLineCell.hxxGetNumberOfPoints()in test (PR #5940)core.CallAndMessageModules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshLineCell.hxxGetNumberOfPoints()in test (PR #5940)core.CallAndMessageModules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshPolygonCell.hxxcore.DivideZeroModules/Numerics/Optimizers/src/itkCumulativeGaussianCostFunction.cxxnumberOfElements == 0first, helping analyzer verify the division-by-zero guard (PR #5940)core.NullDereferenceModules/IO/IPL/src/itkIPLCommonImageIO.cxxcontinueafterReadHeaderin directory scan loop (PR #5940)core.UndefinedBinaryOperatorResultModules/Core/Common/src/itkDataObject.cxx==is a garbage valueSingleton<T>()now usesnew T{}(value-initialization) instead ofnew T(PR #5940)core.uninitialized.AssignModules/IO/MeshBase/include/itkMeshIOBase.hmake_unique_for_overwritetostd::make_unique(value-initialization) (PR #5940)core.uninitialized.UndefReturnModules/Core/Common/src/itkDataObject.cxxSingleton<T>()now usesnew T{}(value-initialization) instead ofnew T(PR #5940)core.uninitialized.UndefReturnModules/Core/Common/src/itkObject.cxxSingleton<T>()now usesnew T{}(value-initialization) instead ofnew T(PR #5940)core.uninitialized.UndefReturnModules/IO/Meta/src/itkMetaImageIO.cxxSingleton<T>()now usesnew T{}(value-initialization) instead ofnew T(PR #5940)cplusplus.MoveModules/Core/Common/test/itkArray2DGTest.cxxoriginalNOLINTNEXTLINE(PR #5940)cplusplus.NewDeleteModules/Core/Common/include/itkSmartPointer.hcplusplus.NewDeleteModules/Core/Common/include/itkSmartPointer.hcplusplus.NewDeleteModules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshCellInterfaceTest.cxxnumberOfPoints > 0check (PR #5940)nullability.NullPassedToNonnullModules/IO/IPL/src/itkIPLCommonImageIO.cxxitkExceptionMacroafterReadHeader(PR #5940)Dead store findings (75 total)
The vast majority (75/91) are
deadcode.DeadStores— variables written but never read. Analysis shows ~43 are false positives where the analyzer loses track of variables used far from their assignment or across complex conditional paths. The remaining ~32 are genuine dead stores split into categories:Production code (3 files): ✅ Fixed — removed dead stores in
itkPoolMultiThreader.cxx,itkCSVFileReaderBase.cxx, anditkGiftiMeshIO.cxx(PR #5940)Test code (14 files): ✅ Fixed — removed dead stores via early-return,
|=accumulation, direct initialization,ITK_TRY_EXPECT_EXCEPTIONmacro, and moving variables to narrower scope (PR #5940)Full dead-store list
Modules/Core/Common/src/itkPoolMultiThreader.cxxtotalModules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxxresultModules/Core/Common/test/itkVariableLengthVectorTest.cxxstartModules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxxtestStatusModules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxxoptimizerInitialRadiusModules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxxtestPassedModules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxxtestPassedModules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxxtestPassedModules/Filtering/Path/test/itkHilbertPathTest.cxxtestStatusModules/IO/BMP/test/itkBMPImageIOTestPalette.cxxisPaletteImageModules/IO/CSV/src/itkCSVFileReaderBase.cxxOnANewLineModules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxxexpectedToStreamModules/IO/MeshBYU/test/itkBYUMeshIOTest.cxxtestStatusModules/IO/MeshBYU/test/itkMeshFileReadWriteTest.cxxresultModules/IO/MeshGifti/src/itkGiftiMeshIO.cxxcompType,pixelTypeModules/IO/MeshGifti/test/itkGiftiMeshIOTest.cxxtestStatusModules/IO/MeshOBJ/test/itkOBJMeshIOTest.cxxtestStatusModules/IO/MeshOFF/test/itkOFFMeshIOTest.cxxtestStatusModules/IO/MeshVTK/test/itkVTKPolyDataMeshIOTest.cxxtestStatusModules/IO/NIFTI/test/itkNiftiReadWriteDirectionTest.cxxsformPermissiveAngleThresholdModules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxxtestStatusModules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxxstatusModules/Numerics/Statistics/test/itkGaussianDistributionTest.cxxstatusModules/Numerics/Statistics/test/itkHistogramTest.cxxtotalSizeModules/Numerics/Statistics/test/itkImageToListSampleFilterTest.cxxpassModules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxxexceptionsProperlyCaughtModules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxxpassedModules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxxpassedModules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxxpassedModules/Numerics/Statistics/test/itkSubsampleTest.cxxtotalSizeModules/Numerics/Statistics/test/itkTDistributionTest.cxxstatusModules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxxsuccess&=accumulatorModules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxxorigGlobalWarningValueModules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxxtheoreticalValue,valueComparison with clang-8 report (2019)
Many of the same dead-store patterns in test files remain from the original clang-8 report. Notable new findings not present in 2019:
cplusplus.MoveinitkArray2DGTest.cxx(a new test file)core.BitwiseShiftinitkTIFFImageIO.cxxcore.uninitialized.*initkDataObject.cxxanditkObject.cxxnullability.NullPassedToNonnullinitkIPLCommonImageIO.cxxThe
itkSmartPointer.huse-after-free findings (also present in the 2019 report) appear to be false positives triggered by the smart pointer reference-counting pattern.BUG: Guard zero-sized allocation in QuadEdgeMesh cell interface test
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
BUG: Value-initialize cell data buffers in OBJ and OFF mesh readers
BUG: Fix operator precedence and UB in TIFF palette allocation
BUG: Guard zero-sized allocation in QuadEdgeMesh cell interface test
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
26 remaining items
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
BUG: Guard zero-sized allocation in QuadEdgeMesh cell interface test
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
BUG: Fix operator precedence and UB in TIFF palette allocation
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
BUG: Guard zero-sized allocation in QuadEdgeMesh cell interface test
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values
BUG: Fix operator precedence and UB in TIFF palette allocation
BUG: Add null checks after ReadHeader in IPLCommonImageIO
BUG: Value-initialize singleton instances to avoid indeterminate values