[ITK] Win64 Visual Studio 12 segfaults

Matt McCormick matt.mccormick at kitware.com
Fri Jan 9 10:34:54 EST 2015


Hi Niels,

Great news!

This same strategy was used to to fix some of the other failing tests
[1]. While it should not strictly be necessary, it does hurt to
improve our const-correctness and memory usage anyway.  Please
consider submitting a patch for these changes [2].

Thanks,
Matt


[1]  http://itk.org/gitweb?p=ITK.git;a=blobdiff;f=Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx;h=fca11a3eea3f885411192fd942c674cbba30c604;hp=86c3985601ff24ee36f6a0972be11573dfcc277c;hb=b92b952b98bee6dfc3837f4ed5d600e637cdcda9;hpb=7170ea77a918d268dd1971244ceb41b6d3518e21

[2] https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html

On Fri, Jan 9, 2015 at 10:28 AM, Niels Dekker <niels-xtk at xs4all.nl> wrote:
> Floris and I did some testing on how to work around this Visual C++
> compiler bug. It looks like the crashes (segfaults) in both
> FiniteDifferenceImageFilter::InitializeFunctionCoefficients() and
> ImageRegion::IsInside(const Self&) disappear when a local object is
> replaced by a const-reference.
>
> In "Core\FiniteDifference\include\itkFiniteDifferenceImageFilter.hxx"
> (line 273):
>
>  - const SpacingType spacing = outputImage->GetSpacing();
>  + const SpacingType & spacing = outputImage->GetSpacing();
>
>
> In "Core\Common\include\itkImageRegion.h" (line 260):
>
>  - SizeType&  size = region.GetSize();
>  + const SizeType & size = region.GetSize();
>
>
> I must admit I don't know why such a modification actually does suppress
> the crashes. But it seems to do the job! What do you think?
>
> Kind regards, Niels
>


More information about the Community mailing list