[sr-dev] [kamailio/kamailio] secfilter crash when using kamcmd secfilter.reload (Issue #3263)

amoizard notifications at github.com
Thu Oct 13 15:13:20 CEST 2022


### Description

Hello!

I'm running a sip service and have several crash per day. 
The crash is happening in secfilter module, method "w_check_ip" line 651

https://github.com/kamailio/kamailio/blob/master/src/modules/secfilter/secfilter.c#L651

#### Reproduction

I noticed that every core is generated when I insert a new IP and most probably, when I call 

    kamcmd secfilter.reload

NOTE: I'm calling the above command line from the kamailio script

#### Debugging Data

```
(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 at 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

```

#### Log Messages

Oct 12 00:28:08 sip kamailio[19274]: ALERT: <core> [main.c:788]: handle_sigs(): child process 19474 exited by a signal 11
Oct 12 00:28:08 sip kamailio[19274]: ALERT: <core> [main.c:791]: handle_sigs(): core was generated
Oct 12 00:28:08 sip kamailio[19274]: INFO: <core> [main.c:813]: handle_sigs(): terminating due to SIGCHLD

#### SIP Traffic

not applicable

### Possible Solutions

I guess the secfilter reload is happening at the same time w_check_ip loops over the data. Some mutex should probably be missing.

### Additional Information

Debian GNU/Linux 11 (bullseye)
kamailio 5.5.5 (x86_64/linux) installed from http://deb.kamailio.org/

secfilter module hasn't changed much since 5.5.5, so I it looks like master branch is still affected.

Thanks a lot.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3263
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3263 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20221013/d5f6b548/attachment-0001.htm>


More information about the sr-dev mailing list