[sr-dev] [kamailio/kamailio] Crash on startup when using db_mongodb with ssl/tls on Ubuntu 20.04 and Debian Buster (#2560)

Dylan notifications at github.com
Fri Dec 11 16:47:16 CET 2020


We reconfigured to remove our MongoDB dependency. But enabling TLS still causes a crash ...on Ubuntu 20 at least.

DEBUG output before crash:
```
 0(173591) DEBUG: <core> [core/sr_module.c:632]: find_mod_export_record(): found export of <xhttp_reply> in module xhttp [/usr/local/lib64/kamailio/modules/xhttp.so]
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type2, i/count 0/2: type 3(3)/ data 0x1
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type2, i/count 1/2: type 3(3)/ data 0x1
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type16, i/count 0/3: type 22(16)/ data 0x7f7155646b60
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type16, i/count 1/3: type 8(8)/ data 0x7f71556473b0
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type16, i/count 2/3: type 0(0)/ data (nil)
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type24, i/count 0/2: type 9(9)/ data (nil)
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type24, i/count 1/2: type 3(3)/ data (nil)
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/re.c:436]: subst_run(): running. r=1
 0(173591) DEBUG: <core> [core/re.c:504]: subst_str(): no match
 0(173591) DEBUG: <core> [core/sr_module.c:632]: find_mod_export_record(): found export of <xhttp_reply> in module xhttp [/usr/local/lib64/kamailio/modules/xhttp.so]
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type2, i/count 0/2: type 3(3)/ data 0x1
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type2, i/count 1/2: type 3(3)/ data 0x1
 0(173591) DEBUG: <core> [core/route.c:129]: route_add(): mapping routing block (0x55d00859be60)[xhttp:request] to 3
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type5, i/count 0/1: type 1(1)/ data 0x7f7155648c00
 0(173591) DEBUG: <core> [core/route_struct.c:128]: mk_action(): ACTION type5, i/count 0/1: type 1(1)/ data 0x7f7155648e38
 0(173591) DEBUG: <core> [core/route.c:129]: route_add(): mapping routing block (0x55d00859be60)[htable:mod-init] to 4
 0(173591) DEBUG: <core> [core/ppcfg.c:224]: pp_ifdef_level_check(): same number of pairing preprocessor directives #!IF[N]DEF - #!ENDIF
 0(173591) DEBUG: <core> [core/route.c:129]: route_add(): mapping routing block (0x55d00859be60)[core:receive-parse-error] to 5
 0(173591) INFO: <core> [core/sctp_core.c:74]: sctp_core_check_support(): SCTP API not enabled - if you want to use it, load sctp module
 0(173591) ERROR: <core> [main.c:2625]: main(): failed to create runtime dir /var/run/kamailio/, check directory permissions
failed to create runtime dir /var/run/kamailio/, check directory permissions
 0(173591) DEBUG: tm [t_funcs.c:84]: tm_shutdown(): start
 0(173591) DEBUG: tm [t_funcs.c:87]: tm_shutdown(): emptying hash table
 0(173591) DEBUG: tm [t_funcs.c:89]: tm_shutdown(): removing semaphores
 0(173591) DEBUG: tm [t_funcs.c:91]: tm_shutdown(): destroying tmcb lists
 0(173591) DEBUG: tm [t_funcs.c:94]: tm_shutdown(): done
 0(173591) DEBUG: tls [tls_init.c:859]: tls_h_mod_destroy_f(): tls module final tls destroy
 0(173591) DEBUG: tls [tls_init.c:869]: tls_h_mod_destroy_f(): executing openssl v1.1+ cleanup
 0(173591) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
 0(173591) DEBUG: <core> [core/mem/shm.c:288]: shm_destroy_manager(): destroying memory manager: q_malloc
 0(173591) DEBUG: <core> [core/mem/q_malloc.c:1185]: qm_shm_lock_destroy(): destroying the shared memory lock
 0(173591) DEBUG: <core> [core/mem/pkg.c:97]: pkg_destroy_manager(): destroying memory manager: q_malloc
Segmentation fault
```

backtrace:
```
11(173938) DEBUG: <core> [core/sr_module.c:778]: init_mod_child(): idx 11 rank 4: siptrace [tcp receiver (generic) child=1]
11(173938) DEBUG: <core> [core/local_timer.c:60]: init_local_timer(): timer_list between 0x555555b163c8 and 0x555555b5a3c8
11(173938) DEBUG: <core> [core/io_wait.h:374]: io_watch_add(): DBG: io_watch_add(0x555555b16200, 25, 1, (nil)), fd_no=0
__GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        set = {__val = {0, 93824997137864, 93824997137864, 1, 140737352204704, 0, 140737352016304, 140737488346976, 140737488346592, 140737350737331, 140737488347504, 93824996790201, 205470458, 1597694572, 0, 
            10346731307112276224}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
#1  0x00007ffff7c60859 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x7ffff7e275c0 <_IO_2_1_stderr_>, sa_sigaction = 0x7ffff7e275c0 <_IO_2_1_stderr_>}, sa_mask = {__val = {10346731307112276224, 140737270609440, 140737270374400, 140737352201664, 
              93824996942784, 140737488346864, 93824995565158, 93824997234282, 93824997234624, 93824997234048, 93824997234456, 140737270977464, 10346731307112276224, 0, 93824997234282, 0}}, sa_flags = 0, 
          sa_restorer = 0x7ffff73fdb14}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x000055555588202c in qm_debug_check_frag (qm=0x7ffff301e000, f=0x7ffff30b13b8, file=0x7ffff73fdb14 "tls: tls_init.c", line=323, efile=0x555555a19599 "core/mem/q_malloc.c", eline=511) at core/mem/q_malloc.c:140
        p = 0x7ffff7ccead1 <_IO_new_do_write+177>
        __func__ = "qm_debug_check_frag"
#3  0x00005555558862ba in qm_free (qmp=0x7ffff301e000, p=0x7ffff30b13f0, file=0x7ffff73fdb14 "tls: tls_init.c", func=0x7ffff73ff0a0 <__func__.23420> "ser_free", line=323, mname=0x7ffff73fdb10 "tls") at core/mem/q_malloc.c:511
        qm = 0x7ffff301e000
        f = 0x7ffff30b13b8
        size = 281479271743489
        next = 0x1000100010001
        prev = 0x1000100010001
        __func__ = "qm_free"
#4  0x0000555555891d89 in qm_shm_free (qmp=0x7ffff301e000, p=0x7ffff30b13f0, file=0x7ffff73fdb14 "tls: tls_init.c", func=0x7ffff73ff0a0 <__func__.23420> "ser_free", line=323, mname=0x7ffff73fdb10 "tls")
    at core/mem/q_malloc.c:1275
No locals.
#5  0x00007ffff73a9078 in ser_free (ptr=0x7ffff30b13f0, fname=0x7ffff723b960 "../crypto/bn/bn_lib.c", fline=194) at tls_init.c:323
        __func__ = "ser_free"
#6  0x00007ffff70d8b4d in BN_clear_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
No symbol table info available.
#7  0x00007ffff27fdf35 in ?? () from /lib/x86_64-linux-gnu/libssh.so.4
No symbol table info available.
#8  0x00007ffff27ef4fd in ?? () from /lib/x86_64-linux-gnu/libssh.so.4
No symbol table info available.
#9  0x00007ffff7fe0f5b in ?? () from /lib64/ld-linux-x86-64.so.2
No symbol table info available.
#10 0x00007ffff7c84a27 in __run_exit_handlers (status=0, listp=0x7ffff7e26718 <__exit_funcs>, run_list_atexit=run_list_atexit at entry=true, run_dtors=run_dtors at entry=true) at exit.c:108
        atfct = <optimized out>
        onfct = <optimized out>
        cxafct = <optimized out>
        f = <optimized out>
        new_exitfn_called = 9
        cur = 0x7ffff7e28980 <initial>
--Type <RET> for more, q to quit, c to continue without paging-- 
#11 0x00007ffff7c84be0 in __GI_exit (status=<optimized out>) at exit.c:139
No locals.
#12 0x00005555557e948e in daemonize (name=0x7fffffffe8a3 "/usr/local/sbin/kamailio", status_wait=1) at core/daemonize.c:301
        pid_stream = 0x0
        pid = 173923
        r = 1436369193
        p = -1
        pipe_status = 0 '\000'
        pid_uid = 4294967295
        pid_gid = 4294967295
        __func__ = "daemonize"
#13 0x000055555559652e in main (argc=1, argv=0x7fffffffe6a8) at main.c:2763
        cfg_stream = 0x555555b672a0
        c = -1
        r = -134414416
        tmp = 0x0
        tmp_len = 0
        port = -134422088
        proto = 32767
        ahost = 0x0
        aport = 0
        options = 0x5555559b3d48 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
        ret = -1
        seed = 2333055721
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0x0
        p = 0x0
        st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, 
            tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 0}, __glibc_reserved = {0, 0, 0}}
        tbuf = "p\345\377\377\377\177\000\000\253\067\375\367\377\177", '\000' <repeats 18 times>, "Լ\252\252\252\252\377\377\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\347\377\367\377\177\000\000\200\241\303\367\377\177\000\000\002", '\000' <repeats 319 times>...
        option_index = 0
        long_options = {{name = 0x5555559b5f76 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x5555559b1514 "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x5555559b5f7b "alias", has_arg = 1, flag = 0x0, 
            val = 1024}, {name = 0x5555559b5f81 "subst", has_arg = 1, flag = 0x0, val = 1025}, {name = 0x5555559b5f87 "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x5555559b5f90 "substdefs", has_arg = 1, flag = 0x0, 
            val = 1027}, {name = 0x5555559b5f9a "server-id", has_arg = 1, flag = 0x0, val = 1028}, {name = 0x5555559b5fa4 "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {name = 0x5555559b5faf "modparam", has_arg = 1, 
            flag = 0x0, val = 1030}, {name = 0x5555559b5fb8 "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {name = 0x5555559b5fc3 "debug", has_arg = 1, flag = 0x0, val = 1032}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        __func__ = "main"
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2560#issuecomment-743270579
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20201211/65d0c36c/attachment-0001.htm>


More information about the sr-dev mailing list