[Asterisk-code-review] channel: Hang-up crashed Asterisk while freeing private data. (asterisk[13])

Alexander Traud asteriskteam at digium.com
Fri Aug 26 08:49:04 CDT 2016


Alexander Traud has uploaded a new change for review.

  https://gerrit.asterisk.org/3729

Change subject: channel: Hang-up crashed Asterisk while freeing private data.
......................................................................

channel: Hang-up crashed Asterisk while freeing private data.

Private data of each channel driver is an opaque structure. Some channel drivers
use ast_malloc, some drivers use reference counting. To avoid any crash, this
private data is not released at this place in source code anymore. The general
channel driver cannot do this. Instead, you should investigate why your call was
not hung up, because reaching that code section indicates a software bug.

ASTERISK-26306 #close

Change-Id: Id085417d7e0a5c61382582e7d250b56ab3c00a1b
---
M main/channel.c
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/29/3729/1

diff --git a/main/channel.c b/main/channel.c
index 853935d..b9d3c1c 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2220,8 +2220,12 @@
 	ast_channel_unlock(chan);
 
 	if (ast_channel_tech_pvt(chan)) {
-		ast_log_callid(LOG_WARNING, callid, "Channel '%s' may not have been hung up properly\n", ast_channel_name(chan));
-		ast_free(ast_channel_tech_pvt(chan));
+		ast_log_callid(LOG_WARNING, callid, "Channel '%s' may not have been hung up" \
+			" properly; leaking memory. Please report via http://issues.asterisk.org." \
+			" If feasible, please include" \
+			" http://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace" \
+			" via an interactive session in the GNU Debugger (gdb).\n",
+			ast_channel_name(chan));
 	}
 
 	if (ast_channel_sched(chan)) {

-- 
To view, visit https://gerrit.asterisk.org/3729
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id085417d7e0a5c61382582e7d250b56ab3c00a1b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>



More information about the asterisk-code-review mailing list