RemoveGhostCells causes a segfault when using Polyhedral Cells
Tested with VTK 9.1. Backtrace of the segfault is as follows:
#0 vtkUnstructuredGrid::DecomposeAPolyhedronCell (nCellFaces=4883, cellStream=0xb5fe008, numCellPts=@0x7fffffffa6f0: 8918, cellArray=0x75281b0, faces=0x9ff8ef0) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGrid.cxx:2322
#1 0x00007ffff3d30086 in vtkUnstructuredGrid::InternalInsertNextCell (this=0x75270a0, type=42, npts=4883, ptIds=0xa0223f8) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGrid.cxx:1233
#2 0x00007ffff3d415c4 in vtkUnstructuredGridBase::InsertNextCell (this=0x75270a0, type=42, npts=4883, pts=0xa0223f8) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGridBase.cxx:61
#3 0x00007ffff3d2fd80 in vtkUnstructuredGrid::InternalInsertNextCell (this=0x75270a0, type=42, ptIds=0x752d2f0) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGrid.cxx:1173
#4 0x00007ffff3d415fc in vtkUnstructuredGridBase::InsertNextCell (this=0x75270a0, type=42, ptIds=0x752d2f0) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGridBase.cxx:67
#5 0x00007ffff3d337ab in vtkUnstructuredGrid::RemoveGhostCells (this=0x7536a60) at /home/arnom/work/software/other/vtk/VTK-9.1.0/Common/DataModel/vtkUnstructuredGrid.cxx:2253
In frame 5 RemoveGhostCells
creates a ptIds
list which in my case contains 8 point ids (see code here) which make up the polyhedron which calls InsertNextCell
which in turn calls InternalInsertNextCell
(frame 3). In that code just before the call to InsertNextCell
in frame 2 the following comment is displayed:
// For polyhedron cell, input ptIds is of format:
// (numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...)
clearly this is not the data that is being fed into InsertNextCell
from RemoveGhostCells
so frame 1 gets complete garbage as input (see the npts=4883
which is the id of the first cell point and not the number of points).
I'll try and see if I can manage to construct a minimal test case.
Cheers, Arno