[asterisk-bugs] [Asterisk 0012765]: Manager deadlock when loading a module
noreply at bugs.digium.com
noreply at bugs.digium.com
Mon Jun 2 09:35:48 CDT 2008
A NOTE has been added to this issue.
======================================================================
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: closed
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:35 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.
======================================================================
----------------------------------------------------------------------
svnbot - 06-02-08 09:35
----------------------------------------------------------------------
Repository: asterisk
Revision: 119744
_U trunk/
U trunk/main/manager.c
------------------------------------------------------------------------
r119744 | russell | 2008-06-02 09:35:36 -0500 (Mon, 02 Jun 2008) | 13
lines
Merged revisions 119742 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r119742 | russell | 2008-06-02 09:39:45 -0500 (Mon, 02 Jun 2008) | 5 lines
Improve CLI command blacklist checking for the command manager action.
Previously,
it did not handle case or whitespace properly. This made it possible for
blacklisted
commands to get executed anyway.
(closes issue http://bugs.digium.com/view.php?id=12765)
........
------------------------------------------------------------------------
http://svn.digium.com/view/asterisk?view=rev&revision=119744
Issue History
Date Modified Username Field Change
======================================================================
06-02-08 09:35 svnbot Checkin
06-02-08 09:35 svnbot Note Added: 0087650
======================================================================
More information about the asterisk-bugs
mailing list