SIGSEGV on vtkCompositeDataProbeFilter() with PassPartialArraysOn()
VTK8.2 crashes when vtkCompositeDataProbeFilter() is applied on vtkMultiBlockDataSet(), when
- PassPartialArrays is enabled, and
- PointData entries are not identical among components.
The following python script runs OK with VTK8.0.1, but crashes on VTK8.2.
import numpy as np
import vtk
from vtk.util.numpy_support import numpy_to_vtk
#------------------------------------------------------------------------
# Create MultiBlockDataSet, with uneven PointData.
#------------------------------------------------------------------------
xz = np.linspace(-1, 1, 11)
y0 = np.linspace(0, 1, 6)
y1 = np.linspace(-1, 0, 6)
rect0 = vtk.vtkRectilinearGrid()
rect0.SetDimensions(len(xz), len(y0), len(xz))
rect0.SetXCoordinates(numpy_to_vtk(xz, deep = 1))
rect0.SetYCoordinates(numpy_to_vtk(y0, deep = 1))
rect0.SetZCoordinates(numpy_to_vtk(xz, deep = 1))
rect1 = vtk.vtkRectilinearGrid()
rect1.SetDimensions(len(xz), len(y1), len(xz))
rect1.SetXCoordinates(numpy_to_vtk(xz, deep = 1))
rect1.SetYCoordinates(numpy_to_vtk(y1, deep = 1))
rect1.SetZCoordinates(numpy_to_vtk(xz, deep = 1))
ar = vtk.vtkDoubleArray()
ar.SetNumberOfComponents(1)
ar.SetNumberOfTuples(rect0.GetNumberOfPoints())
ar.FillComponent(0, 0.0)
ar.SetName("Dummy")
rect0.GetPointData().AddArray(ar)
mb = vtk.vtkMultiBlockDataSet()
mb.SetNumberOfBlocks(2)
mb.SetBlock(0, rect0)
mb.SetBlock(1, rect1)
wr = vtk.vtkXMLMultiBlockDataWriter()
wr.SetFileName("test.vtm")
wr.SetInputData(mb)
wr.Write()
#------------------------------------------------------------------------
# Probe MutiBlockDataSet
#------------------------------------------------------------------------
ln = vtk.vtkLineSource()
ln.SetPoint1(0, -0.99, 0)
ln.SetPoint2(0, 0.99, 0)
ln.SetResolution(10)
pr = vtk.vtkCompositeDataProbeFilter()
pr.PassPartialArraysOn()
pr.SetInputConnection(ln.GetOutputPort())
pr.SetSourceData(mb)
pr.Update() # crashes on VTK8.2
ds = pr.GetOutput()
pd = ds.GetPointData()
for i in range(pd.GetNumberOfArrays()) :
print(pd.GetArray(i).GetName())
from vtk.util.numpy_support import vtk_to_numpy
print(vtk_to_numpy(ds.GetPointData().GetArray("Dummy")))
This causes crash of Paraview 5.6 on "Plot Over Line". It crashes in vtkDataArray::InterpolateTuple(). I couldn't track the issue down, but vtkDataSetAttributesFieldList::InterpolatePoint seems suspicious.