mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-19 11:13:09 +00:00
Add some asserts that were handy when looking for a stasis cache problem.
* Assert if a channel is destroyed but has the snapshot staging flag set. In this case the final channel destruction snapshot would never get taken. * Assert if what we just got out of the stasis cache is not what we were looking for. This assert would have saved several days searching for a bug and a lot of my hair. * Assert if the music on hold message posts could not find the associated channel. A crash will happen later when manager tries to send the MOH AMI message. This assert catches the problem when the stasis message is posted instead of by the thread processing the defective message. * Always generate a backtrace when an ast_assert() fails. Review: https://reviewboard.asterisk.org/r/3411/ ........ Merged revisions 411701 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -52,6 +52,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/sha1.h"
|
||||
#include "asterisk/cli.h"
|
||||
#include "asterisk/linkedlists.h"
|
||||
#include "asterisk/astobj2.h"
|
||||
|
||||
#define AST_API_MODULE /* ensure that inlinable API functions will be built in this module if required */
|
||||
#include "asterisk/strings.h"
|
||||
@@ -2523,6 +2524,10 @@ void __ast_assert_failed(int condition, const char *condition_str, const char *f
|
||||
condition_str, condition);
|
||||
fprintf(stderr, "FRACK!, Failed assertion %s (%d) at line %d in %s of %s\n",
|
||||
condition_str, condition, line, function, file);
|
||||
|
||||
/* Generate a backtrace for the assert */
|
||||
ao2_bt();
|
||||
|
||||
/*
|
||||
* Give the logger a chance to get the message out, just in case
|
||||
* we abort(), or Asterisk crashes due to whatever problem just
|
||||
|
Reference in New Issue
Block a user