[asterisk-bugs] [Asterisk 0019256]: [patch] Crash when using hagi and no servers are available

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 27 19:13:14 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19256 
====================================================================== 
Reported By:                byronclark
Assigned To:                rmudgett
====================================================================== 
Project:                    Asterisk
Issue ID:                   19256
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.8.3.3 
JIRA:                       SWP-3438 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-05-09 17:42 CDT
Last Modified:              2011-05-27 19:13 CDT
====================================================================== 
Summary:                    [patch] Crash when using hagi and no servers are
available
Description: 
Our system uses hagi urls in the dialplan like this:
exten => _[*0-9].,n(AGI),Agi(hagi://agi/outgoing.agi)

When none of the servers returned by the SRV querey for _agi._tcp.agi
respond, asterisk crashes.  The problem is that the loop over all the
entries has finishes, then the srv_context has already been cleaned up. The
only time the context needs to cleaned up is when a successful connection
to an agi server has been made.

The attached patch (against svn trunk) ensures that ast_srv_cleanup is not
called on an already cleaned up context.  The patch is needed on both trunk
and the 1.8 branch.
====================================================================== 

---------------------------------------------------------------------- 
 (0135521) svnbot (reporter) - 2011-05-27 19:13
 https://issues.asterisk.org/view.php?id=19256#c135521 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 321392

U   branches/1.8/main/srv.c

------------------------------------------------------------------------
r321392 | rmudgett | 2011-05-27 18:45:41 -0500 (Fri, 27 May 2011) | 12
lines

Crash when using hagi and no servers are available.

When none of the servers returned by the SRV querey respond, asterisk
crashes.  The problem is that if the loop over all the SRV entries
finishes then the srv_context has already been cleaned up.

* Make ast_srv_cleanup() check to see if the context is already cleaned
up.

(closes issue https://issues.asterisk.org/view.php?id=19256)
Reported by: byronclark

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=321392 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-27 19:13 svnbot         Note Added: 0135521                          
======================================================================




More information about the asterisk-bugs mailing list