[asterisk-bugs] [Asterisk 0018491]: [patch] fix SIP indicate deadlocks when lots of state changes

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Dec 20 19:18:13 UTC 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18491 
====================================================================== 
Reported By:                cmaj
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18491
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.8.1.1 
JIRA:                       SWP-2760 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-12-16 16:21 CST
Last Modified:              2010-12-20 13:18 CST
====================================================================== 
Summary:                    [patch] fix SIP indicate deadlocks when lots of
state changes
Description: 
Running 1.8.2-rc1 and was able to deadlock several times during failed SIP
state change indications.  Found by testing 4 SIP phones in close proximity
and rapidly, yet manually, transferring blind, parking calls, picking them
up at another phone, etc.  Also, was using the Bridge() app for buddy
pickup purposes.
====================================================================== 

---------------------------------------------------------------------- 
 (0129806) cmaj (reporter) - 2010-12-20 13:18
 https://issues.asterisk.org/view.php?id=18491#c129806 
---------------------------------------------------------------------- 
Phone situation:
----------------

Registered 4 phones, 5081-5084.

5081 & 5082 context=the-parkers
5083 & 5084 context=the-stealers

Extension 5082 registers hints for 5081 & 5083 & 701 (parking lot space
1).


Dialplan examples:
------------------

[the-stealers]
exten => _XXXX,1,Set(DB(lastcall/${EXTEN})=${CHANNEL})
exten => _XXXX,n,Dial(SIP/${EXTEN})
exten => _*XXXX,1,Bridge(${DB(lastcall/${EXTEN:1})})
exten => _XXXX,hint,SIP/${EXTEN}

[the-parkers]
include => the-stealers
exten => 701,1,ParkedCall(${EXTEN})
exten => 702,1,ParkedCall(${EXTEN})
exten => 701,hint,park:701 at parkedcalls
exten => 702,hint,park:702 at parkedcalls
exten => 700,1,NoOp
exten => 700,n,Set(PARKINGEXTEN=701)
exten => 700,n,Park()
exten => 700,n,Set(PARKINGEXTEN=702)
exten => 700,n,Park()


Call flow:
----------

The most important element of the flow to uncover this locking bug was the
speed at which the transfers are taking place.  Try this:

1. From 5083 dial 5081 - do not answer at 5081.
2. While still ringing, dial *5081 from 5082 to pickup the call.
3. 5082 blind xfers to 700 (using REFER via custom "Park" soft key.)
4. 5083 gets announcement "701" then MOH.
5. When MOH starts, 5082 dials 701 to pickup the parked call.
6. Repeat steps 3-5 three times.  Rapidly.
7. 5082 blind xfers to 5084.
8. 5084 answers and IMMEDIATELY blind xfers to 5081.  (Not even enough
time to say "hello.")
9. Hangup this call from 5083.
10. Repeat steps 1-9.
11. LOCK HERE -- See core_show_locks.txt attachment from 2010-12-16.


Further comments:
-----------------

Problem I believe is in queue'd up sip_notify() calls -- or perhaps the
lack of queue'ing of such calls.  This bug does not manifest itself w/o the
"hint" line in extensions.conf so it is very much in the NOTIFY handlers. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-20 13:18 cmaj           Note Added: 0129806                          
======================================================================




More information about the asterisk-bugs mailing list