Segfault in Faster Approximation of Vorticity/Q-criterion for Unstructured Grid Gradient
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
A segfault occurs when trying to use the faster approximation computation of Q-criterion or vorticity for point data when the number of cells exceeds the number of points.
My assessment:
As far as I can tell, in vtkGradientFilter.cxx, the faster approximation gradient computation determines the output size of the Q-criterion or vorticity vtkDataArray based on the number of tuples in the input parameter, vtkDataArray array. However, if the faster approximation is used, ComputeCellGradientsUG is called rather than ComputePointGradientsUG, which assumes the storage for Q-criterion and vorticity matches the number of cells instead of number of points. If the number of points is less than the number of cells, ComputeCellGradientsUG will attempt to write outside the bounds of the array, triggering the segfault.