[Home]

Summary:ASTERISK-24854: Asterisk with PJSIP segfaults after enabling TLS (SSL) transport
Reporter:Hans van Eijsden (HansVanEijsden)Labels:NewSIP asterisk crash
Date Opened:2015-03-08 20:06:45Date Closed:2015-03-09 06:04:25
Priority:MajorRegression?No
Status:Closed/CompleteComponents:pjproject/pjsip
Versions:SVN 13.2.0 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-24405 pjsip: assert after restart with tls
Environment:Linux 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt4-3~bpo70+1 (2015-02-12) x86_64 Debian GNU/Linux 7Attachments:( 0) compiling.txt
( 1) gdb.txt
( 2) pjsip.transports_custom.conf
Description:After enabling SSL support, Asterisk segfaults seemingly random while connecting. It doesn't matter if I connect with UDP, TCP or TLS and the client doesn't matter too: it occurs with Bria for Mac, Bria for iPhone, Linphone for iPhone, Linphone for WP and Zoiper for WP.
With chan_sip it works fine, with PJSIP not. I've tested it with OpenSSL 1.0.1e and OpenSSL 1.0.2. PJSIP is the newest 2.3.0 from git.
Comments:By: Hans van Eijsden (HansVanEijsden) 2015-03-08 20:07:47.756-0500

I enabled DEBUG_THREADS, DONT_OPTIMIZE and BETTER_BACKTRACES.

Endpoints are configured in pjsip config like this:

{quote}
type=endpoint
aors=7001
auth=7001-auth
allow=g722,alaw,ulaw,gsm,opus
context=from-internal
callerid=device <7001>
dtmf_mode=rfc4733
use_avpf=no
ice_support=yes
media_use_received_transport=yes
trust_id_inbound=yes
send_rpid=yes
rtp_symmetric=yes
rewrite_contact=yes{quote}

I'm pleased to give all the information you need, feel free to ask.

By: Joshua C. Colp (jcolp) 2015-03-09 06:04:25.245-0500

This has been fixed upstream in pjproject in http://trac.pjsip.org/repos/changeset/4972

You can either wait for PJSIP to do a new release, use PJSIP from SVN trunk, or compile pjproject without debugging (which disables the assertion being triggered).

To compile without debugging pjproject has to be built with:

./configure CFLAGS="-DNDEBUG"

As well as any other compiler flags you may need.

By: Hans van Eijsden (HansVanEijsden) 2015-03-09 11:53:39.610-0500

Joshua, I applied -DNDEBUG to pjproject and this has solved all the problems. Asterisk is running great now: perfect! Thank you very much!