My program fails to launch when compiled with AddressSanitizer

82 Views Asked by At

When I compile and link my project with address sanitizer enabled -fsanitize=address on GCC 12.1, the program crashes at startup with following error message

==2795970==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:10064 "((__interception::real_memcpy)) != (0)" (0x0, 0x0)
    <empty stack>

This seems to happen before main(). The program runs fine when not compiled with -fsanitize=address.

1

There are 1 best solutions below

0
sebasth On

The project also compiles a shared library which I forgot to consider. When linked to libasan statically with -static-libasan, everything works as expected.