[vtkusers] vtkExtractVOI + vtkStructuredPointsWriter breakage [FIXED]
Charl P. Botha
c.p.botha at ewi.tudelft.nl
Mon Mar 1 04:21:37 EST 2004
On Sun, 2004-02-29 at 23:18, Charl P. Botha wrote:
> Here's another segfault-causing script. This time, the output of
> vtkExtractVOI is sent to a vtkStructuredPointsWriter. This simple
> operation causes segmentation faults on Linux and Windows.
>
> This time, the segfault is in vtkDataWriter::WriteFieldData() at line
> 976. strlen() is being requested on array->GetName(). array exists,
> but ->GetName() returns 0x0.
>
> It would seem that vtkExtractVOI is not correctly naming its output.
> Even if this is the case, shouldn't subsequent filters be robust to
> arrays not having names?
Okay, I've just committed a fix to the vtkExtractVOI class. My log
message explains the problem:
revision 1.37
date: 2004/03/01 09:09:52; author: cpbotha; state: Exp; lines: +1 -2
ERR: Fixed nasty bug. vtkExtractVOI was calling AllocateScalars() *as
well as* CopyAllocate() (or PassThrough()) later on. This meant that
subsequent filters saw 2 (two) arrays, one unnamed and empty, the other
representing the real data. The unnamed array was able to crash
at least the vtkStructuredPointsWriter and any of the vtkXMLWriters.
Should I build some check into one of the ExtractVOI tests to prevent a
regression?
Thanks,
Charl
--
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
More information about the vtkusers
mailing list