<p></p>
<h3>Description</h3>
<p>I just update kamailio 5.2.1 to 5.4.1. then there are some crashs from keepalive module.</p>
<h3>Troubleshooting</h3>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/16113837/93066033-08c29880-f6ac-11ea-8660-12348f8881ab.png"><img src="https://user-images.githubusercontent.com/16113837/93066033-08c29880-f6ac-11ea-8660-12348f8881ab.png" alt="image" style="max-width:100%;"></a></p>
<h4>Reproduction</h4>
<h4>Debugging Data</h4>
<pre><code>Thread 1 (Thread 0x2b4d0df90d00 (LWP 30239)):
#0  0x00000000004ef1a7 in atomic_cmpxchg_int (var=0x0, old=0, new_v=1) at core/mem/../atomic/atomic_x86.h:224
#1  0x00000000004ef21a in futex_get (lock=0x0) at core/mem/../futexlock.h:99
#2  0x00000000004f339a in timer_add_safe (tl=0x2b4d13af7928, delta=8) at core/timer.c:543
#3  0x00002b4d133b32c3 in ka_add_dest (uri=0x7ffe571d1440, owner=0x7ffe571d1430, flags=0, ping_interval=3, statechanged_clb=0x0, response_clb=0x0, user_attr=0x0) at keepalive_api.c:120
#4  0x00002b4d133b95ff in ka_mod_add_destination (type=2147483649, val=0x2b4d0ed29300) at keepalive_mod.c:244
#5  0x00000000006615b8 in set_mod_param_regex (regex=0x2b4d0ed29130 "keepalive", name=0x2b4d0ed29218 "destination", type=1, val=0x2b4d0ed29300) at core/modparam.c:125
#6  0x00000000007becec in yyparse () at core/cfg.y:1842
#7  0x000000000042f216 in main (argc=5, argv=0x7ffe571d2578) at main.c:2320
#3  0x00002b4d133b32c3 in ka_add_dest (uri=0x7ffe571d1440, owner=0x7ffe571d1430, flags=0, ping_interval=3, statechanged_clb=0x0, response_clb=0x0, user_attr=0x0) at keepalive_api.c:120
120             if(timer_add(dest->timer, MS_TO_TICKS(KA_FIRST_TRY_DELAY)) < 0){
$2 = {next = 0x0, prev = 0x0, expire = 0, initial_timeout = 0, data = 0x2b4d13af7738, f = 0x2b4d133b4fbf <ka_check_timer>, flags = 0, slow_idx = 0}
_uri = {user = {s = 0x0, len = 0}, passwd = {s = 0x0, len = 0}, host = {s = 0x2b4d13af783c "172.18.67.47", len = 12}, port = {s = 0x0, len = 0}, params = {s = 0x0, len = 0}, sip_params = {s = 0x0, len = 0},
  headers = {s = 0x0, len = 0}, port_no = 0, proto = 0, type = SIP_URI_T, flags = (unknown: 0), transport = {s = 0x0, len = 0}, ttl = {s = 0x0, len = 0}, user_param = {s = 0x0, len = 0}, maddr = {s = 0x0,
    len = 0}, method = {s = 0x0, len = 0}, lr = {s = 0x0, len = 0}, r2 = {s = 0x0, len = 0}, gr = {s = 0x0, len = 0}, transport_val = {s = 0x0, len = 0}, ttl_val = {s = 0x0, len = 0}, user_param_val = {
    s = 0x0, len = 0}, maddr_val = {s = 0x0, len = 0}, method_val = {s = 0x0, len = 0}, lr_val = {s = 0x0, len = 0}, r2_val = {s = 0x0, len = 0}, gr_val = {s = 0x0, len = 0}}
dest = 0x2b4d13af7738
hollow = 0x0
__FUNCTION__ = "ka_add_dest"
#2  0x00000000004f339a in timer_add_safe (tl=0x2b4d13af7928, delta=8) at core/timer.c:543
543             LOCK_TIMER_LIST();
ret = 0
__FUNCTION__ = "timer_add_safe"

</code></pre>
<h4>Log Messages</h4>
<pre><code>Sep 14 15:49:34 localhost kamailio: INFO: pv [pv_shv.c:60]: shvar_init_locks(): locks array size 16
Sep 14 15:49:34 localhost kernel: kamailio[30186]: segfault at 0 ip 00000000004ef1a7 sp 00007ffdd2db9170 error 6 in kamailio[400000+4ae000]
</code></pre>
<h4>SIP Traffic</h4>
<pre><code>(paste your sip traffic here)
</code></pre>
<h3>Possible Solutions</h3>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>(paste your output here)
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015
</code></pre>

<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, <a href="https://github.com/kamailio/kamailio/issues/2476">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOVR6VRIOCWOQXDSYDSFXOQ5ANCNFSM4RLLVEIQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMVNXAU3ACOSB3FJITSFXOQ5A5CNFSM4RLLVEI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KOHLQYQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2476",
"url": "https://github.com/kamailio/kamailio/issues/2476",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>