<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3263 (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
New params:
- reload_delta: To set the number of seconds that have to be waited before executing a new RPC reload
- cleanup_interval: To set the number of seconds that have to be wait before cleanup the previous values from memory after a RPC reload
The purpose is to avoid problems when accessing data lists while doing an RPC reload.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3271
-- Commit Summary --
* secfilter: cleanup old data after a reload by timer function
-- File Changes --
M src/modules/secfilter/secfilter.c (148)
M src/modules/secfilter/secfilter.h (9)
M src/modules/secfilter/secfilter_db.c (22)
M src/modules/secfilter/secfilter_rpc.c (58)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3271.patchhttps://github.com/kamailio/kamailio/pull/3271.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3271
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3271(a)github.com>
Module: kamailio
Branch: master
Commit: e7b3724d3fc514c8a541a6a7f7fb1a782f21f2e7
URL: https://github.com/kamailio/kamailio/commit/e7b3724d3fc514c8a541a6a7f7fb1a7…
Author: Jose Luis Verdeguer <pepeluxx(a)gmail.com>
Committer: Jose Luis Verdeguer <pepeluxx(a)gmail.com>
Date: 2022-10-22T16:43:26+02:00
secfilter: Added information about two new params in the README file [skip ci]
---
Modified: src/modules/secfilter/doc/secfilter_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/e7b3724d3fc514c8a541a6a7f7fb1a7…
Patch: https://github.com/kamailio/kamailio/commit/e7b3724d3fc514c8a541a6a7f7fb1a7…
---
diff --git a/src/modules/secfilter/doc/secfilter_admin.xml b/src/modules/secfilter/doc/secfilter_admin.xml
index fff4ca3b2c8..48c54868de6 100644
--- a/src/modules/secfilter/doc/secfilter_admin.xml
+++ b/src/modules/secfilter/doc/secfilter_admin.xml
@@ -212,6 +212,47 @@
</programlisting>
</example>
</section>
+
+ <section id="secfilter.p.reload_delta">
+ <title><varname>reload_delta</varname> (integer)</title>
+
+ <para>
+ The number of seconds that have to be waited before executing a new RPC reload.
+ By default there is a rate limiting of maximum one reload in five seconds.
+
+ If set to <emphasis>0</emphasis>, no rate limit is configured.
+ </para>
+ <para><emphasis> Default value is 5</emphasis></para>
+
+ <example>
+ <title>Set <varname>reload_delta</varname> parameter</title>
+
+ <programlisting format="linespecific">
+ ...
+ modparam("secfilter", "reload_delta", 1)
+ ...
+ </programlisting>
+ </example>
+ </section>
+
+ <section id="secfilter.p.cleanup_interval">
+ <title><varname>cleanup_interval</varname> (integer)</title>
+
+ <para>
+ The number of seconds that have to be wait before cleanup the previous values from memory after a RPC reload.
+ </para>
+ <para><emphasis> Default value is 60</emphasis></para>
+
+ <example>
+ <title>Set <varname>cleanup_interval</varname> parameter</title>
+
+ <programlisting format="linespecific">
+ ...
+ modparam("secfilter", "cleanup_interval", 120)
+ ...
+ </programlisting>
+ </example>
+ </section>
</section>
<section>
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #3263 (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
New params:
- eload_delta: To set the number of seconds that have to be waited before executing a new RPC reload
- cleanup_interval: To set the number of seconds that have to be wait before cleanup the previous values from memory after a RPC reload
The purpose is to avoid problems when accessing data lists while doing an RPC reload.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3270
-- Commit Summary --
* secfilter: added locks while check list values
* secfilter: lock position changed
* secfilter: cleanup old data after a reload by timer function
* Merge branch 'master' into pepelux/secfilter
* secfilter: cleanup old data after a reload by timer function
* secfilter: Added information about two new params in the README file [skip ci]
* cleanup old data after a reload by timer function
-- File Changes --
M src/modules/secfilter/doc/secfilter_admin.xml (41)
M src/modules/secfilter/secfilter.c (148)
M src/modules/secfilter/secfilter.h (9)
M src/modules/secfilter/secfilter_db.c (22)
M src/modules/secfilter/secfilter_rpc.c (58)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3270.patchhttps://github.com/kamailio/kamailio/pull/3270.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3270
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3270(a)github.com>
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
New params:
- reload_delta: To set the number of seconds that have to be waited before executing a new RPC reload
- cleanup_interval: To set the number of seconds that have to be wait before cleanup the previous values from memory after a RPC reload
The purpose is to avoid problems when accessing data lists while doing an RPC reload.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3269
-- Commit Summary --
* secfilter: added locks while check list values
* secfilter: lock position changed
* secfilter: cleanup old data after a reload by timer function
-- File Changes --
M src/modules/secfilter/secfilter.c (122)
M src/modules/secfilter/secfilter.h (9)
M src/modules/secfilter/secfilter_db.c (22)
M src/modules/secfilter/secfilter_rpc.c (57)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3269.patchhttps://github.com/kamailio/kamailio/pull/3269.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3269
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3269(a)github.com>
### 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/secf…
#### 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@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(a)github.com>