[Asterisk-code-review] chan iax2: Prevent deadlock between hangup and sending lagrq... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Thu May 7 11:41:10 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: chan_iax2: Prevent deadlock between hangup and sending lagrq/ping
......................................................................


Patch Set 6:

(1 comment)

https://gerrit.asterisk.org/#/c/169/6/channels/chan_iax2.c
File channels/chan_iax2.c:

Line 2071: 
         : 
         : 
         : 
         : 
> This is exactly was my first solution (Patch 1); but it created deadlocks w
I see now why it didn't deadlock before.  AST_SCHED_DEL_SPINLOCK() only tries 10 times to delete the scheduled callback before giving up.  If it happened to be executing the callback when hangup was trying to delete the callback, it might not delete the scheduled callback.  If iax2_destroy_helper is called with the mutex locked twice then in that case it definitely wouldn't delete it.  When the callback was able to get the lock it should normally find out that the call doesn't exist anymore and quit but it might find itself operating on the next call using the callno.  No deadlock but a chance for strange behavior.


-- 
To view, visit https://gerrit.asterisk.org/169
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Y Ateya <y.ateya at starkbits.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list