calejost / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

Asterisk 11 crashes when starting #148

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Asterisk 11 crashes when starting with compiled modules res_speech_unimrcp.so 
and app_unimrcp.so

OS: CentOS 5.8
Asterisk: 11.0.1
unimrcp: from svn r1849
asterisk-unimrcp: from svn r1849

#asterisk -cvvvdddg
...
 res_agi.so => (Asterisk Gateway Interface (AGI))
  == Registered application 'SendFAX'
  == Registered application 'ReceiveFAX'
  == Registered custom function 'FAXOPT'
 res_fax.so => (Generic FAX Applications)
 res_ael_share.so => (share-able code for AEL)
 res_curl.so => (cURL Resource Module)
  == Registered custom function 'CURL'
  == Registered custom function 'CURLOPT'
 func_curl.so => (Load external URL)
  == Parsing '/etc/asterisk/res_config_sqlite3.conf': Found
 res_config_sqlite3.so => (SQLite 3 realtime config engine)
 res_config_curl loaded.
 res_config_curl.so => (Realtime Curl configuration)
 res_timing_pthread.so => (pthread Timing Interface)
  == Registered RTP engine 'multicast'
 res_rtp_multicast.so => (Multicast RTP Engine)
  == Parsing '/etc/asterisk/codecs.conf': Found
 res_format_attr_silk.so => (SILK Format Attribute Module)
  == Parsing '/etc/asterisk/musiconhold.conf': Found
  == Registered application 'MusicOnHold'
  == Registered application 'WaitMusicOnHold'
  == Registered application 'SetMusicOnHold'
  == Registered application 'StartMusicOnHold'
  == Registered application 'StopMusicOnHold'
 res_musiconhold.so => (Music On Hold Resource)
Segmentation fault (core dumped)

Backtrace:

(gdb) bt
#0  0x08090064 in INTERNAL_OBJ (user_data=0x30726874) at astobj2.c:151
#1  0x080905eb in internal_ao2_ref (user_data=0x30726874, delta=1, 
file=0x8205b58 "astobj2.c", line=539, func=0x8205d3e "__ao2_ref") at 
astobj2.c:425
#2  0x080909ca in __ao2_ref (user_data=0x30726874, delta=1) at astobj2.c:539
#3  0x08150a82 in ast_read_threadstorage_callid () at logger.c:1294
#4  0x08151f70 in __ast_verbose (file=0x8236e54 "rtp_engine.c", line=143, 
func=0x8236ea2 "ast_rtp_engine_register2", level=2, fmt=0x8236f93 "Registered 
RTP engine '%s'\n")
    at logger.c:1777
#5  0x0819e3a0 in ast_rtp_engine_register2 (engine=0x3d1880, module=0x972d548) 
at rtp_engine.c:143
#6  0x0039755f in load_module () at res_rtp_asterisk.c:4481
#7  0x0814afa0 in start_resource (mod=0x972d548) at loader.c:821
#8  0x0814ba71 in load_resource_list (load_order=0xbfc8da14, global_symbols=0, 
mod_count=0xbfc8da0c) at loader.c:1021
#9  0x0814c0cd in load_modules (preload_only=0) at loader.c:1174
#10 0x0808e40e in main (argc=4, argv=0xbfc8efa4) at asterisk.c:4109

(gdb) bt full
#0  0x08090064 in INTERNAL_OBJ (user_data=0x30726874) at astobj2.c:151
        p = 0x30726860
        __PRETTY_FUNCTION__ = "INTERNAL_OBJ"
#1  0x080905eb in internal_ao2_ref (user_data=0x30726874, delta=1, 
file=0x8205b58 "astobj2.c", line=539, func=0x8205d3e "__ao2_ref") at 
astobj2.c:425
        obj = 0x3d14cc
        obj_mutex = 0x3c74b1
        obj_rwlock = 0xbfc8d6a8
        current_value = 136188267
        ret = 0
        __PRETTY_FUNCTION__ = "internal_ao2_ref"
