Hey everyone,
We've got a strange segfault issue: we can run our UniMRCP doing TTS for quite a while, but after ~2000 translations we started getting segfaults in Asterisk. It has crashed several different places, but all of them seem to be related to modifying schannel->name.
We're preloading app_unimrcp in Asterisk but not using res_speech or res_speech_unimrcp.
System is CentOS 5.8, unimrcp-deps 1.1.2, Asterisk 1.8.11.0
Here are the backtrace's for two (the first is *much* more common) kinds of segfaults we're getting:
-----------
Program terminated with signal 11, Segmentation fault.
#0 speech_channel_destroy (schannel=0xf6b5658) at app_unimrcp.c:2063
2063 schannel->name = NULL;
#0 speech_channel_destroy (schannel=0xf6b5658) at app_unimrcp.c:2063
__PRETTY_FUNCTION__ = "speech_channel_destroy"
#1 0x00002aaaaaabd384 in app_synth_exec (chan=0x2aaac8043ee8, data=<value optimized out>) at app_unimrcp.c:4704
dtmf_enable = 1
f = 0xa0
fr = {frametype = AST_FRAME_VOICE, subclass = {integer = 4, codec = 4}, datalen = 160, samples = 160, mallocd = 0,
mallocd_hdr_len = 0, offset = 64, src = 0x2aaaaaac0887 "app_synth_exec", data = {ptr = 0x4da04080, uint32 = 1302347904,
pad = "\200@\240M\000\000\000"}, delivery = {tv_sec = 0, tv_usec = 0}, frame_list = {next = 0x0}, flags = 0, ts = 0, len = 0,
seqno = 0}
next = {tv_sec = 1335506424, tv_usec = 243134}
dobreak = 124
ms = <value optimized out>
len = 160
rres = <value optimized out>
schannel = 0xf6b5658
profile_name = 0xa0 <Address 0xa0 out of bounds>
speech_channel_number = 4710
name = "TTS-4710", '\000' <repeats 191 times>
fp = 0x0
dtmfkey = 4
res = 0
args = {argc = 2, argv = 0x4da05788,
text = 0x4da03f90 "<speak xmlns=\"
http://www.w3.org/2001/10/synthesis\" version=\"1.0\" xml:lang=\"en-US\"> <voice name=\"Kate\"> <prosody rate=\"1.0\">You selected Your pouridge was too hot. Is this correct?</prosody> </voice> <"..., options = 0x4da04060 "i=any"}
option_profile = '\000' <repeats 255 times>
option_prate = '\000' <repeats 31 times>
option_pvolume = '\000' <repeats 31 times>
option_interrupt = "0123456789#*ABCD", '\000' <repeats 47 times>
option_filename = '\000' <repeats 383 times>
option_language = '\000' <repeats 15 times>
option_loadlexicon = '\000' <repeats 15 times>
option_voicename = '\000' <repeats 127 times>
option_voicegender = '\000' <repeats 15 times>
option_voiceage = '\000' <repeats 31 times>
option_voicevariant = '\000' <repeats 127 times>
owriteformat = <value optimized out>
__PRETTY_FUNCTION__ = "app_synth_exec"
----------------
Program terminated with signal 11, Segmentation fault.
#0 audio_queue_destroy (queue=0xbd00be8) at app_unimrcp.c:873
873 queue->pool = NULL;
#0 audio_queue_destroy (queue=0xbd00be8) at app_unimrcp.c:873
name = 0xbd00bd8 <Address 0xbd00bd8 out of bounds>
__PRETTY_FUNCTION__ = "audio_queue_destroy"
#1 0x00002aaaaaab4d4f in speech_channel_destroy (schannel=0xba43978) at app_unimrcp.c:2038
__PRETTY_FUNCTION__ = "speech_channel_destroy"
#2 0x00002aaaaaabc384 in app_synth_exec (chan=0xbb66dc8, data=<value optimized out>) at app_unimrcp.c:4704
dtmf_enable = 1
f = 0xa0
fr = {frametype = AST_FRAME_VOICE, subclass = {integer = 4, codec = 4}, datalen = 160, samples = 160, mallocd = 0,
mallocd_hdr_len = 0, offset = 64, src = 0x2aaaaaabf887 "app_synth_exec", data = {ptr = 0x40d43080, uint32 = 1087647872,
pad = "\200\060\324@\000\000\000"}, delivery = {tv_sec = 0, tv_usec = 0}, frame_list = {next = 0x0}, flags = 0, ts = 0, len = 0,
seqno = 0}
next = {tv_sec = 1335504259, tv_usec = 760639}
dobreak = 124
ms = <value optimized out>
len = 160
rres = <value optimized out>
schannel = 0xba43978
profile_name = 0xa0 <Address 0xa0 out of bounds>
speech_channel_number = 1838
name = "TTS-1838", '\000' <repeats 191 times>
fp = 0x0
dtmfkey = 4
res = 0
args = {argc = 2, argv = 0x40d44788,
text = 0x40d42f30 "<speak xmlns=\"
http://www.w3.org/2001/10/synthesis\" version=\"1.0\" xml:lang=\"en-US\"> <voice name=\"Kate\"> <prosody rate=\"1.0\">Hello Goldy Locks Press 1 for Your pouridge was too cold. Press 2 for Your po"..., options = 0x40d43052 "i=any"}
option_profile = '\000' <repeats 255 times>
option_prate = '\000' <repeats 31 times>
option_pvolume = '\000' <repeats 31 times>