[asterisk-commits] kmoore: branch 10 r371691 - in /branches/10: ./ main/utils.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 27 08:57:15 CDT 2012


Author: kmoore
Date: Mon Aug 27 08:57:10 2012
New Revision: 371691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371691
Log:
Implement workaround 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.

(closes issue ASTERISK-20090)
........

Merged revisions 371690 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/utils.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/utils.c?view=diff&rev=371691&r1=371690&r2=371691
==============================================================================
--- branches/10/main/utils.c (original)
+++ branches/10/main/utils.c Mon Aug 27 08:57:10 2012
@@ -776,16 +776,20 @@
 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))) {
+	/* store frame count locally to avoid the memory corruption that
+	 * sometimes happens on virtualized CentOS 6.x systems */
+	num_frames = 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]);
 		}
 




More information about the asterisk-commits mailing list