MantisBT - ITK
View Issue Details
0007594ITKpublic2008-09-02 21:512010-10-21 12:31
Yulia Arzhaeva 
Ivan Macia 
normalcrashalways
closedunable to reproduce 
ITK-3-6 
ITK-3-18 
0007594: Crash when writing the output of an " In Place" filter with the InPlace feature ON. Happens with TIFF images.
The program in the attached file crashes when the input is a *.tif image. The program does a simple thresholding "in place". I found out that the crash has nothing to do with filtering but with writing an output image in a file. Although, it's not possible to catch it as an exception - the error happens because a null pointer is addressed within one of the functions called inside TIFFImageIO::Read().

I've done a bit of debugging and that is what I've found. In a pipeline,
that connects a reader with a filter with a writer, calling
writer->Update() causes an update of a reader, because, with
filter->InPlaceOn(), the filter input gets released. For tif images,
TIFFImageIO::Read() is called, which uses m_InternalImage that is
supposed to have a non-null pointer m_Image to an allocated piece of
memory. m_InternalImage is filled in TIFFImageIO::CanReadFile(), which
is not called the second time, as a part of writer->Update() procedure.
As a result, m_InternalImage->m_Image points to NULL, and causes the
runtime error when addressed in TIFFImageIO::Read(). If one includes
filter->GetOutput()->DisconnectPipeline() before calling
writer->Update(), no error occurs because no input image update occurs.
No tags attached.
cxx itkInPlaceFilterTest.cxx (2,153) 2008-09-02 21:51
https://public.kitware.com/Bug/file/1698/itkInPlaceFilterTest.cxx
Issue History
2008-09-02 21:51Yulia ArzhaevaNew Issue
2008-09-02 21:51Yulia ArzhaevaFile Added: itkInPlaceFilterTest.cxx
2010-06-16 17:52Ivan MaciaStatusnew => assigned
2010-06-16 17:52Ivan MaciaAssigned To => Ivan Macia
2010-06-16 18:09Ivan MaciaNote Added: 0021051
2010-06-16 18:09Ivan MaciaStatusassigned => resolved
2010-06-16 18:09Ivan MaciaFixed in Version => ITK-3-18
2010-06-16 18:09Ivan MaciaResolutionopen => unable to reproduce
2010-10-21 12:31Gabe HartStatusresolved => closed

Notes
(0021051)
Ivan Macia   
2010-06-16 18:09   
I was unable to reproduce the behaviour with the provided example and latest CVS version (3.19). Checked in Win32 - VS2008 Express. TIFFImageIO::Read() is not called the second time.