[asterisk-bugs] [Asterisk 0017407]: [patch] DEADLOCK_AVOIDANCE can actually generate dealocks

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jul 2 21:43:07 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17407 
====================================================================== 
Reported By:                pdf
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   17407
Category:                   Core/General
Reproducibility:            sometimes
Severity:                   block
Priority:                   normal
Status:                     closed
Target Version:             1.4.34
Asterisk Version:           1.4.31 
JIRA:                       SWP-1584 
Regression:                 No 
Reviewboard Link:           https://reviewboard.asterisk.org/r/751/ 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-05-27 00:23 CDT
Last Modified:              2010-07-02 21:43 CDT
====================================================================== 
Summary:                    [patch] DEADLOCK_AVOIDANCE can actually generate
dealocks
Description: 
We have reported this issue to Digium support, however were asked to submit
the patch via this tracker.

In brief: the DEADLOCK_AVOIDANCE macro attempts to release an existing
lock, then relock after a usleep(1), to allow other code to proceed around
the lock.  However, it doesn't actually check to see if a lock was released
by the unlock, before taking a new lock.  This means that whenever there is
no lock released, a new lock is taken that will never be released, meaning
that DEADLOCK_AVOIDANCE actually leaks locks, which can obviously lead to a
deadlock.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0017414 [patch] ss_thread calls pri_grab withou...
====================================================================== 

---------------------------------------------------------------------- 
 (0124200) svnbot (reporter) - 2010-07-02 21:43
 https://issues.asterisk.org/view.php?id=17407#c124200 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 273831

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_agent.c
U   branches/1.6.2/channels/chan_h323.c
U   branches/1.6.2/channels/chan_local.c
U   branches/1.6.2/include/asterisk/lock.h

------------------------------------------------------------------------
r273831 | tilghman | 2010-07-02 21:43:06 -0500 (Fri, 02 Jul 2010) | 23
lines

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

................
  r273830 | tilghman | 2010-07-02 21:36:31 -0500 (Fri, 02 Jul 2010) | 16
lines
  
  Merged revisions 273793 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r273793 | tilghman | 2010-07-02 16:36:39 -0500 (Fri, 02 Jul 2010) | 9
lines
    
    Have the DEADLOCK_AVOIDANCE macro warn when an unlock fails, to help
catch potentially large software bugs.
    
    (closes issue https://issues.asterisk.org/view.php?id=17407)
     Reported by: pdf
     Patches: 
           20100527__issue17407.diff.txt uploaded by tilghman (license 14)
     
    Review: https://reviewboard.asterisk.org/r/751/
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=273831 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-02 21:43 svnbot         Checkin                                      
2010-07-02 21:43 svnbot         Note Added: 0124200                          
======================================================================




More information about the asterisk-bugs mailing list