diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-08-20 14:45:07 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-08-20 14:45:07 +0000 |
commit | ca314fe1e2ee5b545e69ccc4e22806e6960a0771 (patch) | |
tree | 7e38335f90c6b723738d1089139cf3df16cf0c29 | |
parent | f7376986541549c0db9ffae71d598e2108aeb4f1 (diff) |
Apply work-around for BETTER_BACKTRACES crash
When compiling with BETTER_BACKTRACES enabled, Asterisk will sometimes
crash when "core show locks" is run. This happens regularly in the
testsuite since several tests run "core show locks" to help with
debugging. This seems to be a fault with libraries on certain operating
systems (notably CentOS 6.2/6.3) running on virtual machines and
utilizing gcc 4.4.6.
(issue ASTERISK-20090)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/utils.c b/main/utils.c index e52c8190e..139d4abbb 100644 --- a/main/utils.c +++ b/main/utils.c @@ -788,16 +788,18 @@ static const char *locktype2str(enum ast_lock_type type) static void append_backtrace_information(struct ast_str **str, struct ast_bt *bt) { char **symbols; + int num_frames; if (!bt) { ast_str_append(str, 0, "\tNo backtrace to print\n"); return; } - if ((symbols = ast_bt_get_symbols(bt->addresses, bt->num_frames))) { + num_symbols = bt->num_frames; + if ((symbols = ast_bt_get_symbols(bt->addresses, num_frames))) { int frame_iterator; - for (frame_iterator = 0; frame_iterator < bt->num_frames; ++frame_iterator) { + for (frame_iterator = 0; frame_iterator < num_frames; ++frame_iterator) { ast_str_append(str, 0, "\t%s\n", symbols[frame_iterator]); } |