Asterisk crash on ast_codec_samples_count() for IAX2_Chan

Hello,

We am using FreePBX 12.0.76.2 with asterisk 13.7.2, with a big ARI implementation (1000 lines). We occasionally have asterisk crashes, and looking into the core dump, we see:

Program terminated with signal 11, Segmentation fault.
#0 0x00000000005183be in ast_format_get_codec ()
Missing separate debuginfos, use: debuginfo-install asterisk13-core-13.7.2-1.shmz65.1.94.x86_64
^[[?1034h(gdb) bt
#0 0x00000000005183be in ast_format_get_codec ()
#1 0x00000000004d7559 in ast_codec_samples_count ()
#2 0x00007ff135d0139b in ?? () from /usr/lib64/asterisk/modules/chan_iax2.so
#3 0x00007ff135d017fc in ?? () from /usr/lib64/asterisk/modules/chan_iax2.so
#4 0x00007ff135d01fc2 in ?? () from /usr/lib64/asterisk/modules/chan_iax2.so

Looking in the full log at that time we found:

[2016-03-20 08:30:05] VERBOSE[2897] chan_iax2.c: Accepting AUTHENTICATED call from 213.151.45.44:55001:
> requested format = alaw,
> requested prefs = (),
> actual format = ulaw,
> host prefs = (ulaw|alaw|siren14|siren7|g722|slin16|slin|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g729|g723),
> priority = mine
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [1001@from-internal:1] Gosub(“IAX2/9105-2459”, “StartKhlListen,start,1(from-internal,1001)”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:1] NoOp(“IAX2/9105-2459”, “entering from-internal / 1001 from 9105”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:2] Set(“IAX2/9105-2459”, “CONTEXT2=from-internal”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:3] Set(“IAX2/9105-2459”, “EXTEN2=1001”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:4] Set(“IAX2/9105-2459”, “AGC(rx)=32000”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:5] Set(“IAX2/9105-2459”, “AGC(tx)=32000”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:6] Set(“IAX2/9105-2459”, “DENOISE(rx)=on”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:7] Set(“IAX2/9105-2459”, “DENOISE(tx)=on”) in new stack
[2016-03-20 08:30:05] VERBOSE[57923][C-0000396d] pbx.c: Executing [start@StartKhlListen:8] Stasis(“IAX2/9105-2459”, “KhlSystemApp”) in new stack

Any idea what cause this or how to circumvent the problem?

Thanks,
Eyal Hasson.

I’d suggest getting a backtrace[1] and then filing an issue[2] with configuration details and scenario information.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace
[2] https://issues.asterisk.org/jira

You will need the debuginfo package that is mentioned in your output, and you will need an unoptimised build.