Skip to content

FlyingEdges: Fix SIGABRT triggered by BenchContour

closes: #548 (closed)

This MR fixes a bug that occurs with Flying Edges when certain random input.

The bug cause was found on some methods assuming that their given arrays to be zero initialized when they have not been used yet.

Here is the method and line where it occurs: https://gitlab.kitware.com/vtk/vtk-m/-/blob/d665fd49334e0d07054dd9d0a545d80cb9373735/vtkm/worklet/contour/FlyingEdgesHelpers.h#L250

In the shown method the values of left and right are randomly set as the array edges was at times being filled with garbaged (as opposed to zero initialized).

This did not always manifest since depending on the input field the array is initialized before passed to those faulty methods.

The solution proposed here zero initializes those arrays, after this change the benchmarks passes and valgrinds does not report any more branch on unitialized memory errors anymore.

Also recycling some lateral effort done in this bugfix, I added one more commit which also adds a new case for BenchContour which uses an unstructured DataSet as input.

Edited by Robert Maynard

Merge request reports