[asterisk-bugs] [Asterisk 0017420]: app_queue's compare_weight can be called in contextes that don't lock the global queues lock

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 28 15:37:21 CDT 2010


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17420 
====================================================================== 
Reported By:                tim_ringenbach
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17420
Category:                   Applications/app_queue
Reproducibility:            unable to reproduce
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.31 
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-05-28 15:37 CDT
Last Modified:              2010-05-28 15:37 CDT
====================================================================== 
Summary:                    app_queue's compare_weight can be called in
contextes that don't lock the global queues lock
Description: 
I haven't experienced any crashes from this issue but I thought I would
report it anyway.

I noticed in the code that ring_one() is called from both try_calling()
and wait_for_answer(). The former goes through a lot of trouble to lock the
queues lock if we're using weights. The queues lock is then unlocked right
before weight_for_answer() is called. But wait_for_answer() can also call
ring_one(), which calls ring_entry(), which calls compare_weight(). And
compare_weight() walks the queues list (in 1.4) or iterates the queue ao2
(in trunk).

As a side note: ever thought about creating an ast_assert_locked() macro
that could be used in places that compare_weight that assume locks, to
output a warning if that assumption is ever violated?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-05-28 15:37 tim_ringenbach New Issue                                    
2010-05-28 15:37 tim_ringenbach Asterisk Version          => 1.4.31          
2010-05-28 15:37 tim_ringenbach Regression                => No              
2010-05-28 15:37 tim_ringenbach SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list