[Home]

Summary:ASTERISK-23572: chan_pjsip call from endpoint using WS transport to endpoint using UDP sometimes results in a crash after a call from res_rtp_asterisk into pjproject
Reporter:Rusty Newton (rnewton)Labels:
Date Opened:2014-04-02 10:31:46Date Closed:2017-12-18 10:38:19.000-0600
Priority:CriticalRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_pjsip Resources/res_pjsip Resources/res_rtp_asterisk
Versions:SVN 12.1.1 Frequency of
Occurrence
Related
Issues:
Environment: Version: SVN-branch-12-r411634 Build Options: DONT_OPTIMIZE, LOADABLE_MODULES, BETTER_BACKTRACES, BUILD_NATIVE, OPTIONAL_APIAttachments:( 0) backtrace.txt
( 1) configs.txt
( 2) full.txt
( 3) pjsip_console_debug.txt
Description:While testing a WebRTC configuration, with one endpoint setup for ws transport and another setup for udp, occasionally after calling from the ws endpoint to the udp, I found this crash.

{noformat}
Program terminated with signal 6, Aborted.
#0  0x00007f44e46d7425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#0  0x00007f44e46d7425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007f44e46dab8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007f44e46d00ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007f44e46d0192 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007f44e0d54805 in grp_lock_acquire () from /usr/lib/libpj.so.2
No symbol table info available.
#5  0x00007f44e04e146b in pj_ice_sess_send_data () from /usr/lib/libpjnath.so.2
No symbol table info available.
#6  0x00007f4443ef39d0 in __rtp_sendto (instance=0x7f44840d51b8, buf=<optimized out>, size=<optimized out>, sa=0x7f4493542590, rtcp=0, ice=0x7f449354258c, use_srtp=1, flags=0) at res_rtp_asterisk.c:1605
       len = 176
       temp = 0x7f44840deafc
       rtp = 0x7f44840d9700
       srtp = <optimized out>
#7  0x00007f4443ef6ef9 in rtp_sendto (ice=0x7f449354258c, sa=0x7f4493542590, flags=0, size=<optimized out>, buf=<optimized out>, instance=0x7f44840d51b8) at res_rtp_asterisk.c:1622
No locals.
{noformat}

Will attach:
* full log in full.txt,
* console debug in pjsip_console_debug.txt
* backtrace in backtrace.txt

h3. Reproduction:

I followed the configuration I had put on the wiki before, https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5, and configured the SIPML5 client in a browser on the same machine, to connect to localhost.

Call from that extension using WebSockets to another phone using a UDP transport.  Maybe try a dozen times and you should get a crash a couple seconds after one of them.
Comments:By: Rusty Newton (rnewton) 2014-04-02 10:39:08.048-0500

attaching the pjsip.conf config in configs.txt

By: Rusty Newton (rnewton) 2014-04-02 10:46:26.976-0500

Note that the console debug is mostly the same as the full debug, except there is this:
{noformat}
asterisk: ../src/pj/lock.c:286: grp_lock_acquire: Assertion `pj_atomic_get(glock->ref_cnt) > 0' failed.
{noformat}

By: Matt Jordan (mjordan) 2014-04-09 08:58:36.535-0500

The group lock error in here makes me wonder what version of pjproject you were using. You may want to try reproducing it with the latest from the github repo if you were using an older version.

By: Rusty Newton (rnewton) 2014-04-13 15:58:32.535-0500

Looks like I was using the latest from our github repo.

By: Joshua C. Colp (jcolp) 2017-12-18 10:38:19.733-0600

Suspending since work was done in this area by Teluu and it hasn't been seen in recent years.