[asterisk-bugs] [Asterisk 0012689]: [patch] Possible deadlock: rwlock can't be recursively locked (writelocked)
noreply at bugs.digium.com
noreply at bugs.digium.com
Mon Jun 16 15:36:59 CDT 2008
A NOTE has been added to this issue.
======================================================================
http://bugs.digium.com/view.php?id=12689
======================================================================
Reported By: ys
Assigned To: murf
======================================================================
Project: Asterisk
Issue ID: 12689
Category: PBX/General
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
Asterisk Version: SVN
SVN Branch (only for SVN checkouts, not tarball releases): trunk
SVN Revision (number only!): 117261
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 05-20-2008 08:52 CDT
Last Modified: 06-16-2008 15:36 CDT
======================================================================
Summary: [patch] Possible deadlock: rwlock can't be
recursively locked (writelocked)
Description:
I found, that some thread libs, block thread if one rwlock are locked
twice. But some libs have "Resource deadlock avoided" decision.
This situation present if called __ast_context_destroy() function
(main/pbc.c).
In this function, context is locked and called
ast_context_remove_extension2() function, there context is locked again.
======================================================================
----------------------------------------------------------------------
svnbot - 06-16-08 15:36
----------------------------------------------------------------------
Repository: asterisk
Revision: 123165
U trunk/apps/app_dial.c
U trunk/apps/app_queue.c
U trunk/apps/app_stack.c
U trunk/include/asterisk/pbx.h
U trunk/main/features.c
U trunk/main/pbx.c
------------------------------------------------------------------------
r123165 | murf | 2008-06-16 15:36:56 -0500 (Mon, 16 Jun 2008) | 19 lines
(closes issue http://bugs.digium.com/view.php?id=12689)
Reported by: ys
Many thanks to ys for doing the research on this problem.
I didn't think it would be best to unlock the contexts
and then relock them after the remove_extension2() call,
so I added an extra arg to remove_extension2() and set it
appropriately in each call. There were not that many.
I considered forcing the code to lock the contexts before
the call to remove_extension2(), but that would require
a slightly greater degree of changes, especially since
the find_context_locked is local to pbx.c
I did a simple sanity test to make sure the code doesn't
mess things up in general.
------------------------------------------------------------------------
http://svn.digium.com/view/asterisk?view=rev&revision=123165
Issue History
Date Modified Username Field Change
======================================================================
06-16-08 15:36 svnbot Note Added: 0088774
======================================================================
More information about the asterisk-bugs
mailing list