Programmable Filter: segfault on python code invalid for selected output data set type
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Sources - Time Source - Apply Filters - Programmable Filter Script: out = self.GetOutput()
newPoint = vtk.vtkPoints() newPoint.InsertPoint(0, 0,0,0) out.SetPoints(newPoint) newCell = vtk.vtkCellArray() vertex = vtk.vtkVertex() vertex.GetPointIds().SetId(0,0) newCell.InsertNextCell(vertex) out.SetVerts(newCell) Apply
=> An error is raised "AttributeError: SetVerts" and subsequently ParaView segfaults:
Program received signal SIGSEGV, Segmentation fault. 0x00007fffdf13a87e in vtkDataSetSurfaceFilter::InsertQuadInHash (this=0x33d42a0, a=2, b=6, c=7, d=3, sourceId=0) at ParaView.git/VTK/Graphics/vtkDataSetSurfaceFilter.cxx:1644 1644 if (quad->numPts == 4 && c == quad->ptArray)
Admittedly, the user is at fault by not changing "Output Data Set Type" to "vtkPolyData" prior to hitting Apply, but ParaView should not segfault for "Same as Input"/"vtkUnstructuredGrid". Indeed, ParaView does handle the related case properly: run the same script as ProgrammableSource and select "vtkUnstructuredGrid" as "Output Data Set Type". Above's error message is raised, but no segfault is caused.
Tested with ParaView 3.10.1 official binary release for Linux 64bit and own Linux 64bit build of git master branch as of now.