[asterisk-bugs] [Asterisk 0019397]: [patch] Deadlock in queue handling

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jun 2 12:11:33 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19397 
====================================================================== 
Reported By:                byronclark
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19397
Category:                   Applications/app_queue
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.8.4 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-06-01 13:11 CDT
Last Modified:              2011-06-02 12:11 CDT
====================================================================== 
Summary:                    [patch] Deadlock in queue handling
Description: 
Hit a deadlock on queue handling on a lightly loaded system. Output of
"core show locks" in the Additional Information section.

It looks like BETTER_BACKTRACES doesn't really work when the debug
information lives in a separate (installed) debuginfo package. Backtrace
attached to the ticket.

Here's a quick analysis (thread nubmers are gdb/core show locks):
Thread 20/1081149760
====================
Locks Held
----------
hints (pbx.c:4269)
hint (pbx.c:4270)

Blocking On
-----------
queues (app_queue.c:1563)


Thread 15/1088944448
====================
Locks Held
----------
dialogs (astobj2.c:657)
dialog [sip_pvt] (chan_sip.c:16147)

Blocking On
-----------
hints (pbx.c:4425)


Thread 11/1081657664
====================
Locks Held
----------

Blocking On
-----------
queues (app_queue.c:1463)


Thread 5/1102928192
===================
Locks Held
----------
queues (app_queue.c:4427)

Blocking On
-----------
dialogs (chan_sip.c:7358)


Thread 3/1109186880
===================
Locks Held
----------

Blocking On
-----------
queues (app_queue:2337)
====================================================================== 

---------------------------------------------------------------------- 
 (0135644) byronclark (reporter) - 2011-06-02 12:11
 https://issues.asterisk.org/view.php?id=19397#c135644 
---------------------------------------------------------------------- 
irroot - The attached patch (bug19397.diff) doesn't fix the issue. The
problem, in this case, is that the caller of ast_extension_state_del
already holds the dialogs lock when it calls ao2_callback(hints, ...).  The
call to ao2_callback results in the hints lock being taken anyways.  We get
into the deadlock because that path attempts to take the hints lock while
the dialogs lock is held.

Admittedly, the deadlock is pretty rare so far. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-06-02 12:11 byronclark     Note Added: 0135644                          
======================================================================




More information about the asterisk-bugs mailing list