[Asterisk-code-review] chan sip.c: Fix waitid deadlock potential. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Mar 16 14:54:11 CDT 2016


Hello Mark Michelson, Joshua Colp, George Joseph,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/2396

to look at the new patch set (#3).

Change subject: chan_sip.c: Fix waitid deadlock potential.
......................................................................

chan_sip.c: Fix waitid deadlock potential.

This patch is part of a series to resolve deadlocks in chan_sip.c.

Stopping a scheduled event can result in a deadlock if the scheduled event
is running when you try to stop the event.  If you hold a lock needed by
the scheduled event while trying to stop the scheduled event then a
deadlock can happen.  The general strategy for resolving the deadlock
potential is to push the actual starting and stopping of the scheduled
events off onto the scheduler/do_monitor() thread by scheduling an
immediate one shot scheduled event.  Some restructuring may be needed
because the code may assume that the start/stop of the scheduled events is
immediate.

* Made always run check_pendings() under the scheduler thread so scheduler
ids can be checked safely.

ASTERISK-25023

Change-Id: Ia834d6edd5bdb47c163e4ecf884428a4a8b17d52
---
M channels/chan_sip.c
1 file changed, 80 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/96/2396/3
-- 
To view, visit https://gerrit.asterisk.org/2396
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia834d6edd5bdb47c163e4ecf884428a4a8b17d52
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list