MantisBT - VTK
View Issue Details
0003160VTK(No Category)public2006-04-25 02:252016-08-12 09:54
Bernd Hentschel 
David Partyka 
normalminoralways
closedmoved 
 
 
0003160: vtkDataReader crash with VC .NET 2005
Trying to read an "empty" VTK-File (either file or string input), e.g. the representation of an empty vtkPolyData object (no points, no cells, just the header), a test app crashes inside the read operation. The reason for this is the "new" STL-implementation shipped with .NET2005. A lot of calls there are using assertions to ensure proper input parameters. In particular istream::read(*readbuffer,numbytes) now asserts that the input read pointer be != NULL. This caused the crash mentioned above, since eventually a NULL pointer is passed to read (in template <class T> int vtkReadBinaryData(istream *IS, T *data, int numTuples, int numComp)).
In the "old" STL implementation this was no problem. A NULL-pointer was only passed to calls which didn't read anything from the istream either, so in effect nothing was written to the invalid address. I include a possible fix for this here, introducing a sanity check into vtkReadBinaryData in vtkDataReader.cxx, resulting in the code attached to this report.
I got this problem with vtk4.2.6 but it does not seem to be fixed in vtk5 either. Moreover, it is likely that this does not only apply to empty polydata but also to other (empty) data object classes because the respective reader classes also rely on vtkDataReader's functionality.
BTW: Nobody seems to care about the return value of vtkReadBinaryData. I don't know if this should be called a design issue.
No tags attached.
cxx vtkDataReaderFix.cxx (541) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5518/vtkDataReaderFix.cxx
Issue History
2008-11-30 09:10Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 09:54David ColeAssigned ToDavid Cole => David Partyka
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-07-22 20:33Dave DeMarleStatusbacklog => expired
2013-07-22 20:33Dave DeMarleNote Added: 0031298
2016-08-12 09:54Kitware RobotNote Added: 0036860
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0031298)
Dave DeMarle   
2013-07-22 20:33   
Dave P no longer works on the project. If these old issues still exist in 6.0.0, reopen them and assign to Dave DeMarle
(0036860)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.