[Home]

Summary:ASTERISK-27264: res_pjsip_session: Crashes after sending PRACK and receiving 200 OK
Reporter:Daniel Heckl (DanielYK)Labels:fax pjsip
Date Opened:2017-09-08 10:12:14Date Closed:2017-09-22 11:38:29
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip_session
Versions:GIT Frequency of
Occurrence
Related
Issues:
Environment:GIT-master-991750dAttachments:( 0) core_dump.zip
( 1) debug.txt
Description:Asterisk crashes after sending PRACK and receiving OK.

Please see attached export from cli.

{quote}
<--- Transmitting SIP request (548 bytes) to UDP:217.0.23.132:5060 --->
PRACK sip:sgc_c@217.0.23.132;transport=udp SIP/2.0
Via: SIP/2.0/UDP 91.33.123.456:5060;rport;branch=z9hG4bKPj009be255-5335-4fe1-a98f-30917aafbb61
From: <sip:+4912345678914@tel.t-online.de>;tag=e975a90c-d2ad-4746-a3c3-c831a84f3073
To: <sip:012345678910@tel.t-online.de>;tag=h7g4Esbg_p65543t1504882705m812824c352549895s1_3474707275-997376043
Call-ID: 0a003aa4-0c1b-4ddb-9ed0-67a62881e097
CSeq: 10767 PRACK
Route: <sip:217.0.23.132;transport=udp;lr>
RAck: 2 10766 INVITE
Max-Forwards: 70
User-Agent: FPBX-14.0.1.4(14)
Content-Length:  0


-- PJSIP/012345678911-00000004 is making progress passing it to Local/012345678910@from-internal-00000005;2
-- Local/012345678910@from-internal-00000005;1 is making progress passing it to Local/RG-2002-012345678910#@from-internal-00000004;2
<--- Received SIP response (630 bytes) from UDP:217.0.23.132:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 91.33.123.456:5060;received=91.33.123.456;rport=5060;branch=z9hG4bKPj009be255-5335-4fe1-a98f-30917aafbb61
To: <sip:012345678910@tel.t-online.de>;tag=h7g4Esbg_p65543t1504882705m812824c352549895s1_3474707275-997376043
From: <sip:+4912345678914@tel.t-online.de>;tag=e975a90c-d2ad-4746-a3c3-c831a84f3073
Call-ID: 0a003aa4-0c1b-4ddb-9ed0-67a62881e097
CSeq: 10767 PRACK
Supported: timer
Supported: 100rel
Supported: histinfo
Supported: norefersub
Supported: precondition
Content-Length: 0
Allow: REGISTER, REFER, NOTIFY, SUBSCRIBE, INFO, PRACK, UPDATE, INVITE, ACK, OPTIONS, CANCEL, BYE


[2017-09-08 16:58:28] DEBUG[4700]: res_pjsip_session.c:3494 session_inv_on_tsx_state_changed: PRACK received final response code 200
asterisk*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups
{quote}
Comments:By: Asterisk Team (asteriskteam) 2017-09-08 10:12:15.863-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2017-09-08 10:27:00.512-0500

Thank you for the crash report. However, we need more information to investigate the crash. Please provide:

1. A backtrace generated from a core dump using the instructions provided on the Asterisk wiki [1].
2. Specific steps taken that lead to the crash.
3. All configuration information necesary to reproduce the crash.

Thanks!

[1]: https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

As well please confirm the version you are using. You put "14.7.0" as affects but your environment shows "GIT-master-991750d" which is from the master branch, not 14 branch or a 14 release.

By: Daniel Heckl (DanielYK) 2017-09-08 10:48:38.427-0500

The issue occurs while calling an extension with activated followme, so a mobile phone is called. When the mobile phone sends the call to the voicemail, asterisk crashes.

Attached is the backtrace. I hope it is correct and it includes what you need. If you need something else, let me know.

By: Daniel Heckl (DanielYK) 2017-09-08 10:52:56.179-0500

pjsip.endpoint.conf
{quote}
[0123456789]
type=endpoint
transport=0.0.0.0-udp
context=from-pstn
disallow=all
allow=g722,alaw
aors=0123456789
language=en
outbound_auth=0123456789
from_domain=tel.t-online.de
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
t38_udptl_nat=no
send_rpid=yes
send_pai=yes
dtmf_mode=auto
{quote}

By: Daniel Heckl (DanielYK) 2017-09-10 08:34:17.951-0500

I have re-tested the issue with GIT-14-b4faf94 and Asterisk does not crash.

By: George Joseph (gjoseph) 2017-09-19 08:08:29.967-0500

Hi Daniel,

I've been trying to reproduce this issue for the past few days without much luck.  I do see the crash in core.asterisk-2017-09-08T12-48-49+0200-full.txt and I can patch that issue but it'd still be good to understand the cause.  I'm not sure which of the coredumps matches the debug.txt though.   Is the crash continuing to happen?  Can you get a matching debug log and dumps?

Also I noticed that the debug.txt attached isn't showing all the debug messages I'd expect.  What debug level are you running and is it for all of asterisk or just certain modules?  If you're worried about posting sensitive data, you can send me a tarball via email.

--edit--

Also, it appears that there ARE checks in the code for that crash which SHOULD have spit out ASSERT messages since you have --enable-dev-mode turned on.  I don't see them though.  When you get a new log, please make sure that it has all errors, warnings, debugs, etc in it.



By: Friendly Automation (friendly-automation) 2017-09-22 11:11:53.809-0500

Change 6548 merged by Joshua Colp:
res_pjsip_session:  Change some asserts to warning/debug messages

[https://gerrit.asterisk.org/6548|https://gerrit.asterisk.org/6548]

By: Friendly Automation (friendly-automation) 2017-09-22 11:12:13.801-0500

Change 6549 merged by Joshua Colp:
res_pjsip_session:  Change some asserts to warning/debug messages

[https://gerrit.asterisk.org/6549|https://gerrit.asterisk.org/6549]

By: Friendly Automation (friendly-automation) 2017-09-22 11:12:24.675-0500

Change 6550 merged by Joshua Colp:
res_pjsip_session:  Change some asserts to warning/debug messages

[https://gerrit.asterisk.org/6550|https://gerrit.asterisk.org/6550]