[asterisk-bugs] [Asterisk 0012080]: Deadlock if feature in use while reload attempted
noreply at bugs.digium.com
noreply at bugs.digium.com
Wed Feb 27 11:03:57 CST 2008
The following issue has been ASSIGNED.
======================================================================
http://bugs.digium.com/view.php?id=12080
======================================================================
Reported By: ChaseVenters
Assigned To: file
======================================================================
Project: Asterisk
Issue ID: 12080
Category: Resources/res_features
Reproducibility: random
Severity: crash
Priority: normal
Status: assigned
Asterisk Version: 1.4.18
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 02-26-2008 19:29 CST
Last Modified: 02-27-2008 11:03 CST
======================================================================
Summary: Deadlock if feature in use while reload attempted
Description:
We encountered a deadlock today with Asterisk 1.4.18. I gave Asterisk
SIGSEGV so that I could get a crash dump to see what is going on. (We don't
build with DEBUG_THREADS right now because we had a crash bug in that code
some months prior).
The deadlock appears to be this: in thread 10327, ast_module_reload()
grabs the module_list lock and then nests into the reload() callback for a
module. The res_features.c reload() function calls load_config(), which
calls unmap_features() which attempts to acquire features_lock.
Meanwhile, another thread (10314 in my dump) has features_lock read-locked
inside of ast_feature_interpret(). That calls builtin_blindtransfer()
through the .operation function pointer, which is calling finishup, and
eventually finds its way to ast_update_use_count(), which wants the
module_list lock.
So the "reload" thread 10327 has module_list and wants features_lock.
10314 has features_lock but wants module_list. A deadlock results.
======================================================================
----------------------------------------------------------------------
svnbot - 02-27-08 11:03
----------------------------------------------------------------------
Repository: asterisk
Revision: 104596
U branches/1.4/main/loader.c
------------------------------------------------------------------------
r104596 | file | 2008-02-27 11:03:55 -0600 (Wed, 27 Feb 2008) | 4 lines
Use the lock (which already existed, it just wasn't used) on the updaters
list to protect the contents instead of the overall module list lock.
(closes issue http://bugs.digium.com/view.php?id=12080)
Reported by: ChaseVenters
------------------------------------------------------------------------
http://svn.digium.com/view/asterisk?view=rev&revision=104596
Issue History
Date Modified Username Field Change
======================================================================
02-27-08 11:03 svnbot Checkin
02-27-08 11:03 svnbot Note Added: 0083049
02-27-08 11:03 svnbot Status confirmed => assigned
02-27-08 11:03 svnbot Assigned To => file
======================================================================
More information about the asterisk-bugs
mailing list