[svn-commits] file: branch group/media_formats-reviewed-trunk r418979 - in /team/group/medi...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jul 18 13:53:30 CDT 2014


Author: file
Date: Fri Jul 18 13:53:24 2014
New Revision: 418979

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418979
Log:
Multiple revisions 418961-418963

........
  r418961 | sgriepentrog | 2014-07-18 10:40:54 -0700 (Fri, 18 Jul 2014) | 13 lines
  
  feature_config: insure featuregroups and applicationmaps are initialized
  
  If the features.conf is missing, the cfg->featurgroups
  and cfg->applicationmaps is not initialized, resulting
  in assert on ao2_find of a null container.  This patch
  changes the initialization call and adds asserts for a
  safeguard.
  
  Review: https://reviewboard.asterisk.org/r/3809/
  ........
  
  Merged revisions 418886 from http://svn.asterisk.org/svn/asterisk/branches/12
........
  r418962 | sgriepentrog | 2014-07-18 10:42:41 -0700 (Fri, 18 Jul 2014) | 15 lines
  
  media formats: fix ref leak of peer for mwi subscription
  
  Holding a reference to the peer during mwi subscriptions
  resulted in a circular reference because the final event
  message would not be sent until destruction of the peer.
  
  Instead, pass the name of the peer to the event callback
  so that it can fail gracefully after the peer has gone.
  
  ASTERISK-23959
  Review: https://reviewboard.asterisk.org/r/3754/
  ........
  
  Merged revisions 418636 from http://svn.asterisk.org/svn/asterisk/branches/12
........
  r418963 | sgriepentrog | 2014-07-18 10:55:38 -0700 (Fri, 18 Jul 2014) | 13 lines
  
  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/
........

Merged revisions 418961-418963 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/group/media_formats-reviewed-trunk/   (props changed)
    team/group/media_formats-reviewed-trunk/channels/chan_sip.c
    team/group/media_formats-reviewed-trunk/include/asterisk/astobj2.h
    team/group/media_formats-reviewed-trunk/main/astobj2.c
    team/group/media_formats-reviewed-trunk/main/logger.c
    team/group/media_formats-reviewed-trunk/main/utils.c
    team/group/media_formats-reviewed-trunk/res/res_pjsip_pubsub.c

Propchange: team/group/media_formats-reviewed-trunk/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/media_formats-reviewed-trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Propchange: team/group/media_formats-reviewed-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jul 18 13:53:24 2014
@@ -1,1 +1,1 @@
-/trunk:1-418940
+/trunk:1-418978

Modified: team/group/media_formats-reviewed-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/channels/chan_sip.c?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/channels/chan_sip.c (original)
+++ team/group/media_formats-reviewed-trunk/channels/chan_sip.c Fri Jul 18 13:53:24 2014
@@ -16826,10 +16826,7 @@
 	struct sip_peer *peer = sip_find_peer(peer_name, NULL, TRUE, FINDALLDEVICES, FALSE, 0);
 
 	if (stasis_subscription_final_message(sub, msg)) {
-		if (peer) {
-			/* configuration reloaded */
-			return;
-		}
+		ast_assert(peer == NULL);
 		ast_free(peer_name);
 		return;
 	}

Modified: team/group/media_formats-reviewed-trunk/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/include/asterisk/astobj2.h?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/include/asterisk/astobj2.h (original)
+++ team/group/media_formats-reviewed-trunk/include/asterisk/astobj2.h Fri Jul 18 13:53:24 2014
@@ -1961,9 +1961,6 @@
  */
 void ao2_iterator_restart(struct ao2_iterator *iter);
 
-/* extra functions */
-void ao2_bt(void);	/* backtrace */
-
 /*! gcc __attribute__(cleanup()) functions
  * \note they must be able to handle NULL parameters because most of the
  * allocation/find functions can fail and we don't want to try to tear

Modified: team/group/media_formats-reviewed-trunk/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/astobj2.c?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/astobj2.c (original)
+++ team/group/media_formats-reviewed-trunk/main/astobj2.c Fri Jul 18 13:53:24 2014
@@ -97,29 +97,6 @@
 struct ao2_stats ao2;
 #endif
 
-#ifdef HAVE_BKTR
-#include <execinfo.h>    /* for backtrace */
-#endif
-
-void ao2_bt(void)
-{
-#ifdef HAVE_BKTR
-	int depth;
-	int idx;
-#define N1	20
-	void *addresses[N1];
-	char **strings;
-
-	depth = backtrace(addresses, N1);
-	strings = ast_bt_get_symbols(addresses, depth);
-	ast_verbose("backtrace returned: %d\n", depth);
-	for (idx = 0; idx < depth; ++idx) {
-		ast_verbose("%d: %p %s\n", idx, addresses[idx], strings[idx]);
-	}
-	ast_std_free(strings);
-#endif
-}
-
 #define INTERNAL_OBJ_MUTEX(user_data) \
 	((struct astobj2_lock *) (((char *) (user_data)) - sizeof(struct astobj2_lock)))
 
@@ -455,6 +432,9 @@
 	if (current_value < 0) {
 		ast_log(__LOG_ERROR, file, line, func,
 			"Invalid refcount %d on ao2 object %p\n", current_value, user_data);
+		ast_assert(0);
+		/* stop here even if assert doesn't DO_CRASH */
+		return -1;
 	}
 
 	/* last reference, destroy the object */
@@ -516,7 +496,6 @@
 	}
 
 	if (obj == NULL) {
-		ast_log_backtrace();
 		ast_assert(0);
 	}
 

Modified: team/group/media_formats-reviewed-trunk/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/logger.c?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/logger.c (original)
+++ team/group/media_formats-reviewed-trunk/main/logger.c Fri Jul 18 13:53:24 2014
@@ -1759,14 +1759,14 @@
 	}
 
 	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

Modified: team/group/media_formats-reviewed-trunk/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/utils.c?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/utils.c (original)
+++ team/group/media_formats-reviewed-trunk/main/utils.c Fri Jul 18 13:53:24 2014
@@ -2544,7 +2544,7 @@
 		condition_str, condition, line, function, file);
 
 	/* Generate a backtrace for the assert */
-	ao2_bt();
+	ast_log_backtrace();
 
 	/*
 	 * Give the logger a chance to get the message out, just in case

Modified: team/group/media_formats-reviewed-trunk/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/res/res_pjsip_pubsub.c?view=diff&rev=418979&r1=418978&r2=418979
==============================================================================
--- team/group/media_formats-reviewed-trunk/res/res_pjsip_pubsub.c (original)
+++ team/group/media_formats-reviewed-trunk/res/res_pjsip_pubsub.c Fri Jul 18 13:53:24 2014
@@ -992,8 +992,6 @@
 			PJSIP_EVSUB_STATE_ACTIVE : PJSIP_EVSUB_STATE_TERMINATED;
 	}
 
-	ast_log_backtrace();
-
 	if (pjsip_evsub_notify(evsub, state, NULL, NULL, &tdata) != PJ_SUCCESS) {
 		ast_free(body_text);
 		return -1;




More information about the svn-commits mailing list