osrf/osrf_testing_tools_cpp

Add a cmake argument to disable OSRF memory testing when needed

bhatsach opened this issue · 2 comments

OSRF memory tools currently overrides the LD_PRELOAD environment variable by setting it to the memory tools library path. This can interfere with the working of other functionalities like sanitizers which again depend on the LD_PRELOAD environment variable as seen here: #22.

It would be great to have a simple cmake argument to disable memory testing in osrf testing tools, which can be used while enabling sanitizers or any other library based functionalities for ROS2

This makes sense to me, but I don't know when I'd have time to do it. A pull request would be much appreciated.

After exploring peaceful coexistence (#25) and not getting an immediate victory we've reverted back to allowing memory testing tools to disable itself. Currently packages which use memory testing tools to make certain classes of assertions require CMake logic to skip tests on platforms where mtt isn't currently supported as seen in:

Other uses fo memory tools don't currently make any assertion that the test apparatus is functioning so they are silently untested on unsupported platforms.

  • rcl

The work that was begun in #24 with companion PRs is sub-optimal since it requires each consumer of memory_tools to copy the logic of when memory_tools is expected to be available or not. When discussing this with @wjwwood, the preferred path to take would be to put memory_tools in control of determining when it is runnable, not runnable, running, and not running in a way that consumer packages can access the info via both CMake and C++.

With the above as the plan I'll work on an initial implementation next.