[Home]

Summary:ASTERISK-29205: res_rtp_asterisk: Asterisk crashes when making hold/unhold from webrtc client
Reporter:Edvin Vidmar (edvinv)Labels:patch webrtc
Date Opened:2020-12-09 03:15:54.000-0600Date Closed:2021-02-18 10:35:12.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_rtp_asterisk
Versions:18.1.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:ubuntuAttachments:( 0) 0001-res_rtp_asterisk.c-Fix-unsigned-comparison-that-lead.patch
( 1) ari-traffic.txt
( 2) core-full.txt
( 3) full
( 4) full-with-sip
( 5) messages
Description:Hi,
I have two clients (both audio and video) connected to Asterisk using webrtc. On asterisk there is ARI application. Both clients are in sfu bridge and communication works OK. I have implemented local hold/unhold. Hold disables all tracks and set direction to inactive. So far all works ok. But when I click hold/unhold very quickly 20+ times asterisk will crash. From my side this is 100% repeatable. I'm not sure if this happens only when hold/unhold quickly changes or it may happens (what concerns me) after long time uses. I have  included backtrace, I hope it has necessary information.

br
edvin
Comments:By: Asterisk Team (asteriskteam) 2020-12-09 03:16:02.604-0600

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. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Joshua C. Colp (jcolp) 2020-12-09 03:51:35.855-0600

The line numbers for the crash in question don't seem to line up with 18.0.1. Do you have any patches or is this a different version? As well is there console output to accompany this?

By: Edvin Vidmar (edvinv) 2020-12-10 03:27:20.106-0600

No I have no patches, just standard install. Maybe the problem was because it was docker installation. Now I generated backtrace without docker and also included full and messages log files.

By: Edvin Vidmar (edvinv) 2020-12-10 03:29:04.636-0600

And this is not in log files, only on console:

*** stack smashing detected ***: asterisk terminated
Aborted (core dumped)


By: Kevin Harwell (kharwell) 2020-12-10 09:31:09.264-0600

Please attach your configuration (confbridge.conf, extensions.conf, musiconhold.conf, and pjsip.conf).

As well please include an Asterisk debug log [1] that also contains a SIP trace. SIP trace can be enabled using the following CLI command:
{noformat}
*CLI> pjsip set logger on
{noformat}

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

By: Kevin Harwell (kharwell) 2020-12-10 09:34:05.743-0600

Does this problem occur when there is only one client connected in the bridge?

By: Sean Bright (seanbright) 2020-12-10 13:00:11.705-0600

[~edvinv], can you apply [the attached patch|^0001-res_rtp_asterisk.c-Fix-unsigned-comparison-that-lead.patch] and try to reproduce the crash please?

By: Edvin Vidmar (edvinv) 2020-12-11 03:10:37.949-0600

I have attached ari-traffic.txt where you can see call flow. Webrtc endpoint 3000 calls endpoint 3001. First bridge is created and channel 3000 is added to bridge, after that endpoint 3001 is called, when answered it is added to bridge. After that I put 3000 on hold/unhold and hangup session.

By: Edvin Vidmar (edvinv) 2020-12-11 03:11:20.744-0600

File full-with-sip is full log with sip enabled.

By: Edvin Vidmar (edvinv) 2020-12-11 03:11:52.143-0600

I have no confbridge, so all logic is in node application connected with ari to asterisk. Also all pjsip configuration is dynamic.
This is typical pjsip configuration (all other is default).

pjsip: {
auth: {
auth_type: "userpass"
},
aor: {
max_contacts: "5"
},
udpEndpoint: {
context: "crossty-agents",
transport: "transport-udp",
identify_by: "header,username",
allow: "!all, alaw",
moh_suggest: "none",
rewrite_contact: "yes",
direct_media: "no",
force_rport: "yes",
rtp_symmetric: "yes"
},
webrtcIdentify: {
},
webrtcEndpoint: {
context: "crossty-agents",
transport: "transport-wss",
identify_by: "username",

dtls_auto_generate_cert: "yes",
webrtc: "yes",
bundle: "yes",
direct_media: "no",
allow: "!all,alaw,vp8",
moh_suggest: "none",
max_audio_streams: "4",
max_video_streams: "4"
}
}




By: Edvin Vidmar (edvinv) 2020-12-11 03:51:49.981-0600

I just rebuild asterisk with proposed patch and it works. I was not able to crash asterisk again. Before it was very easy to repeat. Even from application side all works correctly.

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:13.236-0600

Change 15478 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15478|https://gerrit.asterisk.org/c/asterisk/+/15478]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:18.367-0600

Change 15487 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15487|https://gerrit.asterisk.org/c/asterisk/+/15487]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:20.754-0600

Change 15477 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15477|https://gerrit.asterisk.org/c/asterisk/+/15477]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:23.305-0600

Change 15486 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15486|https://gerrit.asterisk.org/c/asterisk/+/15486]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:27.445-0600

Change 15485 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15485|https://gerrit.asterisk.org/c/asterisk/+/15485]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:30.868-0600

Change 15483 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15483|https://gerrit.asterisk.org/c/asterisk/+/15483]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:34.202-0600

Change 15488 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15488|https://gerrit.asterisk.org/c/asterisk/+/15488]

By: Friendly Automation (friendly-automation) 2021-02-18 10:35:38.523-0600

Change 15476 merged by George Joseph:
res_rtp_asterisk.c: Fix signed mismatch that leads to overflow

[https://gerrit.asterisk.org/c/asterisk/+/15476|https://gerrit.asterisk.org/c/asterisk/+/15476]