[asterisk-bugs] [Asterisk 0012765]: Manager deadlock when loading a module

noreply at bugs.digium.com noreply at bugs.digium.com
Fri May 30 15:55:32 CDT 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12765 
====================================================================== 
Reported By:                jamessan
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12765
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.20 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             05-30-2008 15:55 CDT
Last Modified:              05-30-2008 15:55 CDT
====================================================================== 
Summary:                    Manager deadlock when loading a module
Description: 
manager.c:process_message calls "ast_rwlock_rdlock(&actionlock);" when
determining what action needs to be run.  When it finds the command, the
lock is still held while that action is run.  If this is a "module load"
action, it is quite likely that the loaded resource will then call
ast_manager_register/ast_manager_register2 to add their own commands to the
manager interface.  Those functions in turn call
"ast_rwlock_wrlock(&actionlock);" which results in a deadlock.

At first glance, unlocking the rdlock once the matching action has been
found would seem the right thing to do.  After some thought though, it
seems like that would only be safe if the action is one that's native to
the manager interface.  Otherwise, the manager may get interrupted
immediately after releasing the lock, but before calling the action, by
something that then removes the action from the actionlist.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-30-08 15:55  jamessan       Asterisk Version          => 1.4.20          
05-30-08 15:55  jamessan       SVN Branch (only for SVN checkou => N/A          
  
======================================================================




More information about the asterisk-bugs mailing list