<p>now we are getting crashes when CANCEL from caller is received at the same time as 487 from callee by another process.</p>
<p>This core is from the process of the 487</p>
<pre><code>Core was generated by `/usr/sbin/kamailio -f /etc/kamailio/proxy/kamailio.cfg -P /var/run/kamailio/kam'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  atomic_get (v=<optimized out>) at ../../mem/../atomic/atomic_common.h:74
74      ../../mem/../atomic/atomic_common.h: No such file or directory.
(gdb) bt
#0  atomic_get (v=<optimized out>) at ../../mem/../atomic/atomic_common.h:74
#1  dlg_unref_helper (dlg=0x7f59490bcdf8, cnt=1, fname=0x5335 <error: Cannot access memory at address 0x5335>, fline=1637) at dlg_hash.c:925
#2  0x00007f59f8a0ce12 in dlg_run_event_route (dlg=0x7f59490bcdf8, msg=0x7f5a040d3138, ostate=983121128, nstate=4) at dlg_handlers.c:1637
#3  0x00007f59f8a0d157 in dlg_onreply (t=0x7f5948ee57a8, type=6, param=0x7ffea05ae620) at dlg_handlers.c:458
#4  0x00007f5a00ea2c16 in run_trans_callbacks_internal (cb_lst=0x7f5948e46938, type=1048576, trans=0x7f5948ee57a8, params=0x7ffea05ae620) at t_hooks.c:268
#5  0x00007f5a00ea2fa5 in run_trans_callbacks_with_buf (type=<optimized out>, rbuf=<optimized out>, req=<optimized out>, repl=<optimized out>, flags=<optimized out>)
    at t_hooks.c:314
#6  0x00007f5a00e5ef53 in relay_reply (t=0x7f5948ee57a8, p_msg=0x6, branch=983121128, msg_status=700, cancel_data=0x1, do_put_on_wait=100) at t_reply.c:1915
#7  0x00007f5a00e61d43 in reply_received (p_msg=0x7f5a040d3138) at t_reply.c:2466
#8  0x00000000004f7306 in do_forward_reply (msg=0x7f5a040d3138, mode=0) at forward.c:747
#9  0x0000000000556f03 in receive_msg (buf=0x0, len=67973432, rcv_info=0x7f5a03da93f8) at receive.c:299
#10 0x0000000000479f10 in udp_rcv_loop () at udp_server.c:495
#11 0x00000000004ffe39 in main_loop () at main.c:1614
#12 0x000000000041cd6c in main (argc=0, argv=0x0) at main.c:2631
(gdb) f 1
#1  dlg_unref_helper (dlg=0x7f59490bcdf8, cnt=1, fname=0x5335 <error: Cannot access memory at address 0x5335>, fline=1637) at dlg_hash.c:925
925     dlg_hash.c: No such file or directory.
(gdb) p d_entry
$1 = (dlg_entry_t *) 0x7f644ccda358
(gdb) p *d_entry
Cannot access memory at address 0x7f644ccda358
</code></pre>
<p>This is kamailio 4.4.4<br>
<a href="https://github.com/apogrebennyk" class="user-mention">@apogrebennyk</a></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, <a href="https://github.com/kamailio/kamailio/issues/872#issuecomment-276958892">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zd_ljWOl3EuQ5gio6X3IgQqf58K2ks5rYdwvgaJpZM4LASj1">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZYlZlTY7SYaYI1o3XtX1TRusma4oks5rYdwvgaJpZM4LASj1.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/872#issuecomment-276958892"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@linuxmaniac in #872: now we are getting crashes when CANCEL from caller is received at the same time as 487 from callee by another process.\r\n\r\nThis core is from the process of the 487\r\n```\r\nCore was generated by `/usr/sbin/kamailio -f /etc/kamailio/proxy/kamailio.cfg -P /var/run/kamailio/kam'.\r\nProgram terminated with signal SIGSEGV, Segmentation fault.\r\n#0  atomic_get (v=\u003coptimized out\u003e) at ../../mem/../atomic/atomic_common.h:74\r\n74      ../../mem/../atomic/atomic_common.h: No such file or directory.\r\n(gdb) bt\r\n#0  atomic_get (v=\u003coptimized out\u003e) at ../../mem/../atomic/atomic_common.h:74\r\n#1  dlg_unref_helper (dlg=0x7f59490bcdf8, cnt=1, fname=0x5335 \u003cerror: Cannot access memory at address 0x5335\u003e, fline=1637) at dlg_hash.c:925\r\n#2  0x00007f59f8a0ce12 in dlg_run_event_route (dlg=0x7f59490bcdf8, msg=0x7f5a040d3138, ostate=983121128, nstate=4) at dlg_handlers.c:1637\r\n#3  0x00007f59f8a0d157 in dlg_onreply (t=0x7f5948ee57a8, type=6, param=0x7ffea05ae620) at dlg_handlers.c:458\r\n#4  0x00007f5a00ea2c16 in run_trans_callbacks_internal (cb_lst=0x7f5948e46938, type=1048576, trans=0x7f5948ee57a8, params=0x7ffea05ae620) at t_hooks.c:268\r\n#5  0x00007f5a00ea2fa5 in run_trans_callbacks_with_buf (type=\u003coptimized out\u003e, rbuf=\u003coptimized out\u003e, req=\u003coptimized out\u003e, repl=\u003coptimized out\u003e, flags=\u003coptimized out\u003e)\r\n    at t_hooks.c:314\r\n#6  0x00007f5a00e5ef53 in relay_reply (t=0x7f5948ee57a8, p_msg=0x6, branch=983121128, msg_status=700, cancel_data=0x1, do_put_on_wait=100) at t_reply.c:1915\r\n#7  0x00007f5a00e61d43 in reply_received (p_msg=0x7f5a040d3138) at t_reply.c:2466\r\n#8  0x00000000004f7306 in do_forward_reply (msg=0x7f5a040d3138, mode=0) at forward.c:747\r\n#9  0x0000000000556f03 in receive_msg (buf=0x0, len=67973432, rcv_info=0x7f5a03da93f8) at receive.c:299\r\n#10 0x0000000000479f10 in udp_rcv_loop () at udp_server.c:495\r\n#11 0x00000000004ffe39 in main_loop () at main.c:1614\r\n#12 0x000000000041cd6c in main (argc=0, argv=0x0) at main.c:2631\r\n(gdb) f 1\r\n#1  dlg_unref_helper (dlg=0x7f59490bcdf8, cnt=1, fname=0x5335 \u003cerror: Cannot access memory at address 0x5335\u003e, fline=1637) at dlg_hash.c:925\r\n925     dlg_hash.c: No such file or directory.\r\n(gdb) p d_entry\r\n$1 = (dlg_entry_t *) 0x7f644ccda358\r\n(gdb) p *d_entry\r\nCannot access memory at address 0x7f644ccda358\r\n```\r\nThis is kamailio 4.4.4\r\n@apogrebennyk "}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/872#issuecomment-276958892"}}}</script>