Skip to content
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

MetaIO valgrind issues #895

Open
thewtex opened this issue May 17, 2019 · 3 comments

Comments

Projects
None yet
3 participants

@thewtex thewtex added the type:Bug label May 17, 2019

@thewtex thewtex added this to the ITK v5.0.0 milestone May 17, 2019

@dzenanz

This comment has been minimized.

Copy link
Member

commented May 17, 2019

Most of these manifested issues seem to point to the same location in ZLIB. I don't know whether this is a bug or a false positive.

UMC ==1612== Conditional jump or move depends on uninitialised value(s)
==1612==    at 0x7CEA34A: slide_hash (deflate.c:219)
==1612==    by 0x7CED38D: fill_window (deflate.c:1516)
==1612==    by 0x7CEDF8A: deflate_fast (deflate.c:1838)
==1612==    by 0x7CEC54D: itkzlib_deflate (deflate.c:1000)
==1612==    by 0x4140825: MET_PerformCompression(unsigned char const*, long, long*, int) (metaUtils.cxx:723)
==1612==    by 0x416C869: MetaImage::WriteStream(std::basic_ofstream >*, bool, void const*) (metaImage.cxx:1684)
==1612==    by 0x416C540: MetaImage::Write(char const*, char const*, bool, void const*, bool) (metaImage.cxx:1647)
==1612==    by 0x40B0C18: itk::MetaImageIO::Write(void const*) (itkMetaImageIO.cxx:1128)
==1612==    by 0x2A6F82: itk::ImageFileWriter >::GenerateData() (itkImageFileWriter.hxx:409)
==1612==    by 0x2A61F8: itk::ImageFileWriter >::Write() (itkImageFileWriter.hxx:343)
==1612==    by 0x2A44D4: itk::ImageFileWriter >::Update() (itkImageFileWriter.h:167)
==1612==    by 0x2AC654: (anonymous namespace)::ActualTest(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, bool, bool, bool, int) (itkImageFileWriterStreamingPastingCompressingTest1.cxx:173)
==1612==    by 0x2AD289: itkImageFileWriterStreamingPastingCompressingTest1(int, char**) (itkImageFileWriterStreamingPastingCompressingTest1.cxx:266)
==1612==    by 0x1AEE44: main (ITKIOImageBaseTestDriver.cxx:306)

The most likely cause is change of default compression level from 6 to 2. We are up-to-date with ZLIB version, so I don't know what to do.

@dzenanz

This comment has been minimized.

Copy link
Member

commented May 17, 2019

I inspected this, and could not find a problem. @blowekamp can you suppress this? The other one goes into standard library:

UMR ==1459== Syscall param write(buf) points to uninitialised byte(s)
==1459==    at 0x54ED154: write (write.c:27)
==1459==    by 0x4EEFC85: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F2C1E0: std::basic_filebuf >::_M_convert_to_external(char*, long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F2C627: std::basic_filebuf >::overflow(int) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F2C350: std::basic_filebuf >::_M_terminate_output() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F2F62C: std::basic_filebuf >::close() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F3135C: std::basic_ofstream >::close() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x40E765D: MetaObject::Write(char const*) (metaObject.cxx:372)
==1459==    by 0x10A813: main (testMeta6Surface.cxx:62)
==1459==  Address 0x5d47824 is 36 bytes inside a block of size 8,192 alloc'd
==1459==    at 0x4C3089F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1459==    by 0x4F2C097: std::basic_filebuf >::_M_allocate_internal_buffer() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F301B1: std::basic_filebuf >::open(char const*, std::_Ios_Openmode) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x4F302D2: std::basic_ofstream >::open(std::__cxx11::basic_string, std::allocator > const&, std::_Ios_Openmode) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==1459==    by 0x40E760D: MetaObject::Write(char const*) (metaObject.cxx:361)
==1459==    by 0x10A813: main (testMeta6Surface.cxx:62)

and should be suppressed too.

@dzenanz dzenanz modified the milestones: ITK v5.0.0, ITK v5.1.0 May 17, 2019

@blowekamp

This comment has been minimized.

Copy link
Member

commented May 20, 2019

This is a genuine defect. Due to accessing an array out of bounds. See patch #922, which guards against the access.

dzenanz added a commit to dzenanz/MetaIO that referenced this issue May 20, 2019

dzenanz added a commit to dzenanz/MetaIO that referenced this issue May 20, 2019

dzenanz added a commit to dzenanz/MetaIO that referenced this issue May 20, 2019

blowekamp added a commit to dzenanz/MetaIO that referenced this issue May 21, 2019

@dzenanz dzenanz referenced this issue May 21, 2019

Merged

Update MetaIO #935

8 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.