Is it possible to add asan library to STM32CubeIDE?
Hi. I am working on a very large project, and recently I discovered that I probably have a buffer overflow issue (a strange error that disappears after commenting a completely unrelated piece of code).
I tried many things already, but nothing worked. I found out that there is a library called sanitizer, which adds checking to array accesses, so I could find any out-of-bounds writes. It is enabled by adding -fsanitize=address to the compiler options. But when I do that, I get this error:
arm-none-eabi-gcc: fatal error: cannot read spec file 'libsanitizer.spec': No such file or directoryI have read somewhere that this error means the libsanitizer is not installed. Do you know if the library could be made available to the CubeIDE's gcc, and how to do that? I couldn't find anything in the internet.
Or perhaps there are other options for buffer overflow checking/detecting? So far I have tried access attribute, adding length parameters to functions operating on arrays, -Warray-bounds, -Wformat-overflow, -Wstringop-overflow and -fbounds-check (which does not seem to do anything, because the compiled code has the same size with and without it), and using strlcat instead of strcat and similar. Nothing worked.