#2  0x080909ca in __ao2_ref (user_data=0x30726874, delta=1) at astobj2.c:539
        __FUNCTION__ = "__ao2_ref"
#3  0x08150a82 in ast_read_threadstorage_callid () at logger.c:1294
        callid = 0x3d24c0
#4  0x08151f70 in __ast_verbose (file=0x8236e54 "rtp_engine.c", line=143, 
func=0x8236ea2 "ast_rtp_engine_register2", level=2, fmt=0x8236f93 "Registered 
RTP engine '%s'\n")
    at logger.c:1777
        callid = 0x0
        ap = 0xb7b1fb90 "\220\373\261\267P\321\327\267\220\373\261\267\001"
#5  0x0819e3a0 in ast_rtp_engine_register2 (engine=0x3d1880, module=0x972d548) 
at rtp_engine.c:143
        current_engine = 0x0
        __PRETTY_FUNCTION__ = "ast_rtp_engine_register2"
#6  0x0039755f in load_module () at res_rtp_asterisk.c:4481
        lock = 0xb7d7ebac
#7  0x0814afa0 in start_resource (mod=0x972d548) at loader.c:821
        tmp = "\033[0;33mMusic On Hold Resource\033[0m\000e\033[0m\000\060m\000\000\000\000\000\000\000\000\200\200", '\000' <repeats 16 times>, "gL\244\000\000\000\000\000\000\000\000\000\b倀\264\177\000\000\364\377\275\000\240,\237\000\240,\237\000\270\330\310\277\210\354\023\b\200\237r\t\031\000\200\200\000\000\000\000\002\000\000\000\000\000\000\000\002\000\000\000\060\260t\t\300\274q\t\000\000\000\000\300\274\200\200\350\330\310\277\277\356\023\b0\260t\t\300\274q\t\031\000\000\000\363q\"\b\350\367$\b2\000\000\000\063\000\000\000\031\000\000\000\000\000\264\177\240,\237\000\030\331\310\277\372\355\023\b\200\237r\t\031\000\000\000\300\274q\t\342N\"\b\034O\"\bH\325r\t(\331\310\277\210\343q\t\003\000\000\000H\325r\t(\331\310\277\213\357\023\b\200\237r\t"
        res = AST_MODULE_LOAD_DECLINE
        __PRETTY_FUNCTION__ = "start_resource"
#8  0x0814ba71 in load_resource_list (load_order=0xbfc8da14, global_symbols=0, 
mod_count=0xbfc8da0c) at loader.c:1021
        resource_heap = 0x9729f80
        order = 0x0
        mod = 0x972d548
        count = 8
        res = 0
        __PRETTY_FUNCTION__ = "load_resource_list"
#9  0x0814c0cd in load_modules (preload_only=0) at loader.c:1174
        cfg = 0xb7d60738
        mod = 0x0
        order = 0x0
        v = 0x0
        load_count = 200
        load_order = {first = 0x0, last = 0x0}
        res = 0
        config_flags = {flags = 0}
        modulecount = 9
        dirent = 0x0
        dir = 0xb7d26558
        __PRETTY_FUNCTION__ = "load_modules"
#10 0x0808e40e in main (argc=4, argv=0xbfc8efa4) at asterisk.c:4109
        c = -1
        filename = '\000' <repeats 79 times>
        hostname = "unit02.titanium", '\000' <repeats 48 times>
        tmp = "\000\000\000\000\tC\351\034\000\000\000\000\264\177\000\000\364\377\275\000T\306\037\bT\306\037\b\230\355\310\277\366\222\266\000\300\273$\b\br$\b\270\355\310\277G\307\024\b\300\273$\b\300/\237\000\274\271\375\267\br$\bT\306\037\b\000\000\000\000\370\355\310\277"
        xarg = 0x0
        x = 4
        f = 0x93df1d0
        sigs = {__val = {134238211, 0 <repeats 31 times>}}
        num = -1077350968
        isroot = 1
        rundir_exists = 1
        buf = 0x6f697369 <Address 0x6f697369 out of bounds>
        runuser = 0x0
        rungroup = 0x0
        remotesock = 0x0
        moduleresult = 0
        l = {rlim_cur = 102403, rlim_max = 102403}
        __PRETTY_FUNCTION__ = "main"
        __func__ = "main"

