Fix #110971: Replace our own barely-working backtrace on memleaks feature with ASAN utils. #111006

Merged
Bastien Montagne merged 1 commits from mont29/blender:guardedalloc-backtrace-fix into main 2023-08-10 17:55:03 +02:00

1 Commits

Author SHA1 Message Date
Bastien Montagne 95bc45b635 Fix #110971: Replace our own barely-working backtrace on memleaks feature with ASAN utils.
Instead of storing the backtrace in all memory blocks, and trying to get
meaningful info out of this list of pointers when printing leaked ones,
just use `__asan_describe_address` when ASAN is enabled.

This also work on Windows, in addition to linux and (presumably) OSX,
but does require to build with ASAN enabled.

The previous code was not working very well anymore, for some reason the
call to `backtrace_symbols` seems to fail to give any meaningful
information nowadays on most of Blender code. And it was only
implemented for linux and OSX.

Based on an idea from @LazyDodo, many thanks!
2023-08-10 17:45:35 +02:00