[asterisk-bugs] [Asterisk 0018403]: [patch] Deadlock on SIP blind transfer (REFER)

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Dec 24 23:47:04 UTC 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18403 
====================================================================== 
Reported By:                jthurman
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18403
Category:                   Channels/chan_sip/Transfers
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           SVN 
JIRA:                       SWP-2667 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!): 296824 
Request Review:              
====================================================================== 
Date Submitted:             2010-11-30 18:25 CST
Last Modified:              2010-12-24 17:47 CST
====================================================================== 
Summary:                    [patch] Deadlock on SIP blind transfer (REFER)
Description: 
All SIP:
- A calls B
- B blind-transfers A to C (Using REFER)
- Asterisk stops responding to SIP requests (Deadlocked)

====================================================================== 

---------------------------------------------------------------------- 
 (0129955) jthurman (reporter) - 2010-12-24 17:47
 https://issues.asterisk.org/view.php?id=18403#c129955 
---------------------------------------------------------------------- 
kkm: I see the deadlock as two threads waiting for each other, not as one
thread waiting on itself.  Here is the flow as I see it with unmodified
source for 1.8 latest SVN:

Thread: do_monitor
---------------------------------
handle_request_do
 handle_incoming
  handle_request_refer
   ast_parking_ext_valid
    pbx_find_extension
     ast_autoservice_stop
      while (chan_list_state == as_chan_list_state) { usleep(1000); }

Thread: autoservice_run
---------------------------------
autoservice_run
 chan = ast_waitfor_n
  ast_waitfor_nandfds
   ast_waitfor_nandfds_classic / simple / complex (depending on your
system)
    ast_channel_lock(c[x]);

At this point, autoservice_run is waiting to lock the channel that was
locked by handle_request_do, and handle_request_refer isn't going to unlock
it until ast_parking_ext_valid returns! Deadlock.



More information about the asterisk-bugs mailing list