Skip to content

Commit

Permalink
BUG: Initialize itk::ExhaustiveOptimizer ivars
Browse files Browse the repository at this point in the history
Initialize `itk::ExhaustiveOptimizer` ivars.

Fixes:
```
UMR ==19790== Use of uninitialised value of size 8
==19790==    at 0x64AD10B: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==19790==    by 0x64AD7AD:
std::ostreambuf_iterator > std::num_put > >
::_M_insert_int(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long)
const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==19790==    by 0x64BC00E:
std::ostream& std::ostream::_M_insert(unsigned long)
(in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==19790==    by 0x489F39F:
itk::ExhaustiveOptimizer::PrintSelf(std::ostream&, itk::Indent)
const (itkExhaustiveOptimizer.cxx:227)
==19790==    by 0x535CB19:
itk::LightObject::Print(std::ostream&, itk::Indent)
const (itkLightObject.cxx:125)
==19790==    by 0x164F7E:
itkExhaustiveOptimizerTest(int, char**)
(itkExhaustiveOptimizerTest.cxx:158)
==19790==    by 0x12F2E7:
main (ITKOptimizersTestDriver.cxx:222)
```

Raised for example in:
https://open.cdash.org/viewDynamicAnalysisFile.php?id=9067994
  • Loading branch information
jhlegarreta authored and hjmjohnson committed Jan 16, 2022
1 parent c935325 commit bd55ef3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/Numerics/Optimizers/include/itkExhaustiveOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ class ITKOptimizers_EXPORT ExhaustiveOptimizer : public SingleValuedNonLinearOpt

ParametersType m_CurrentIndex;

SizeValueType m_MaximumNumberOfIterations;
SizeValueType m_MaximumNumberOfIterations{ 1 };

MeasureType m_MaximumMetricValue;
MeasureType m_MaximumMetricValue{ itk::NumericTraits<MeasureType>::max() };

MeasureType m_MinimumMetricValue;

Expand Down

0 comments on commit bd55ef3

Please sign in to comment.