<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">Hello!</p>
<p dir="auto">I'm running a sip service and have several crash per day.<br>
The crash is happening in secfilter module, method "w_check_ip" line 651</p>
<p dir="auto"><a href="https://github.com/kamailio/kamailio/blob/master/src/modules/secfilter/secfilter.c#L651">https://github.com/kamailio/kamailio/blob/master/src/modules/secfilter/secfilter.c#L651</a></p>
<h4 dir="auto">Reproduction</h4>
<p dir="auto">I noticed that every core is generated when I insert a new IP and most probably, when I call</p>
<pre class="notranslate"><code class="notranslate">kamcmd secfilter.reload
</code></pre>
<p dir="auto">NOTE: I'm calling the above command line from the kamailio script</p>
<h4 dir="auto">Debugging Data</h4>
<pre class="notranslate"><code class="notranslate">(gdb) bt
#0 __strncasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:271
#1 0x0000564a161b6413 in cmpi_str (s1=0x7f0bdcbc1b28, s2=0x7ffd88e2c580) at core/strutils.c:443
#2 0x00007f0bd069c983 in w_check_ip (msg=0x7f0be1619620) at secfilter.c:651
#3 0x0000564a15f8cafc in do_action (h=0x7ffd88e2d640, a=0x7f0be142f118, msg=0x7f0be1619620) at core/action.c:1079
#4 0x0000564a15f9bb26 in run_actions (h=0x7ffd88e2d640, a=0x7f0be14296e8, msg=0x7f0be1619620) at core/action.c:1584
#5 0x0000564a15f889d9 in do_action (h=0x7ffd88e2d640, a=0x7f0be15996f0, msg=0x7f0be1619620) at core/action.c:703
#6 0x0000564a15f9bb26 in run_actions (h=0x7ffd88e2d640, a=0x7f0be1598c70, msg=0x7f0be1619620) at core/action.c:1584
#7 0x0000564a15f9c3a0 in run_top_route (a=0x7f0be1598c70, msg=0x7f0be1619620, c=0x0) at core/action.c:1669
#8 0x0000564a160f2e96 in receive_msg (
buf=0x564a16549ea0 <buf> "REGISTER sip:sip.antisip.com SIP/2.0\r\nVia: SIP/2.0/UDP 10.1.1.78:5060;branch=z9hG4bKVsAO82I6G4Oe4Okgc;rport\r\nFrom: \"504f9410db5c\" <sip:XXXXXXXXXXXX@sip.antisip.com>;tag=D2yOicg8WAMe4Sii\r\nTo: \"XXXXXXXX"..., len=429, rcv_info=0x7ffd88e2daf0) at core/receive.c:501
#9 0x0000564a16251d97 in udp_rcv_loop () at core/udp_server.c:543
#10 0x0000564a15f75ce9 in main_loop () at main.c:1730
#11 0x0000564a15f829a1 in main (argc=10, argv=0x7ffd88e2e508) at main.c:3061
</code></pre>
<h4 dir="auto">Log Messages</h4>
<p dir="auto">Oct 12 00:28:08 sip kamailio[19274]: ALERT: [main.c:788]: handle_sigs(): child process 19474 exited by a signal 11<br>
Oct 12 00:28:08 sip kamailio[19274]: ALERT: [main.c:791]: handle_sigs(): core was generated<br>
Oct 12 00:28:08 sip kamailio[19274]: INFO: [main.c:813]: handle_sigs(): terminating due to SIGCHLD</p>
<h4 dir="auto">SIP Traffic</h4>
<p dir="auto">not applicable</p>
<h3 dir="auto">Possible Solutions</h3>
<p dir="auto">I guess the secfilter reload is happening at the same time w_check_ip loops over the data. Some mutex should probably be missing.</p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Debian GNU/Linux 11 (bullseye)<br>
kamailio 5.5.5 (x86_64/linux) installed from <a href="http://deb.kamailio.org/" rel="nofollow">http://deb.kamailio.org/</a></p>
<p dir="auto">secfilter module hasn't changed much since 5.5.5, so I it looks like master branch is still affected.</p>
<p dir="auto">Thanks a lot.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3263">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZPEX2USD3O4ZUFAK2DWDADHBANCNFSM6AAAAAAREIRH34">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZPAVHOBXWZ2VRLFXJTWDADHBA5CNFSM6AAAAAAREIRH36WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFH2IL2Q.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3263</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3263",
"url": "https://github.com/kamailio/kamailio/issues/3263",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>