[Home]

Summary:ASTERISK-17268: [patch] [regression] crash while looking up realtime presence hint
Reporter:Byron Clark (byronclark)Labels:
Date Opened:2011-01-21 11:57:52.000-0600Date Closed:2011-07-27 13:20:03
Priority:CriticalRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_sip/Subscriptions
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk.log
( 1) backtrace.txt
( 2) channel_crash_with_null_tech.patch
( 3) gdb-channel.txt
Description:After upgrading from 1.6.2.11 to 1.6.2.16.1, I'm seeing a crash as soon as the first Subscription request for presence arrives.

It appears the crash is caused by ast_autoservice_start being called on the mostly empty channel created main/pbx.c:ast_add_extension2_lockopt():

/* If we are adding a hint evalulate in variables and global variables */
if (priority == PRIORITY_HINT && strstr(application, "${") && !strstr(extension, "_")) {
struct ast_channel c = {0, };

ast_copy_string(c.exten, extension, sizeof(c.exten));
ast_copy_string(c.context, con->name, sizeof(c.context));
pbx_substitute_variables_helper(&c, application, expand_buf, sizeof(expand_buf));
application = expand_buf;
}



****** ADDITIONAL INFORMATION ******

Here's are the (hopefully) relevant portions of the configs responsible for the presence hints scheme in use as this is probably related:

extconfig.conf
==============
presence_hints      => pgsql,pbxs,asterisk_presence_hint
hints.conf          => pgsql,pbxs,asterisk_config


extensions.conf
===============
[subscribe]
#include "hints.conf"


hints.conf [from realtime database]
===================================
=# SELECT * FROM asterisk_config WHERE filename='hints.conf' AND category='01272b71-ee86-35f9-af63-000100420001';
 filename  |                  id                  | cat_metric |               category               | commented | var_metric | var_name |                                  var_val                                  
------------+--------------------------------------+------------+--------------------------------------+-----------+------------+----------+---------------------------------------------------------------------------
hints.conf | 01272b71-ee8e-35fc-af63-000100420001 |          0 | 01272b71-ee86-35f9-af63-000100420001 |         0 |          0 | exten    | _X.,hint,${CUT(REALTIME(presence_hints,key,${CONTEXT}:${EXTEN},:,:),:,4)}


Presence Hints [from realtime database]
=======================================
# SELECT * FROM asterisk_presence_hint WHERE key LIKE '01272b71-ee86-35f9-af63-000100420001:%';
                 id                  |                                                                     hint                                                                      |                    key                    
--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------
0127e325-6489-f81d-6533-006300620001 | SIP/0127e3256489f81c6533006300620001                                                                                                          | 01272b71-ee86-35f9-af63-000100420001:1001
01272b73-85de-88d3-bd91-000100620001 | SIP/0128d5efc9c276be27ba006300620001&SIP/012aa5c11931a1860c006300620001&SIP/012aa59fa86666260c006300620001&SIP/012ca3c624cdd9a247006300620001 | 01272b71-ee86-35f9-af63-000100420001:1234
Comments:By: Byron Clark (byronclark) 2011-01-21 11:59:47.000-0600

gdb-channel.txt shows the contents of the chan variable when __ast_read() is called immediately before the crash.

By: Byron Clark (byronclark) 2011-01-24 12:59:07.000-0600

The attached channel_crash_with_null_tech.patch works around the issue by not calling ast_autoservice_start on the dummy channel.  There's probably a better place to put this.

By: Russell Bryant (russell) 2011-07-27 13:19:57.849-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

If this is still an issue, please open a new issue so it can be re-triaged appropriately. Thanks!