(gdb) thread apply all bt

Thread 17 (Thread 32693):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x823e2d8 "taskprocessor.c", 
lineno=308, func=0x823e674 "tps_processing_function", cond_name=0x823e6ed 
"&i->poll_cond", 
    mutex_name=0x823e6d6 "&i->taskprocessor_lock", cond=0x93df288, t=0x93df2bc) at lock.c:547
#4  0x081d1111 in tps_processing_function (data=0x93df284) at 
taskprocessor.c:308
#5  0x081e23e8 in dummy_start (data=0x93df4b0) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 16 (Thread 32694):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00b52cb3 in poll () from /lib/libc.so.6
#2  0x080853ac in listener (unused=0x0) at asterisk.c:1380
#3  0x081e23e8 in dummy_start (data=0x93ec498) at utils.c:1030
#4  0x00a42852 in start_thread () from /lib/libpthread.so.0
#5  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 15 (Thread 32695):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x8228bd4 "logger.c", lineno=1150, 
func=0x82297c1 "logger_thread", cond_name=0x82297ef "&logcond", 
    mutex_name=0x82297e1 "&logmsgs.lock", cond=0x82667a0, t=0x824fca8) at lock.c:547
#4  0x081504bf in logger_thread (data=0x0) at logger.c:1150
#5  0x081e23e8 in dummy_start (data=0x93ed788) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 14 (Thread 32696):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x8218cd4 "db.c", lineno=929, 
func=0x8219ecc "db_sync_thread", cond_name=0x8219ec4 "&dbcond", 
mutex_name=0x8218f83 "&dblock", 
    cond=0x8265ca0, t=0x824d040) at lock.c:547
#4  0x080fca6a in db_sync_thread (data=0x0) at db.c:929
#5  0x081e23e8 in dummy_start (data=0x9401640) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 13 (Thread 32697):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x823e2d8 "taskprocessor.c", 
lineno=308, func=0x823e674 "tps_processing_function", cond_name=0x823e6ed 
"&i->poll_cond", 
    mutex_name=0x823e6d6 "&i->taskprocessor_lock", cond=0x94954d0, t=0x9495504) at lock.c:547
#4  0x081d1111 in tps_processing_function (data=0x94954cc) at 
taskprocessor.c:308
#5  0x081e23e8 in dummy_start (data=0x94953a8) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 12 (Thread 32698):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00b52cb3 in poll () from /lib/libc.so.6
#2  0x081e2732 in ast_wait_for_input (fd=9, ms=-1) at utils.c:1118
#3  0x081d28e9 in ast_tcptls_server_root (data=0x824efa0) at tcptls.c:286
#4  0x081e23e8 in dummy_start (data=0xb7d0a438) at utils.c:1030
#5  0x00a42852 in start_thread () from /lib/libpthread.so.0
#6  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 11 (Thread 32699):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00b52cb3 in poll () from /lib/libc.so.6
#2  0x081e2732 in ast_wait_for_input (fd=10, ms=5000) at utils.c:1118
#3  0x081d28e9 in ast_tcptls_server_root (data=0x82502c0) at tcptls.c:286
#4  0x081e23e8 in dummy_start (data=0x96e7308) at utils.c:1030
#5  0x00a42852 in start_thread () from /lib/libpthread.so.0
#6  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 10 (Thread 32700):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x8219f54 "devicestate.c", 
lineno=541, func=0x821a2a0 "do_devstate_changes", cond_name=0x821a290 
"&change_pending", 
    mutex_name=0x821a2b4 "&state_changes.lock", cond=0x8265d00, t=0x824d388) at lock.c:547
