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

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jun 2 08:33:26 CDT 2008


The following issue requires your FEEDBACK. 
====================================================================== 
http://bugs.digium.com/view.php?id=12765 
====================================================================== 
Reported By:                jamessan
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   12765
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
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:              06-02-2008 08: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.
====================================================================== 

---------------------------------------------------------------------- 
 file - 06-02-08 08:33  
---------------------------------------------------------------------- 
Can you please grab a backtrace according to doc/backtrace.txt so we can
confirm that is indeed where the deadlock is happening? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-02-08 08:33  file           Note Added: 0087639                          
06-02-08 08:33  file           Status                   assigned => feedback
======================================================================




More information about the asterisk-bugs mailing list