[Asterisk-code-review] pjsip distributor.c: Fix deadlock with TCP type transports. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Jun 30 16:58:57 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/5919 )

Change subject: pjsip_distributor.c: Fix deadlock with TCP type transports.
......................................................................


Patch Set 2:

> I'm worrying that on destroying dialog we will not always remove it
 > from a dialog associations container.

There are several mitigating factors to reduce that kind of problem:

* We do clear out the endpoint and the serializer from the dialog when the dialog is to be destroyed.  When both are cleared we remove the object from the container.  ast_sip_dialog_set_serializer() and ast_sip_dialog_set_endpoint() are always called together by existing code to store and clear the pointers.

* If it were somehow not removed from the container, only the small distributor_dialog_data object is leaked since it does not hold serializer or endpoint references.

* Since the container key is the dialog pointer, the object can even be "reclaimed" if later on another dialog gets created at the same memory location.


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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I9ed63f4da9649e9db6ed4be29c360968917a89bd
Gerrit-Change-Number: 5919
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 30 Jun 2017 21:58:57 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170630/a20cdadd/attachment.html>


More information about the asterisk-code-review mailing list