#4  0x080fdb5e in do_devstate_changes (data=0x0) at devicestate.c:541
#5  0x081e23e8 in dummy_start (data=0xb7d0b230) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 9 (Thread 32701):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x8236934 "presencestate.c", 
lineno=296, func=0x8236bab "do_presence_changes", cond_name=0x8236b9b 
"&change_pending", 
    mutex_name=0x8236bbf "&state_changes.lock", cond=0x8266900, t=0x8251b68) at lock.c:547
#4  0x0819d9f0 in do_presence_changes (data=0x0) at presencestate.c:296
#5  0x081e23e8 in dummy_start (data=0xb7d0b440) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 8 (Thread 32702):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x823e2d8 "taskprocessor.c", 
lineno=308, func=0x823e674 "tps_processing_function", cond_name=0x823e6ed 
"&i->poll_cond", 
    mutex_name=0x823e6d6 "&i->taskprocessor_lock", cond=0xb7d13c00, t=0xb7d13c34) at lock.c:547
#4  0x081d1111 in tps_processing_function (data=0xb7d13bfc) at 
taskprocessor.c:308
#5  0x081e23e8 in dummy_start (data=0xb7d16100) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 7 (Thread 32703):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00b52cb3 in poll () from /lib/libc.so.6
#2  0x08120cb7 in do_parking_thread (ignore=0x0) at features.c:5260
#3  0x081e23e8 in dummy_start (data=0x9704ac0) at utils.c:1030
#4  0x00a42852 in start_thread () from /lib/libpthread.so.0
#5  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 6 (Thread 32704):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x823e2d8 "taskprocessor.c", 
lineno=308, func=0x823e674 "tps_processing_function", cond_name=0x823e6ed 
"&i->poll_cond", 
    mutex_name=0x823e6d6 "&i->taskprocessor_lock", cond=0x9708f50, t=0x9708f84) at lock.c:547
#4  0x081d1111 in tps_processing_function (data=0x9708f4c) at 
taskprocessor.c:308
#5  0x081e23e8 in dummy_start (data=0x9709048) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 5 (Thread 32705):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x823aeac "sched.c", lineno=120, 
func=0x823aef6 "sched_run", cond_name=0x823af0b "&con->sched_thread->cond", 
    mutex_name=0x823af00 "&con->lock", cond=0x9709adc, t=0x97092f0) at lock.c:547
#4  0x081c55f3 in sched_run (data=0x97092f0) at sched.c:120
#5  0x081e23e8 in dummy_start (data=0x9709b98) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 4 (Thread 32706):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00b52cb3 in poll () from /lib/libc.so.6
#2  0x001b0a92 in xmpp_io_recv (client=0x9711d4c, 
    buffer=0xb7b932d1 "<iq from=\"asterisk@sip.dialink/asterisk-xmpp\" to=\"asterisk@sip.dialink/asterisk-xmpp\" type=\"result\" id=\"aaaaf\"><query xmlns=\"http://jabber.org/protocol/disco#info\"><identity category=\"client\" type=\"pc"..., buf_len=16382, timeout=1) at res_xmpp.c:3434
#3  0x001b0bbc in xmpp_client_receive (client=0x9711d4c, timeout=1) at 
res_xmpp.c:3461
#4  0x001b0f4b in xmpp_client_thread (data=0x9711d4c) at res_xmpp.c:3533
#5  0x081e23e8 in dummy_start (data=0x970f450) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 3 (Thread 32707):
#0  0x00745402 in __kernel_vsyscall ()
#1  0x00a46c05 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00b6915d in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3  0x0814c7ba in __ast_cond_wait (filename=0x9c15b4 "res_timing_pthread.c", 
lineno=469, func=0x9c1884 "do_timing", cond_name=0x9c1649 
"&timing_thread.cond", 
    mutex_name=0x9c1635 "&timing_thread.lock", cond=0x9c2e84, t=0x9c2e64) at lock.c:547
