[asterisk-bugs] [Asterisk 0016677]: [patch] deadlock in app_queue with use_weight during reload

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 10 11:51:36 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16677 
====================================================================== 
Reported By:                tim_ringenbach
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   16677
Category:                   Applications/app_queue
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     closed
Target Version:             1.4.31
Asterisk Version:           1.4.29 
JIRA:                       SWP-782 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-01-22 17:47 CST
Last Modified:              2010-02-10 11:51 CST
====================================================================== 
Summary:                    [patch] deadlock in app_queue with use_weight during
reload
Description: 
There's a deadlock possible in app_queue if the use_weight global variable
is set, and someone reloads app_queue at the right point in time while a
call is coming in. The call's thread locks the queue list lock, but doesn't
unlock it, resulting in a dead lock when other threads try to do anything
with the queue list.

To reproduce easily, add a sleep() between the first if (use_weight) and
grabbing the lock.

I'll attach a patch that fixes the problem by using a local variable to
store a copy of use_weight.
====================================================================== 

---------------------------------------------------------------------- 
 (0117955) svnbot (reporter) - 2010-02-10 11:51
 https://issues.asterisk.org/view.php?id=16677#c117955 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 246117

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_queue.c

------------------------------------------------------------------------
r246117 | dvossel | 2010-02-10 11:51:34 -0600 (Wed, 10 Feb 2010) | 21
lines

Merged revisions 246116 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r246116 | dvossel | 2010-02-10 11:49:34 -0600 (Wed, 10 Feb 2010) | 14
lines
  
  Merged revisions 246115 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r246115 | dvossel | 2010-02-10 11:44:20 -0600 (Wed, 10 Feb 2010) | 8
lines
    
    fixes random deadlock in app_queue with use_weight during reload
    
    (closes issue https://issues.asterisk.org/view.php?id=16677)
    Reported by: tim_ringenbach
    Patches:
          app_queue_use_weight_deadlock.diff uploaded by tim ringenbach
(license 540)
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=246117 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-02-10 11:51 svnbot         Checkin                                      
2010-02-10 11:51 svnbot         Note Added: 0117955                          
======================================================================




More information about the asterisk-bugs mailing list