[Asterisk-code-review] res pjsip session: segfault on already disconnected session (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Mon Aug 15 10:42:11 CDT 2016


Alexei Gradinari has posted comments on this change.

Change subject: res_pjsip_session: segfault on already disconnected session
......................................................................


Patch Set 4:

> I think a full backtrace (of all threads) and a full Asterisk log
 > is needed before confirming this as the fix is needed. This is
 > certainly an off-nominal scenario but understanding how the INVITE
 > session entered a disconnected state before the incoming INVITE was
 > handled is important.

I used SIPp to stress test asterisk using TLS.
The scenario:
SIPp-sender: INVITE transport:TLS -> ASTERISK
ASTERISK: INVITE transport:TLS -> SIPp-receiver
SIPp-receiver: 200 OK with sdp -> ASTERISK
ASTERISK: 200 OK with sdp -> SIPp-sender

If SIPp-sender terminates TCP connection than
the pjproject calls on_tsx_state_changed with state PJSIP_EVENT_TRANSPORT_ERROR.
I think session_inv_on_tsx_state_changed is run on pjsip monitor thread,
at the same time there may be task in the queue of the session serializer.
So when taskprocessor execs the function new_invite,
the session is already in disconnected state.

I see a difference between PJSIP_EVENT_TRANSPORT_ERROR and PJSIP_EVENT_TIMER in
the function session_inv_on_tsx_state_changed.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d28b1fb3b91f0492a911d110049d670fdc3c8d7
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list