[vtk-developers] Undefined Behavior in vtkPointLocator.h

David Gobbi david.gobbi at gmail.com
Wed Jan 10 17:20:25 EST 2018


On Wed, Jan 10, 2018 at 3:01 PM, Sean McBride <sean at rogue-research.com>
wrote:

> On Wed, 10 Jan 2018 16:46:51 -0500, Mmanu Chaturvedi said:
>
> >
> >On building VTK with UBSan, and running the following test:
> >
> >`ctest -VV -R vtkInteractionWidgetsCxx-TestPlaneWidget`
> >
> >UBSan produces runtime errors due to the casting done in lines 282 ---
> 284,
> >similar to this:
> >
> >runtime error: value -1.81708e+299 is outside the range of representable
> >values of type 'long long'
> >
> >I believe one way to solve the problem would be to do something like the
> >following:
> >https://gitlab.kitware.com/m-chaturvedi/vtk/commit/
> >4df07e6d3b9bc9250bab74287fb2df3fe1d2098d
> >
> >But this increases the test's time significantly.
> >
> >I was wondering if someone could propose a proper fix.
> >
> >vtkTypeId --
> >https://gitlab.kitware.com/m-chaturvedi/vtk/blob/master/Common/Core/
> >vtkType.h#L328
>
> This gives me deja vu... I believe this is related:
>
> <https://gitlab.kitware.com/vtk/vtk/merge_requests/2578>
>

Indeed it is related, and this is a really ugly problem.  It causes
incorrect
results from vtkPointSet::FindCell(), which is called by many VTK filters.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20180110/d3d18273/attachment.html>


More information about the vtk-developers mailing list