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

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jun 2 09:33:38 CDT 2008


The following issue has been RESOLVED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12765 
====================================================================== 
Reported By:                jamessan
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   12765
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             05-30-2008 15:55 CDT
Last Modified:              06-02-2008 09:33 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               
====================================================================== 
06-02-08 09:33  svnbot         Resolution               reopened => fixed   
======================================================================




More information about the asterisk-bugs mailing list