[asterisk-bugs] [Asterisk 0018165]: hint state changes deadlock problem

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Nov 1 09:32:01 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18165 
====================================================================== 
Reported By:                antonio
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18165
Category:                   Core/PBX
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.13 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-10-19 13:45 CDT
Last Modified:              2010-11-01 09:32 CDT
====================================================================== 
Summary:                    hint state changes deadlock problem
Description: 
What happens is there are two threads that lock resources in a different
order causing a deadlock.

The threads are:

1. from taskprocessor handle_statechange() is called. This one locks
ast_rdlock_contexts, and then eventually call cb_extensionstate() which
immediately does a sip_pvt_lock()

2. do_monitor calls sipsock_read() which calls handle_request_do() which
calls find_call(), which does a sip_pvt_lock() too. The incoming request is
a subscription, so it calls ast_get_hint(), which calls
ast_hint_extension() which calls ast_rdlock_contexts(). Deadlock.

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

---------------------------------------------------------------------- 
 (0128493) one47 (reporter) - 2010-11-01 09:32
 https://issues.asterisk.org/view.php?id=18165#c128493 
---------------------------------------------------------------------- 
We can cause what I believe is this issue fairly simply in our test lab. We
use:

- multiple copies of "pjsua" registered (about 100 handsets)
- 2 or 3 handsets BLF monitoring for 40 to 80 hints each
- A call script which dials 10 calls per second. The calls hangup after 2
seconds

pjsua uses its default fairly short SIP subscribe period, the handsets
re-subscribe their BLFs in a "flurry" every 30 minutes, and there is
constant call/BLF state activity.

I have so far failed to get any data from asterisk as it locks solid after
an hour or two - This may be because it is in a small "appliance"
environment, and logs are on a RAMFS. This lock does not appear to happen
in 1.6.2.10, but does occur in 1.6.2.11 to 1.6.2.13; I assume this is due
to timing in the BLF code paths as there are no obvious changes.

I am willing to test patches in our test environment. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-11-01 09:32 one47          Note Added: 0128493                          
======================================================================




More information about the asterisk-bugs mailing list