From 0a99e4099b66a026f8c69d22d382e5e30ebe6f5e Mon Sep 17 00:00:00 2001 From: Scott Griepentrog Date: Fri, 18 Jul 2014 17:55:38 +0000 Subject: astobj2: assert on invalid ref and backtrace cleanup If a reference count goes negative, instead of just logging that fact, be more helpful with a backtrace and an assert that will DO_CRASH. This patch also removes the duplicate ao2_bt() function and cleans up extraneous usage of the ast_log_backtrace() call. Review: https://reviewboard.asterisk.org/r/3765/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418963 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/logger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main/logger.c') diff --git a/main/logger.c b/main/logger.c index 86cd0d4a6..13d074c6d 100644 --- a/main/logger.c +++ b/main/logger.c @@ -1759,14 +1759,14 @@ void ast_log_backtrace(void) } if ((strings = ast_bt_get_symbols(bt->addresses, bt->num_frames))) { - ast_debug(1, "Got %d backtrace record%c\n", bt->num_frames, bt->num_frames != 1 ? 's' : ' '); + ast_verbose("Got %d backtrace record%c\n", bt->num_frames, bt->num_frames != 1 ? 's' : ' '); for (i = 3; i < bt->num_frames - 2; i++) { - ast_debug(1, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]); + ast_verbose("#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]); } ast_std_free(strings); } else { - ast_debug(1, "Could not allocate memory for backtrace\n"); + ast_verbose("Could not allocate memory for backtrace\n"); } ast_bt_destroy(bt); #else -- cgit v1.2.3