[Home]

Summary:ASTERISK-25337: Crash on PJSIP_HEADER Add P-Asserted-Identity when calling from Gosub
Reporter:Jacques Peacock (jpeacock)Labels:
Date Opened:2015-08-21 10:26:43Date Closed:2016-02-15 19:28:32.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:pjproject/pjsip Resources/res_pjsip
Versions:SVN 13.3.0 13.5.0 Frequency of
Occurrence
Constant
Related
Issues:
is duplicated byASTERISK-25823 SIGSEGV, Segmentation fault. - ../sysdeps/x86_64/strlen.S: No such file or directory.
Environment:VM built on VMware vcenter, running on a SSD based SANAttachments:( 0) backtrace.txt
( 1) full.txt
( 2) messages.txt
( 3) rusty_extensions.txt
( 4) rusty_pjsip.txt
Description:We have an asterisk system configured to an external SIP trunk using the PJSIP driver using UDP as the transport. We use ael for our dialplan.

Asterisk is installed using the Digium repository, we do not compile it as we run approx 10 asterisk servers in various configurations, so we use the repos to make synchronising versions straightforward.

Example endpoint configuration:
{noformat}
;======ENDPOINT
[testtrunk]
type = endpoint
context = ael-incoming-sm
disallow = all
allow = alaw
transport=udptrans
direct_media = yes
direct_media_glare_mitigation = outgoing
from_user = ourserver
from_domain = ourdomain.local
tos_audio = ef
language = en
aors = myaors
send_pai = yes
{noformat}

Calls arrive from the remote trunk with the P-Asserted-Identity header populated.

If send_pai is set to yes in the endpoint configuration, then attempting to add the header manually causes asterisk to crash with a segmentation fault:
{noformat}
Dial(PJSIP/111111@testtrunk,,b(ael-setheaders^setheaders^1));

context ael-setheaders
{
// Set SIP headers for the outgoing channel
setheaders =>
{
Set(PJSIP_HEADER(add,P-Asserted-Identity)=sip:01234456789@domain.local);
Return();
}
}
{noformat}
If send_pai is set to no, then the command works as expected.

I would not expect a crash to be the normal behaviour here, I would normally expect either a CLI error to occur or the set command to succeed
Comments:By: Asterisk Team (asteriskteam) 2015-08-21 10:26:45.611-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: Richard Mudgett (rmudgett) 2015-08-21 10:57:07.136-0500

Thank you for your bug report. In order to move your issue forward, we require a backtrace[1] from the core file produced after the crash. Also, be sure you have DONT_OPTIMIZE enabled in menuselect within the Compiler Flags section, then:

make install

After enabling, reproduce the crash, and then execute the backtrace[1] instructions. When complete, attach that file to this issue report.

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



By: Asterisk Team (asteriskteam) 2015-09-04 12:00:18.798-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

By: Rusty Newton (rnewton) 2015-09-29 18:38:40.998-0500

Reproduced this. It is important to  run the Set with PJSIP_HEADER inside the Gosub.

Attaching backtrace and logs.

Backtrace appears very similar to ASTERISK-25295

Unsure if it is a duplicate. I'll have a developer look at it.

By: Mark Michelson (mmichelson) 2015-09-30 10:42:26.518-0500

I don't think this is a duplicate of ASTERISK-25295.

By: George Joseph (gjoseph) 2015-11-29 15:35:10.568-0600

I can't reproduce this issue either with extensions.conf or extensions.ael.  In both cases, the value of send_pai makes no difference.  The added header always takes precedence.

Rusty:  can you share the config you used to reproduce?


By: Rusty Newton (rnewton) 2015-12-10 16:06:00.432-0600

[~gtj] it took me a while to get back to this. I pulled the latest 13 from git and reproduced it again (Asterisk GIT-13-c344fb0.)

I attached rusty_pjsip.txt and rusty_extensions.txt with the config I used.

Register a phone to each pjsip endpoint and then have ALICE call BOB at 6002, Asterisk should crash every time.

By: George Joseph (gjoseph) 2016-02-15 14:20:19.268-0600

Sorry.  I'm just getting back to this but I can reproduce it.