LSAN can not work with Stand alone mode in GCC 9.4.0
There was a memory leak on the embedded board. Using the g++9.4.0 compiler, the - fsanitize=address parameter was added during compilation. At the beginning of the run, the CPU and memory usage increased by about 4 times. Soon, the node was killed by the operating system due to insufficient resource consumption.
In order to reduce the resource consumption caused by using the ASAN tool, I plan to use the LSAN tool, which means using the - fsanitize=leak parameter during compilation and the LSAN-POTION parameter during configuration. However, an error occurred at the beginning of the program:
=2258699== Sanitizer CHECKfailed:/../src/libsanitizer/lsan/lsan interceptors.cpp:53((!lsan init is running)) ! =(0) (0,0)
this does not match the instructions in the GitHub wiki manual. The wiki manual mentions that the LSAN tool has a Stand alone mode.
About Stand alone mode:
If you just need leak detection, and don't want to bear the ASan slowdown, you can build with -fsanitize=leak instead of -fsanitize=address. This will link your program against a runtime library containing just the bare necessities required for LeakSanitizer to work. No compile-time instrumentation will be applied.
Be aware that the stand-alone mode is less well tested compared to running LSan on top of ASan.
How can this issue be resolved?
LSAN can not work with Stand alone mode in GCC 9.4.0
There was a memory leak on the embedded board. Using the g++9.4.0 compiler, the - fsanitize=address parameter was added during compilation. At the beginning of the run, the CPU and memory usage increased by about 4 times. Soon, the node was killed by the operating system due to insufficient resource consumption.
In order to reduce the resource consumption caused by using the ASAN tool, I plan to use the LSAN tool, which means using the - fsanitize=leak parameter during compilation and the LSAN-POTION parameter during configuration. However, an error occurred at the beginning of the program:
=2258699== Sanitizer CHECKfailed:/../src/libsanitizer/lsan/lsan interceptors.cpp:53((!lsan init is running)) ! =(0) (0,0)this does not match the instructions in the GitHub wiki manual. The wiki manual mentions that the LSAN tool has a Stand alone mode.
About Stand alone mode:
If you just need leak detection, and don't want to bear the ASan slowdown, you can build with -fsanitize=leak instead of -fsanitize=address. This will link your program against a runtime library containing just the bare necessities required for LeakSanitizer to work. No compile-time instrumentation will be applied.
Be aware that the stand-alone mode is less well tested compared to running LSan on top of ASan.
How can this issue be resolved?