Using RealtimeSanitizer inside DAWs

Hi,

This is more of an FYI post, as I expect folks in this forum will run into this issue.

If you attempt to use LLVM’s RealtimeSanitizer on your plug-in, and you load that plug-in in your DAW on a MacOS system you may end with no issues detected, even if you put an explicit malloc or lock. If you update to the latest version (as of this morning) you will now see the warning message below. This is the same message used when your plug-in is instrumented with AddressSanitizer.

==9891==ERROR: Interceptors are not working. This may be because RealtimeSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with:
DYLD_INSERT_LIBRARIES=/usr/local/lib/libclang_rt.rtsan_osx_dynamic.dylib
"interceptors not installed" && 0
fish: Job 1, '/Applications/REAPER.app/Conten…' terminated by signal SIGABRT (Abort)

To get around this issue (as it suggests), launch your DAW or other host with the environment variable:

DYLD_INSERT_LIBRARIES=/usr/local/lib/libclang_rt.rtsan_osx_dynamic.dylib /Applications/REAPER.app/Contents/MacOS/REAPER

Sometimes, it may be advantageous to disable this check. In particular, when your DAW is scanning plug-ins, they may not respect the environment variables set by the parent process. To disable the check, set the following option in the RTSAN_OPTIONS environment variable:

export RTSAN_OPTIONS="verify_interceptors=false"

Happy coding!

4 Likes