]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Merged revisions 259870 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Wed, 28 Apr 2010 21:33:16 +0000 (21:33 +0000)
committerDavid Vossel <dvossel@digium.com>
Wed, 28 Apr 2010 21:33:16 +0000 (21:33 +0000)
commitdf0f9b43ff06f72a2f26555f887323ea3d8dd660
tree3cf571e0bb0490c95dd36e0570f30d418fbffdd3
parent8565df022f28e9edc5d43957e42280a1377f0280
Merged revisions 259870 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r259870 | dvossel | 2010-04-28 16:20:03 -0500 (Wed, 28 Apr 2010) | 39 lines

  Merged revisions 259858 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r259858 | dvossel | 2010-04-28 16:16:03 -0500 (Wed, 28 Apr 2010) | 33 lines

    resolves deadlocks in chan_local

    Issue_1.
    In the local_hangup() 3 locks must be held at the same time... pvt, pvt->chan,
    and pvt->owner.  Proper deadlock avoidance is done when the channel to hangup
    is the outbound chan_local channel, but when it is not the outbound channel we
    have an issue... We attempt to do deadlock avoidance only on the tech pvt, when
    both the tech pvt and the pvt->owner are locked coming into that loop.  By
    never giving up the pvt->owner channel deadlock avoidance is not entirely possible.
    This patch resolves that by doing deadlock avoidance on both the pvt->owner and the pvt
    when trying to get the pvt->chan lock.

    Issue_2.
    ast_prod() is used in ast_activate_generator() to queue a frame on the channel
    and make the channel's read function get called.  This function is used in
    ast_activate_generator() while the channel is locked, which mean's the channel
    will have a lock both from the generator code and the frame_queue code by the
    time it gets to chan_local.c's local_queue_frame code... local_queue_frame
    contains some of the same crazy deadlock avoidance that local_hangup requires,
    and this recursive lock prevents that deadlock avoidance from happening correctly.
    This patch removes ast_prod() from the channel lock so only one lock is held during
    the local_queue_frame function.

    (closes issue #17185)
    Reported by: schmoozecom
    Patches:
          issue_17185_v1.diff uploaded by dvossel (license 671)
          issue_17185_v2.diff uploaded by dvossel (license 671)
    Tested by: schmoozecom, GameGamer43

    Review: https://reviewboard.asterisk.org/r/631/
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@259930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_local.c
main/channel.c