[Home]

Summary:ASTERISK-17823: [patch] Crash when using hagi and no servers are available
Reporter:Byron Clark (byronclark)Labels:
Date Opened:2011-05-09 17:42:51Date Closed:2011-05-27 19:17:37
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace.txt
( 1) crash_when_hagi_not_available.patch
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.
Comments:By: Digium Subversion (svnbot) 2011-05-27 19:13:14

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 ASTERISK-17823)
Reported by: byronclark

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

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

By: Digium Subversion (svnbot) 2011-05-27 19:17:37

Repository: asterisk
Revision: 321393

_U  trunk/
U   trunk/main/srv.c

------------------------------------------------------------------------
r321393 | rmudgett | 2011-05-27 18:46:07 -0500 (Fri, 27 May 2011) | 19 lines

Merged revisions 321392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 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 ASTERISK-17823)
 Reported by: byronclark
........

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

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