[asterisk-bugs] [Asterisk 0015637]: [patch] Deadlock after peer answeres queue call

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Aug 10 15:53:05 CDT 2009


The following issue has been UPDATED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15637 
====================================================================== 
Reported By:                cstadlmann
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   15637
Category:                   Core/Channels
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 204834 
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-08-03 08:43 CDT
Last Modified:              2009-08-10 15:53 CDT
====================================================================== 
Summary:                    [patch] Deadlock after peer answeres queue call
Description: 
We have the following set up:

Asterisk is hosting a queue with 4 members, ring strategy 'least recent'.
The complete setup is realtime, but I don't think this has anything to do
with the deadlock.

The queue is playing MOH, which is a wav-file (no .mp3). After the SIP
peer answeres the call, MOH stops playing, and exactly in this moment the
deadlock occurs.

It does not matter if queue members are 'Local/' or 'SIP/' channels,
patching Asterisk as stated in Bug 14112 only makes the deadlock occur
every 6 hours, with SIP channels the deadlock occurs every 3 hours or so.

The only way to get Asterisk running again is to 'kill -9' the process. No
other CLI command than one 'core show locks' is working, any subsequent CLI
command does not produce any response anymore.
====================================================================== 

---------------------------------------------------------------------- 
 (0108868) mmichelson (administrator) - 2009-08-10 15:53
 https://issues.asterisk.org/view.php?id=15637#c108868 
---------------------------------------------------------------------- 
All right, I have verified that the problem is not in a stock build of
Asterisk 1.4, and the problem is in your patch.

In do_monitor, after acquiring the sip_pvt lock, you are calling your
transmit_cid_update function. One of the first operations it does is to
call pbx_builtin_getvar_helper (specifically, it is getting the value of
the "CHANNELPICKUP" variable). This is what is causing the deadlock. This
can be avoided by using a DEADLOCK_AVOIDANCE loop similar to what is done
later in the do_monitor function. If you add such a loop just before
calling transmit_cid_update, the problem should go away.

Since the problem is in your patch and not in the code we distribute, I am
going to close this issue. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-10 15:53 mmichelson     Note Added: 0108868                          
2009-08-10 15:53 mmichelson     Status                   acknowledged =>
resolved
2009-08-10 15:53 mmichelson     Resolution               open => no change
required
2009-08-10 15:53 mmichelson     Assigned To               => mmichelson      
2009-08-10 15:53 mmichelson     Status                   resolved => closed  
======================================================================




More information about the asterisk-bugs mailing list