[vtk-developers] Problem in new vtkExtractUnstructuredGridPiece
Robert Maynard
robert.maynard at kitware.com
Tue Feb 12 13:01:39 EST 2013
Thanks for running the code under valgrind.
On Tue, Feb 12, 2013 at 12:51 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
> Richard,
>
> The new vtkExtractUnstructuredGridPiece code is referencing the tags
> array out of bounds. Tis is exactly the change you made by adding +1
> to maxcells.
>
> I ran valgrind on TestXMLUnstructuredGridIO
> and got a
> ==29994== Invalid write of size 4
> caused here:
> #2 0x0c71ca3b in vtkExtractUnstructuredGridPiece::ComputeCellTags
> (this=0xb666b08, tags=0xdce1948,
> pointOwnership=0x0, piece=1, numPieces=2, input=0xb656c38)
> at
> /home/lorensen/ProjectsGIT/VTKGerrit/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx:98
> 98 tags->SetValue(idx, 0);
>
> idx is 1027
> but
> the following shows that Size = 1027, so the staement is exceeding the
> allocated memory.
>
> (gdb) print *tags
> $2 = {<vtkDataArrayTemplate<int>> = {<vtkDataArray> = {
> <vtkAbstractArray> = {<vtkObject> = {<vtkObjectBase> =
> {_vptr.vtkObjectBase = 0x44daca8,
> ReferenceCount = 1, WeakPointers = 0x0}, Debug = 0 '\000',
> MTime = {ModifiedTime = 658},
> SubjectHelper = 0x0}, Size = 1057, MaxId = -1,
> NumberOfComponents = 1, Name = 0x0,
> RebuildArray = false, Information = 0x0, ComponentNames =
> 0x0}, LookupTable = 0x0, Range = {0, 1}},
> Array = 0xdce19e0, ValueRange = {0, 1}, TupleSize = 0, Tuple =
> 0x0, SaveUserArray = 0, DeleteMethod = 0,
> Lookup = 0x0}, <No data fields>}
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
--
Robert Maynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130212/cce96a6b/attachment.html>
More information about the vtk-developers
mailing list