[Home]

Summary:ASTERISK-26441: crash in ast_rtp_ice_add_cand
Reporter:Frederic Steinfels (fredo)Labels:
Date Opened:2016-10-05 10:48:56Date Closed:2016-12-13 09:36:18.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/General Resources/res_rtp_asterisk
Versions:14.0.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Fedora 24, 64bit, i7-5820KAttachments:( 0) gdb.txt
Description:When I try to place a call from, asterisks immediately crashes. The crash always happens in ast_rtp_ice_add_cand. This behaviour is new. Asterisk was working flawlessly for years up to about saturday october 1. I have no clue what has happened on that day. I have moved my asterisk to another fedora 24 machine with less horsepower where it is working flawlessly with the same configuration files. I have compiled version 14.0.2 from source, I tried the original fedora 13.7.2 rpms and the fedora source 13.7.2 rpms. Same behaviour with all of them.
Comments:By: Asterisk Team (asteriskteam) 2016-10-05 10:48:57.312-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: Frederic Steinfels (fredo) 2016-10-05 10:51:01.162-0500

Backtrace

By: Joshua C. Colp (jcolp) 2016-10-09 10:40:33.767-0500

How was PJSIP installed? Did you build it yourself? Could the package have been updated (without rebuilding Asterisk)?

By: Frederic Steinfels (fredo) 2016-10-12 05:43:37.597-0500

I have just updated and rebooted my fedora-24 replacement machine and now asterisk is crashing the same way as the other machine from where I reported the error. To your questions:

# rpm -e asterisk-pjsip
error: package asterisk-pjsip is not installed

# locate pjsip
/usr/include/asterisk/res_pjsip.h
/usr/include/asterisk/res_pjsip_body_generator_types.h
/usr/include/asterisk/res_pjsip_cli.h
/usr/include/asterisk/res_pjsip_outbound_publish.h
/usr/include/asterisk/res_pjsip_presence_xml.h
/usr/include/asterisk/res_pjsip_pubsub.h
/usr/include/asterisk/res_pjsip_session.h
/usr/lib64/libpjsip-simple.so.2
/usr/lib64/libpjsip-ua.so.2
/usr/lib64/libpjsip.so.2
/usr/share/doc/asterisk/configs/basic-pbx/pjsip.conf
/usr/share/doc/asterisk/configs/samples/pjsip.conf.sample
/usr/share/doc/asterisk/configs/samples/pjsip_notify.conf.sample
/usr/share/doc/asterisk/configs/samples/pjsip_wizard.conf.sample

I have deleted /usr/lib64/libpjsip* but asterisk is still crashing immediately after placing a call. And immediately means that not even one line of dialplan logic is executed.



By: Frederic Steinfels (fredo) 2016-10-12 06:25:30.407-0500

maybe this log might help:

maybe this log might help:                                                                  
                                                                                           
ha_ast1*CLI> core set verbose 1000                                                          
Console verbose is still 1000.                                                              
ha_ast1*CLI> core set debug 1000                                                            
Core debug was OFF and is now 1000.                                                        
ha_ast1*CLI> sip set debug on                                                              
SIP Debugging enabled                                                                      
                                                                                           
<--- SIP read from UDP:xx.xx.xx.xx:5060 --->                                              
INVITE sip:s@yy.yy.yy.yy:5060 SIP/2.0                                                    
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bKf3qpiv10581giu8fb4k0.1                    
Max-Forwards: 68                                                                            
From: "07912345678" <sip:07912345678@yy.yy.yy.yy:5069>;tag=as12de7e11                      
To: <sip:0430000000@localproxy:5060>                                                        
Contact: <sip:07912345678@xx.xx.xx.xx:5060;transport=udp>                                  
Call-ID: 5018b1c43a30c0c915e360f527a4f66a@yy.yy.yy.yy:5069                              
CSeq: 102 INVITE                                                                            
User-Agent: e-fon                                                                          
Date: Wed, 12 Oct 2016 11:20:27 GMT                                                        
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE  
Supported: replaces, timer                                                                  
X-IPCONNECT: 0430000000                                                                    
X-Number: 0430000000                                                                        
P-Asserted-Identity: "07912345678" <sip:07912345678@yy.yy.yy.yy>                          
Content-Type: application/sdp                                                              
Content-Length: 409                                                                        
                                                                                           
