Add backtrace generation to MALLOC_DEBUG memory corruption reports
This patch allows astmm to access the backtrace generation code in Asterisk. When memory is allocated, a backtrace is created and stored with the memory region that tracks the allocation. If a memory corruption is detected, the backtrace is printed to the astmm log. The backtrace will make use of the BETTER_BACKTRACES build option if available. As a result, this patch moves the backtrace generation code into its own file and uses the non-wrapped versions of the C library memory allocation routines. This allows the memory allocation code to safely use the backtrace generation routines without infinitely recursing. Review: https://reviewboard.asterisk.org/r/2567 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Showing
- include/asterisk/backtrace.h 97 additions, 0 deletionsinclude/asterisk/backtrace.h
- include/asterisk/lock.h 1 addition, 0 deletionsinclude/asterisk/lock.h
- include/asterisk/logger.h 4 additions, 58 deletionsinclude/asterisk/logger.h
- main/astmm.c 28 additions, 1 deletionmain/astmm.c
- main/astobj2.c 1 addition, 1 deletionmain/astobj2.c
- main/backtrace.c 222 additions, 0 deletionsmain/backtrace.c
- main/logger.c 6 additions, 195 deletionsmain/logger.c
- utils/extconf.c 1 addition, 1 deletionutils/extconf.c
Loading
Please register or sign in to comment