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

Y Ateya asteriskteam at digium.com
Thu May 14 17:30:56 CDT 2015


Y Ateya has posted comments on this change.

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


Patch Set 11:

(1 comment)

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

Line 1706: 	/* Mark pingid as invalid scheduler id. */
         : 	iaxs[callno]->pingid = -1;
> You missed my point.  pingid becomes invalid when send_ping() returns.  __s
I understood that after send_ping return (and before __send_ping start to execute), pingid has a value (while it should be -1). But this will be corrected very soon (when send_ping runs).

The worst case is that iax2_delete_from_sched might be called while pingid holds invalid id; any ast_sched_find_data will prevent deleting invalid id.

Also I didn't like locking mutex in scheduler context (which triggered the dead lock at the first place); this is why I moved all checks from send_ping to __send_ping.

Anyways, if you still see that it is better to move pingid=-1 to send_ping, I will do it.


-- 
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: 11
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.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