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

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


The following issue requires your FEEDBACK. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15637 
====================================================================== 
Reported By:                cstadlmann
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15637
Category:                   Core/Channels
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 204834 
Request Review:              
====================================================================== 
Date Submitted:             2009-08-03 08:43 CDT
Last Modified:              2009-08-10 10:54 CDT
====================================================================== 
Summary:                    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.
====================================================================== 

---------------------------------------------------------------------- 
 (0108853) mmichelson (administrator) - 2009-08-10 10:54
 https://issues.asterisk.org/view.php?id=15637#c108853 
---------------------------------------------------------------------- 
The problem in your output is quite clear. The first thread is attempting
to lock a sip_pvt and then a channel, and the third thread is trying to
lock the channel and then the sip_pvt. This lock ordering is what is
causing the deadlock to occur.

That being said, there are some strange things occurring here. Firstly, if
I update my copy of 1.4 to rev 210575, The line numbers in chan_sip.c do
not match the line numbers in your core show locks output. As an example,
the first thread in your output shows that sip->lock was acquired on line
16751. In my copy, that line is in the middle of a multi-line if statement
which is not attempting to acquire any locks. Secondly, I cannot find any
place in that section of code which calls any function which would result
in pbx_builtin_getvar_helper being called without first safely acquiring
the channel lock. Is your copy of chan_sip modified in some way? I do not
see how such a deadlock could be occurring. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-10 10:54 mmichelson     Note Added: 0108853                          
2009-08-10 10:54 mmichelson     Status                   new => feedback     
======================================================================




More information about the asterisk-bugs mailing list