v=0                                                                                        
o=root 955680351 955680351 IN IP4 xx.xx.xx.xx                                              
s=Asterisk PBX 11.21.1                                                                      
c=IN IP4 xx.xx.xx.xx                                                                      
t=0 0                                                                                      
m=audio 13668 RTP/AVP 8 9 111 3 97 18 0 101                                                
a=rtpmap:8 PCMA/8000                                                                        
a=rtpmap:9 G722/8000                                                                        
a=rtpmap:111 G726-32/8000                                                                  
a=rtpmap:3 GSM/8000                                                                        
a=rtpmap:97 iLBC/8000                                                                      
a=rtpmap:18 G729/8000                                                                      
a=fmtp:18 annexb=no                                                                        
a=rtpmap:0 PCMU/8000                                                                        
a=rtpmap:101 telephone-event/8000                                                          
a=fmtp:101 0-16                                                                            
a=ptime:20                                                                                  
a=sendrecv                                                                                  
<------------->                                                                            
--- (17 headers 18 lines) ---                                                              
Sending to xx.xx.xx.xx:5060 (no NAT)                                                      
Sending to xx.xx.xx.xx:5060 (no NAT)                                                      
Using INVITE request as basis request - 5018b1c43a30c0c915e360f527a4f66a@yy.yy.yy.yy:5069
Found peer '0435440806' for '07912345678' from xx.xx.xx.xx:5060                            
ha_ast1*CLI>                                                                                
Disconnected from Asterisk server                                                          
Asterisk cleanly ending (0).                                                                
Executing last minute cleanups                                                              


By: Frederic Steinfels (fredo) 2016-10-12 06:34:41.668-0500

If I do this in modules.conf

;autoload=yes
load => res_http_websocket.so
load => chan_sip.so

Asterisk will not crash on initiating the call but it will complain with:
ERROR[21886][C-00000000]: rtp_engine.c:405 ast_rtp_instance_new: No RTP engine was found. Do you have one loaded?

Then, if I do this in modules.conf:

;autoload=yes
load => res_rtp_asterisk.so
load => res_http_websocket.so
load => chan_sip.so

Asterisk will crash.


By: Joshua C. Colp (jcolp) 2016-10-12 07:05:17.719-0500

It doesn't really answer my question - I'd still like to know how PJSIP was built. Was Asterisk built with bundled PJSIP?

By: Frederic Steinfels (fredo) 2016-10-12 08:00:34.166-0500

commenting out line 905 in /root/asterisk-14.0.2/res/res_rtp_asterisk.c

candidate->priority = rtp->ice->lcand[rtp->ice->lcand_cnt - 1].prio;

will return asterisk to normal operation.

How I built: downloaded the source file, uncompressed, configured like this:
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info

did "make menuconfig"
deselected the pjsip stuff
made 'make' and 'make install'
removed *pjsip* from /var/lib64/asterisk/modules

but honestly, id does not make a difference if pjsip is built or not. it does not even make a difference if pjsip modules are loaded.

By: Joshua C. Colp (jcolp) 2016-10-12 08:05:27.629-0500

The res_rtp_asterisk module uses pjnath, which comes from pjproject (which is where PJSIP comes from). It absolutely matters how it was built.

If, for example, pjnath is being used as a library and is updated with a change it is entirely possible for you to see the crash you're seeing. The definition of a candidate could be different in the library, and Asterisk could be built against an older definition. Boom. Crash.

By: Joshua C. Colp (jcolp) 2016-10-12 08:06:27.422-0500

The precise version that is on the system is also important as it is another variable in the equation.

By: Joshua C. Colp (jcolp) 2016-10-12 08:07:44.416-0500

Oh, and if multiple pjproject installs are present this can also cause problems. What is the current state of the system and are there multiple installs of pjproject (PJSIP) on it?

By: Frederic Steinfels (fredo) 2016-10-12 08:50:52.943-0500

I am on a standard fedora 24 with all updates installed. I have initially installed asterisk with 'dnf install asterisk'. On my system are asterisk-13.7.2-3.fc24, various other asterisk-* rpms (but not pjsip) plus 'pjproject-2.4.5-6.fc24' plus -devel. Asterisk was working flawlessly and then, about two weeks ago, probably after a 'dnf update', asterisk started to crash as described.

This error now occured on three separate installations. Furthermore as pjsip is not used in my configuration, asterisk should respect that and not call pjsip for no reason at all.

By: Joshua C. Colp (jcolp) 2016-10-12 09:05:06.240-0500

I've asked [~jsmith] to take a look at this as it does seem to be a packaging problem. We can figure out the proper path forward from there.

By: Rusty Newton (rnewton) 2016-12-13 09:36:19.010-0600

Closing this out since it appears to be a packaging problem.

We don't handle the packaging issues, so you should file a bug with the packager's tracker. That should be Fedora in this case.