[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 16:12:42 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:                     closed
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             05-20-2008 08:52 CDT
Last Modified:              06-16-2008 16:12 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 16:12  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 123173

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_dial.c
U   branches/1.6.0/apps/app_queue.c
U   branches/1.6.0/apps/app_stack.c
U   branches/1.6.0/include/asterisk/pbx.h
U   branches/1.6.0/main/features.c
U   branches/1.6.0/main/pbx.c

------------------------------------------------------------------------
r123173 | murf | 2008-06-16 16:12:40 -0500 (Mon, 16 Jun 2008) | 27 lines

Merged revisions 123165 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r123165 | murf | 2008-06-16 14:43:46 -0600 (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=123173 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-16-08 16:12  svnbot         Checkin                                      
06-16-08 16:12  svnbot         Note Added: 0088776                          
======================================================================




More information about the asterisk-bugs mailing list