[Home]

Summary:ASTERISK-21244: Crash in libsrtp when attempting to unprotect RTCP packet
Reporter:Jacob Randall (jacobrandall)Labels:
Date Opened:2013-03-13 17:20:33Date Closed:2013-04-25 20:10:53
Priority:CriticalRegression?
Status:Closed/CompleteComponents:Resources/res_srtp
Versions:1.8.15.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 12.10 64-bitAttachments:( 0) backtrace.txt
Description:This issue is blocking all use of our production Asterisk server. I'll be attaching the backtrace.txt file. Thanks in advance for your help!

Installed asterisk from source and it worked perfectly for days, then today it suddenly stopped working. I can start the Asterisk service and as soon as a call is attempted it crashes / segfaults and does a core dump if run with that option to do a core dump.

Only message in /var/log/... is in the syslog:

Mar 13 21:49:23 ip-10-212-91-161 kernel: [ 6471.432979] asterisk[24621] general protection ip:{redacted} sp:{redaced} error:0 in res_srtp.so[7f7551ce3000+13000]
Comments:By: Jacob Randall (jacobrandall) 2013-03-13 17:22:45.776-0500

Backtrace of issue.

By: Matt Jordan (mjordan) 2013-03-13 17:32:45.819-0500

You're crashing in {{libsrtp}}:

{noformat}
#0  0x00007f8e6490632e in rdb_add_index () from /usr/lib/asterisk/modules/res_srtp.so
#0  0x00007f8e6490632e in rdb_add_index () from /usr/lib/asterisk/modules/res_srtp.so
No symbol table info available.
#1  0x00007f8e6490240f in srtp_unprotect_rtcp () from /usr/lib/asterisk/modules/res_srtp.so
No symbol table info available.
{noformat}

{{srtp_unprotected_rtcp}} is actually a function call in {{libsrtp}}. Historically, when we've seen crashes in {{libsrtp}}, they've been extremely difficult to reproduce.

# Did something change in this library on your system? What version of it are you running?
# If you disable SRTP, do you continue to have issues?
# What phone model is calling in that causes the crash? What is the relevant portion of the dialplan?
# Can you provide a pcap with RTP/RTCP/SIP leading up to the crash?



By: Jacob Randall (jacobrandall) 2013-03-13 17:45:40.419-0500

First of all, wow, thanks for such a fast response!

Answers to questions in above comment:

1. Nope, nothing was changed from when it was working to when it started breaking. I literally went to sleep with it working and the next day it was not working.
2. Checking on this, will post what I find
3. Currently testing with Snom 370 to outside line, and Snom 370 to internal line on Blink Lite. It also failed on Snom 370 to Snom 370. Here are the dialplan details:
exten => {redacted sip trunk auth name},1,Answer()
exten => {redacted sip trunk auth name},n,Wait(2)
exten => {redacted sip trunk auth name},n,Background(/usr/share/asterisk/customsounds/aaGreeting)
exten => {redacted sip trunk auth name},n,WaitExten()
exten => {redacted sip trunk auth name},n,Hangup()

exten => 8,1,Directory
exten => 8,n,Hangup

exten => *98,1,VoiceMailMain
exten => *98,n,Hangup


exten => _X.,1,Dial(SIP/${EXTEN},20)
exten => _X.,n,Voicemail(${EXTEN},u)
exten => _X.,n,Hangup()

exten => _NXXXXXXXXX,1,Dial(SIP/trunk1/${EXTEN})
exten => _NXXXXXXXXX,n,Congestion()
exten => _NXXXXXXXXX,n,Hangup()

exten => _1NXXXXXXXXX,1,Dial(SIP/trunk1/${EXTEN})
exten => _1NXXXXXXXXX,n,Congestion()
exten => _1NXXXXXXXXX,n,Hangup()

exten => _+NXXXXXXXXX,1,Dial(SIP/trunk1/${EXTEN})
exten => _+NXXXXXXXXX,n,Congestion()
exten => _+NXXXXXXXXX,n,Hangup()

exten => _+1NXXXXXXXXX,1,Dial(SIP/trunk1/${EXTEN})
exten => _+1NXXXXXXXXX,n,Congestion()
exten => _+1NXXXXXXXXX,n,Hangup()


4. Haven't done this before so I will research how to do it and then post the results. If there is an example on a forum or a preferred way you have of me doing this, let me know and I'll be happy to follow that.

By: Jacob Randall (jacobrandall) 2013-03-13 17:46:53.758-0500

Just a quick note, I have looked very thoroughly through the logs but am continuing to look to find anything strange. I'll post if I find anything.

By: Rusty Newton (rnewton) 2013-04-09 13:05:45.837-0500

{quote}

   Did something change in this library on your system? What version of it are you running?
   If you disable SRTP, do you continue to have issues?
   What phone model is calling in that causes the crash? What is the relevant portion of the dialplan?
   Can you provide a pcap with RTP/RTCP/SIP leading up to the crash?
{quote}

We still would like to know:

1. What version of it (libsrtp) are you running?

2. If you disable SRTP, do you continue to have issues?

3. Can you provide a pcap with RTP/RTCP/SIP leading up to the crash?

For 3. you can Google guides or tutorials on using the Linux tcpdump command or the wireshark application to gather the necessary pcaps. Basically use either of the tools to capture all traffic on the appropriate ports and to/from the appropriate hosts.

By: Rusty Newton (rnewton) 2013-04-25 20:10:46.661-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines