<p>Kamailio 4.3 fails to start after building a previously working sourcetree/config from Debian 7 onto a new Debian 8 server.</p>

<p>Log file is:</p>

<pre><code>May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: INFO: tls [tls_domain.c:674]: set_verification(): TLSc<default>: Server MAY present invalid certificate
May 11 16:46:19 ua-proxy-00 kernel: [12060.056386] kamailio[360]: segfault at 207 ip 00007f07d23c8cbf sp 00007fff0b92bdd8 error 4
May 11 16:46:19 ua-proxy-00 kernel: [12060.056774] kamailio[358]: segfault at 207 ip 00007f07d23c8cbf sp 00007fff0b92bdd8 error 4 in libc-2.19.so[7f07d2337000+1a2000]
May 11 16:46:19 ua-proxy-00 kernel: [12060.058171]  in libc-2.19.so[7f07d2337000+1a2000]
May 11 16:46:19 ua-proxy-00 kernel: [12060.059921] kamailio[362]: segfault at 207 ip 00007f07d23c8cbf sp 00007fff0b92bdd8 error 4 in libc-2.19.so[7f07d2337000+1a2000]
May 11 16:46:19 ua-proxy-00 kernel: [12060.094333] kamailio[367]: segfault at 207 ip 00007f07d23c8cbf sp 00007fff0b92bdd8 error 4 in libc-2.19.so[7f07d2337000+1a2000]
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[623]: INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:728]: handle_sigs(): child process 358 exited by a signal 11
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:731]: handle_sigs(): core was not generated
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:728]: handle_sigs(): child process 360 exited by a signal 11
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:731]: handle_sigs(): core was not generated
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:728]: handle_sigs(): child process 362 exited by a signal 11
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:731]: handle_sigs(): core was not generated
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:728]: handle_sigs(): child process 367 exited by a signal 11
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: ALERT: <core> [main.c:731]: handle_sigs(): core was not generated
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[312]: INFO: <core> [main.c:743]: handle_sigs(): terminating due to SIGCHLD
May 11 16:46:19 ua-proxy-00 /opt/kamailio/sbin/kamailio[681]: INFO: <core> [main.c:798]: sig_usr(): signal 15 received
</code></pre>

<p>gdb output is:</p>

<pre><code>[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/kamailio/sbin/kamailio -f /opt/kamailio/etc/kamailio/kamailio.cfg -P /var/'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f6d5f577af6 in atomic_get (v=0x14) at ../../mem/../atomic/atomic_common.h:74
74              return atomic_get_int(&(v->val));
(gdb) bt full
#0  0x00007f6d5f577af6 in atomic_get (v=0x14) at ../../mem/../atomic/atomic_common.h:74
No locals.
#1  0x00007f6d5f578fd7 in ht_slot_lock (ht=0x7f6d61c9fad8, idx=0) at ht_api.c:150
        mypid = 17992
#2  0x00007f6d5f5719a0 in ht_db_save_table (ht=0x7f6d61c9fad8, dbtable=0x7f6d61c9faf0) at ht_db.c:443
        db_cols = {0x7f6d5f79f980 <ht_db_name_column>, 0x7f6d5f79f990 <ht_db_ktype_column>, 0x7f6d5f79f9a0 <ht_db_vtype_column>, 0x7f6d5f79f9b0 <ht_db_value_column>, 0x7f6d5f79f9c0 <ht_db_expires_column>}
        db_vals = {{type = 16777216, nul = 50, free = 351883413, val = {int_val = 4284224, ll_val = 4284224, double_val = 2.1166878974885686e-317, time_val = 4284224,
              string_val = 0x415f40 <_start> "1\355I\211\321^H\211\342H\203\344\360PTI\307\300 /n", str_val = {s = 0x415f40 <_start> "1\355I\211\321^H\211\342H\203\344\360PTI\307\300 /n", len = -1839950320}, blob_val = {
                s = 0x415f40 <_start> "1\355I\211\321^H\211\342H\203\344\360PTI\307\300 /n", len = -1839950320}, bitmap_val = 4284224}}, {type = 2455015904, nul = 32766, free = 1786366069, val = {int_val = 1803868645,
              ll_val = 140107932031461, double_val = 6.9222515926605253e-310, time_val = 140107932031461,
              string_val = 0x7f6d6b84d9e5 <db_mysql_val2str> "UH\211\345SH\203\354XH\211}\270H\211u\260H\211U\250H\211M\240H\213M\240H\213U\250H\213u\260H\213E\270H\211\307\350\372w\376\377\211E\354\203", <incomplete sequence \354>,
              str_val = {s = 0x7f6d6b84d9e5 <db_mysql_val2str> "UH\211\345SH\203\354XH\211}\270H\211u\260H\211U\250H\211M\240H\213M\240H\213U\250H\213u\260H\213E\270H\211\307\350\372w\376\377\211E\354\203", <incomplete sequence \354>,
                len = 17}, blob_val = {
                s = 0x7f6d6b84d9e5 <db_mysql_val2str> "UH\211\345SH\203\354XH\211}\270H\211u\260H\211U\250H\211M\240H\213M\240H\213U\250H\213u\260H\213E\270H\211\307\350\372w\376\377\211E\354\203", <incomplete sequence \354>,
                len = 17}, bitmap_val = 1803868645}}, {type = DB1_INT, nul = 0, free = 0, val = {int_val = 0, ll_val = 0, double_val = 0, time_val = 0, string_val = 0x0, str_val = {s = 0x0, len = 1806418832}, blob_val = {s = 0x0,
                len = 1806418832}, bitmap_val = 0}}, {type = 2455016976, nul = 32766, free = 1806462152, val = {int_val = -1839951280, ll_val = 140731353436752, double_val = 6.9530527025841608e-310, time_val = 140731353436752,
              string_val = 0x7ffe92549250 "p\222T\222\376\177", str_val = {s = 0x7ffe92549250 "p\222T\222\376\177", len = 32}, blob_val = {s = 0x7ffe92549250 "p\222T\222\376\177", len = 32}, bitmap_val = 2455016016}}, {
            type = 1803893696, nul = 32621, free = 351883413, val = {int_val = -1839951312, ll_val = 140731353436720, double_val = 6.9530527025825798e-310, time_val = 140731353436720,
              string_val = 0x7ffe92549230 "\200\222T\222\376\177", str_val = {s = 0x7ffe92549230 "\200\222T\222\376\177", len = 1803893774}, blob_val = {s = 0x7ffe92549230 "\200\222T\222\376\177", len = 1803893774},
              bitmap_val = 2455015984}}}
        it = 0x7f6d61c9faf0
        tmp = {s = 0x3214f95095 <error: Cannot access memory at address 0x3214f95095>, len = 0}
        i = 0
        now = 1462979679
        ncols = 4284224
        __FUNCTION__ = "ht_db_save_table"
#3  0x00007f6d5f58155a in ht_db_sync_tables () at ht_api.c:941
        ht = 0x7f6d61c9fad8
        __FUNCTION__ = "ht_db_sync_tables"
#4  0x00007f6d5f5876c9 in destroy () at htable.c:266
No locals.
#5  0x000000000054a1a7 in destroy_modules () at sr_module.c:805
        t = 0x7f6d6bad04b8
        foo = 0x7f6d6bacf7c0
        __FUNCTION__ = "destroy_modules"
#6  0x0000000000530ef1 in cleanup (show_status=0) at main.c:513
        memlog = 32766
        __FUNCTION__ = "cleanup"
#7  0x00000000005324d6 in shutdown_children (sig=15, show_status=0) at main.c:655
        __FUNCTION__ = "shutdown_children"
#8  0x0000000000542326 in main (argc=13, argv=0x7ffe92549618) at main.c:2568
        cfg_stream = 0x1f5d010
        c = -1
        r = 1824835416
        tmp = 0x7ffe92549e5e ""
        tmp_len = 32621
        port = 1824785872
        proto = 0
        options = 0x727dc0 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
        ret = -1
        seed = 2855621674
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0xf63d4e2e
        p = 0x7f6d6cc40000 ""
        st = {st_dev = 15, st_ino = 77938, st_nlink = 2, st_mode = 16877, st_uid = 1008, st_gid = 1009, __pad0 = 0, st_rdev = 0, st_size = 80, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1462977193, tv_nsec = 888000000},
          st_mtim = {tv_sec = 1462979531, tv_nsec = 400000000}, st_ctim = {tv_sec = 1462979531, tv_nsec = 400000000}, __glibc_reserved = {0, 0, 0}}
        __FUNCTION__ = "main"
(gdb)
</code></pre>

<p>Feels like a race condition of some sort as enabling full debug logs (<code>debug=3</code>) actually fixes the problem...</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/614">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZUPoGi2VPJEQj5fGhJl0a9Tz49sqks5qAf4BgaJpZM4IcPCA.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/614"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>