<div dir="ltr">Thanks for running the code under valgrind.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 12:51 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Richard,<br>
<br>
The new vtkExtractUnstructuredGridPiece code is referencing the tags<br>
array out of bounds. Tis is exactly the change you made by adding +1<br>
to maxcells.<br>
<br>
I ran valgrind on TestXMLUnstructuredGridIO<br>
and got a<br>
==29994== Invalid write of size 4<br>
caused here:<br>
#2  0x0c71ca3b in vtkExtractUnstructuredGridPiece::ComputeCellTags<br>
(this=0xb666b08, tags=0xdce1948,<br>
    pointOwnership=0x0, piece=1, numPieces=2, input=0xb656c38)<br>
    at /home/lorensen/ProjectsGIT/VTKGerrit/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx:98<br>
98          tags->SetValue(idx, 0);<br>
<br>
idx is 1027<br>
but<br>
the following shows that Size = 1027, so the staement is exceeding the<br>
allocated memory.<br>
<br>
(gdb) print *tags<br>
$2 = {<vtkDataArrayTemplate<int>> = {<vtkDataArray> = {<br>
    <vtkAbstractArray> = {<vtkObject> = {<vtkObjectBase> =<br>
{_vptr.vtkObjectBase = 0x44daca8,<br>
            ReferenceCount = 1, WeakPointers = 0x0}, Debug = 0 '\000',<br>
MTime = {ModifiedTime = 658},<br>
          SubjectHelper = 0x0}, Size = 1057, MaxId = -1,<br>
NumberOfComponents = 1, Name = 0x0,<br>
        RebuildArray = false, Information = 0x0, ComponentNames =<br>
0x0}, LookupTable = 0x0, Range = {0, 1}},<br>
    Array = 0xdce19e0, ValueRange = {0, 1}, TupleSize = 0, Tuple =<br>
0x0, SaveUserArray = 0, DeleteMethod = 0,<br>
    Lookup = 0x0}, <No data fields>}<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Robert Maynard
</div>