Prerequisites
The instrumentation process depends on an Antithesis provided library,libvoidstar.so, which can be found here. We recommend downloading and vendoring it into your source repo or otherwise caching it, so that the success of your builds does not inadvertently depend on the uptime of our website.
This library will become a dynamic runtime dependency of your instrumented program. Your program will need to be able to find this library in order to run successfully, both within the Antithesis environment, and in local testing. Your container building process must install this library at /usr/lib/libvoidstar.so, and your system must be configured so that this location is on your library search path.
Build Requirements
To enable instrumentation for your code, you’ll need to compile your binary using a modern version of Cargo, and the following compile flags:LLVM-instrumented binaries must have GNU build ids for symbolization to work. As long as you use the -Clink-args=-Wl,—build-id flag above, you’ll be fine.
Validation
Once the binary has been compiled, verify that it has correctly linked to the Antithesis runtime library. Run the commandldd {binary} to identify its runtime dependencies, and a grep of the string “libvoidstar” to confirm the location of the shared object.
nm to list all the symbols in the binary, and a grep of the string “sanitizer_cov_trace_pc_guard”.
fsanitize-coverage-trace-pc-guard to -Clink-args in addition to Cllvm-args.
It is also possible that -fsanitize-coverage=trace-pc-guard was added to your compile flags AND to your link flags. In order for instrumentation to work, it must only be in your compile flags.
Symbolization
The LLVM compiler infrastructure will output debug symbols in the DWARF format. They could be separate debug info or just the original unstripped binary. These files should be symlinked (or moved) into a directory named/symbols in the root of the appropriate container image.