#4  0x009c0fdd in do_timing (arg=0x0) at res_timing_pthread.c:469
#5  0x081e23e8 in dummy_start (data=0x975e420) at utils.c:1030
#6  0x00a42852 in start_thread () from /lib/libpthread.so.0
#7  0x00b5ca8e in clone () from /lib/libc.so.6

Thread 2 (Thread 32708):
#0  0x00b5ca78 in clone () from /lib/libc.so.6
#1  0x003d0f00 in ?? ()
#2  0x00000000 in ?? ()

Thread 1 (Thread 0xb7fd96d0 (LWP 32692)):
#0  0x08090064 in INTERNAL_OBJ (user_data=0x30726874) at astobj2.c:151
#1  0x080905eb in internal_ao2_ref (user_data=0x30726874, delta=1, 
file=0x8205b58 "astobj2.c", line=539, func=0x8205d3e "__ao2_ref") at 
astobj2.c:425
#2  0x080909ca in __ao2_ref (user_data=0x30726874, delta=1) at astobj2.c:539
#3  0x08150a82 in ast_read_threadstorage_callid () at logger.c:1294
#4  0x08151f70 in __ast_verbose (file=0x8236e54 "rtp_engine.c", line=143, 
func=0x8236ea2 "ast_rtp_engine_register2", level=2, fmt=0x8236f93 "Registered 
RTP engine '%s'\n")
    at logger.c:1777
#5  0x0819e3a0 in ast_rtp_engine_register2 (engine=0x3d1880, module=0x972d548) 
at rtp_engine.c:143
#6  0x0039755f in load_module () at res_rtp_asterisk.c:4481
#7  0x0814afa0 in start_resource (mod=0x972d548) at loader.c:821
#8  0x0814ba71 in load_resource_list (load_order=0xbfc8da14, global_symbols=0, 
mod_count=0xbfc8da0c) at loader.c:1021
#9  0x0814c0cd in load_modules (preload_only=0) at loader.c:1174
#10 0x0808e40e in main (argc=4, argv=0xbfc8efa4) at asterisk.c:4109

Original issue reported on code.google.com by eugeny.b...@gmail.com on 23 Nov 2012 at 11:27

GoogleCodeExporter commented 8 years ago
Hi. I'm currently working on this issue. For now, I just add a 
noload=app_unimrcp.so to modules.conf and then load the module after Asterisk 
started. Not sure why this is happening yet...

Original comment by thirion...@gmail.com on 25 Nov 2012 at 10:06

GoogleCodeExporter commented 8 years ago

Original comment by thirion...@gmail.com on 25 Nov 2012 at 10:08

GoogleCodeExporter commented 8 years ago
Hi. I had the same problem.

Original comment by A.V.No...@gmail.com on 4 Dec 2012 at 1:41

GoogleCodeExporter commented 8 years ago
Below is a one-line change which fixes the problem. The problem was in the 
Sofia-SIP library which deleted a data storage key which was not created. That 
eventually made Asterisk crash because of memory corruption issues. The fix 
will be available in the upcoming release of the dependencies.

diff --git a/libsofia-sip-ua/su/su_uniqueid.c b/libsofia-sip-ua/su/su_uniqueid.c
index 59833cc..eaa8813 100644
--- a/libsofia-sip-ua/su/su_uniqueid.c
+++ b/libsofia-sip-ua/su/su_uniqueid.c
@@ -99,7 +99,7 @@ union state {
 #endif

 static pthread_once_t once = PTHREAD_ONCE_INIT;
-static int done_once = 1;
+static int done_once = 0;
 static pthread_key_t state_key;

Original comment by achalo...@gmail.com on 6 Mar 2013 at 7:33