Problem with address sanitizer stack traces

Hi all,

first, thanks for the great tool, especially the address sanitizer. I
have a multi-threaded program, where I get a segfault due to access to
free'd memory in one thread. In the report, I see references to where
this memory block was malloc'ed and free'ed. Unfortunately, these
later two stack traces just include 2 and 3 stack frames, where it
would need to be around 15. Most importantly, the information I really
need is missing due to that.

I tried to explicitely set


even though malloc_context_size should be 30 by default. I know
ASAN_OPTIONS is used, because my output now is verbose.

I compile with

-g -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith
-Wmissing-format-attribute -fsanitize=address -fno-omit-frame-pointer

Note that I added -O0 in a desparate effort to try to get to larger
stack traces. Nothing changes if I leave it out.

I than wrote a small single-threaded test program, and there large
stack traces are reported.

Does anyone have any advise on how to get to larger stack traces? Or
at least what could be the root cause of this problem?

Any help would be deeply appreciated.


Try to add ASAN_OPTIONS=fast_unwind_on_malloc=0. It’s possible that stack traces go through smth. like libstdc++ which is built without frame pointers.