I have a python module that uses an external C++ library using a C++ extension build with distutils. When I compile the C++ library with the address sanitizer, -fsanitize option of GCC, I get a segfault when running unit tests. Now, initially I thought that it was because me using different compiler options for the two binaries, the C++ python extension and the library but now I am more and more convinced that this is because the address sanitizer found an error in the library and triggered a seg fault, as explained here. This is also supported by the fact that if I compile the C++ library without the address sanitizer, everything works fine. When I run unit tests, the program outputs very little information:
./run_unit_tests
Segmentation fault (core dumped)
Even looking at the core dump I was able to find only a stack trace pointing to the C++ library but no mention of address sanitizer.
I have tried to use ASAN_OPTIONS to redirect the sanitizer output to a file but the sanitizer apparently does not pick up the options:
ASAN_OPTIONS=help=1 ./run_unit_tests
Segmentation fault (core dumped)
What strategy should I take here to confirm that the seg fault coms from the sanitizer and possibly discover what kind of error it is?