How to enable address sanitizer for multiple C++ binaries
I am working on a product that is composed of multiple C++ executables and libraries that have various dependencies on one another. I am building them all with GCC and -fsanitize-address
.
From what I understand, if I want to use address sanitizer with a library I have to build it as a shared object (which is the default option for GCC). Because of this, I thought the best option would be to build address sanitizer statically with -static-libasan
for the executables and build it dinamically for the libraries. However, when I do that I get a link error when building one of the C++ executables:
How to enable address sanitizer for multiple C++ binaries
I am working on a product that is composed of multiple C++ executables and libraries that have various dependencies on one another. I am building them all with GCC and -fsanitize-address
.
From what I understand, if I want to use address sanitizer with a library I have to build it as a shared object (which is the default option for GCC). Because of this, I thought the best option would be to build address sanitizer statically with -static-libasan
for the executables and build it dinamically for the libraries. However, when I do that I get a link error when building one of the C++ executables:
Why does AddressSanitizer not produce any backtrace sometimes?
After compiling and linking my program with gcc 11.4 using -fsanitize=address and -g, I am getting an AddressSanitizer report on the console, but no backtrace like usual. Running under gdb does not give different results, and it does not stop when the message is generated so that I can’t get a backtrace that way either.
Why does AddressSanitizer not produce any backtrace sometimes?
After compiling and linking my program with gcc 11.4 using -fsanitize=address and -g, I am getting an AddressSanitizer report on the console, but no backtrace like usual. Running under gdb does not give different results, and it does not stop when the message is generated so that I can’t get a backtrace that way either.