AddressSanitizer Bugs
Add the following lines to the CMakeLists.txt:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined")
Then running the unit tests reveals:
vtk-m/build/bin$ ./UnitTests_vtkm_cont_serial_testing "UnitTestSerialCellLocatorRectilinearGrid"
X bounds : 0 to 4
Y bounds : 0 to 2
Z bounds : 0 to 6
Dimensions of dataset : [4,3,5]
/home/nthompson/Documents/vtk-m/vtkm/cont/internal/VirtualObjectTransfer.h:156:65: runtime error: member call on address 0x603000000be0 which does not point to an object of type 'TransferInterface'
0x603000000be0: note: object is of type 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
04 00 80 23 20 3d 97 b4 a5 7f 00 00 ff ff ff ff ff ff ff ff 40 00 00 00 10 61 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
Test finished successfully.
/home/nthompson/Documents/vtk-m/vtkm/cont/internal/VirtualObjectTransfer.h:146:32: runtime error: member call on address 0x603000000be0 which does not point to an object of type 'TransferInterface'
0x603000000be0: note: object is of type 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
04 00 80 23 20 3d 97 b4 a5 7f 00 00 00 00 00 00 00 00 00 00 40 00 00 00 10 61 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
/usr/include/c++/7/bits/unique_ptr.h:78:2: runtime error: member call on address 0x603000000be0 which does not point to an object of type 'TransferInterface'
0x603000000be0: note: object is of type 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
04 00 80 23 20 3d 97 b4 a5 7f 00 00 00 00 00 00 00 00 00 00 40 00 00 00 10 61 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'vtkm::cont::internal::TransferInterfaceImpl<vtkm::exec::CellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>, vtkm::cont::DeviceAdapterTagSerial>'
=================================================================
==24665==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1536 byte(s) in 6 object(s) allocated from:
#0 0x7fa5b6579f40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
#1 0x7fa5b1af85d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x955d2)
SUMMARY: AddressSanitizer: 1536 byte(s) leaked in 6 allocation(s).