Hello Team,
We are using Kamailio 5.4.7 and we found there is a random crash. We have
observed the core logs and we noticed it is due to some of the RPC events.
We have noticed it has been crashed from the "ctl handler" process.
Please find the attached crash logs and Kamailio version details are
mentioned below.
version: kamailio 5.4.7 (x86_64/linux) a19fe1
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a19fe1
compiled on 02:56:57 Feb 16 2022 with gcc 8.3.0
--
Hardik Patel
Hello Team,
We are using Kamailio 5.4.7 and we found there is a random crash. We have
observed the core logs and we noticed it is due to some of the RPC events.
We have noticed it has been crashed from the "ctl handler" process.
Please find the attached crash logs and Kamailio version details are
mentioned below.
version: kamailio 5.4.7 (x86_64/linux) a19fe1
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a19fe1
compiled on 02:56:57 Feb 16 2022 with gcc 8.3.0
--
Hardik Patel
<!-- 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
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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)
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
This is a small performance improvement, the goal is to avoid issuing rollbacks if not necessary.
On my setup, Kamailio presence executes a lot of ROLLBACKS in MariaDB since function process_dialogs() runs repeatedly.
What see inside MariaDB logs is the following
```
SET autocommit=0
select `presentity_uri`,`callid`,`to_tag`,`from_tag`,`event` from `active_watchers` where `updated`=3 AND `event`<>'presence.winfo'\G
ROLLBACK
```
Maybe we can improve this behaviour telling presence to do autocommit to do not execute them if the select returns zero elements?
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3183
-- Commit Summary --
* presence: No autocommit+rollback if no active watchers
-- File Changes --
M src/modules/presence/notify.c (20)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3183.patchhttps://github.com/kamailio/kamailio/pull/3183.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3183
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3183(a)github.com>
Module: kamailio
Branch: master
Commit: c80cccd996dcc3b91d4f0f68a2de51104a16d1a5
URL: https://github.com/kamailio/kamailio/commit/c80cccd996dcc3b91d4f0f68a2de511…
Author: Alessio Garzi <agarzi(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-07-12T15:39:33+02:00
presence: No autocommit+rollback if no active watchers
- In case the active_watcher query returns no elements there
is a weird situation where kamailio first runs the select for
active_watcher then rollbacks.
This can happen a lot of times for each second since function
process_dialogs() runs repeatedly.
For this reason trying to avoid the rollback can result
in a quite good performance boost.
---
Modified: src/modules/presence/notify.c
---
Diff: https://github.com/kamailio/kamailio/commit/c80cccd996dcc3b91d4f0f68a2de511…
Patch: https://github.com/kamailio/kamailio/commit/c80cccd996dcc3b91d4f0f68a2de511…
---
diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c
index cf52c21c22..4980dc4b0a 100644
--- a/src/modules/presence/notify.c
+++ b/src/modules/presence/notify.c
@@ -2867,6 +2867,7 @@ int process_dialogs(int round, int presence_winfo)
str ev_sname, winfo = str_init("presence.winfo");
int now = (int)time(NULL);
int updated = 0;
+ int no_active_watchers = 0;
db_query_f query_fn = pa_dbf.query_lock ? pa_dbf.query_lock : pa_dbf.query;
query_cols[n_query_cols] = &str_updated_col;
@@ -2900,13 +2901,6 @@ int process_dialogs(int round, int presence_winfo)
goto error;
}
- if(pa_dbf.start_transaction) {
- if(pa_dbf.start_transaction(pa_db, pres_db_table_lock) < 0) {
- LM_ERR("in start_transaction\n");
- goto error;
- }
- }
-
/* Step 1: Find active_watchers that require notification */
if(query_fn(pa_db, query_cols, query_ops, query_vals, result_cols,
n_query_cols, n_result_cols, 0, &dialog_list)
@@ -2920,7 +2914,17 @@ int process_dialogs(int round, int presence_winfo)
}
if(dialog_list->n <= 0)
+ {
+ no_active_watchers = 1;
goto done;
+ }
+
+ if(pa_dbf.start_transaction) {
+ if(pa_dbf.start_transaction(pa_db, pres_db_table_lock) < 0) {
+ LM_ERR("in start_transaction\n");
+ goto error;
+ }
+ }
/* Step 2: Update the records so they are not notified again */
if(pa_dbf.update(pa_db, query_cols, query_ops, query_vals, update_cols,
@@ -3164,7 +3168,7 @@ int process_dialogs(int round, int presence_winfo)
if(dialog)
pa_dbf.free_result(pa_db, dialog);
- if(pa_dbf.abort_transaction) {
+ if(no_active_watchers == 0 && pa_dbf.abort_transaction) {
if(pa_dbf.abort_transaction(pa_db) < 0)
LM_ERR("in abort_transaction\n");
}
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
rpc uac.reg_add
Use a dot (.) if no value should be set for auth_password, auth_ha1, contact_addr, realm,or socket
### Expected behavior
https://github.com/kamailio/kamailio/blob/master/src/modules/uac/uac_reg.c#…
```
if(reg.realm.len==1 && reg.realm.s[0] == '.') {
reg.realm.s = NULL;
reg.realm.len = 0;
}
if(reg.socket.len==1 && reg.socket.s[0] == '.') {
reg.socket.s = NULL;
reg.socket.len = 0;
}
```
#### Actual observed behavior
#### Debugging Data
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
Master
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
Debian11
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3179
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3179(a)github.com>
#### 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
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
This adds `core/` support for SHA-512/256.
This is required for adding the SHA-512/256 digest algorithm to the `auth` module.
References:
*[RFC8760](https://datatracker.ietf.org/doc/html/rfc8760)
*[RFC7616](https://datatracker.ietf.org/doc/html/rfc7616)
*[SHA-512/256 initial hash values](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3177
-- Commit Summary --
* core: crypto add support for SHA-512/256 for RFCs 8760/7616
-- File Changes --
M src/core/crypto/sha256.c (23)
M src/core/crypto/sha256.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3177.patchhttps://github.com/kamailio/kamailio/pull/3177.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3177
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3177(a)github.com>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
<!--
Hello.
Sip client Grandstream NT-XXX sends default registration request with "reg-id" and "instance"
> REGISTER sip:kamailio3.telecom.ru SIP/2.0
> Via: SIP/2.0/UDP 172.17.0.252:5060;branch=z9hG4bK1645839794;rport
> From: "7777" <sip:7777@kamailio3.telecom.ru>;tag=53756161
> To: <sip:7777@kamailio3.telecom.ru>
> Call-ID: 308071885-5060-1
> CSeq: 2031 REGISTER
> Contact: <sip:7777@172.17.0.252:5060>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>"
> Authorization: Digest username="7777", realm="kamailio3.telecom.ru", nonce="Ysv842LL+7dABGNcyuYZhl1L2QTPgzFq", uri="sip:kamailio3.telecom.ru", response="0ef43a754a7422dd9d8ed36f91aa546
> , algorithm=MD5
> Max-Forwards: 70
> User-Agent: Grandstream HT-502 V2.0A 1.0.9.1 chip V2.2
> Supported: path
> Expires: 1800
> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
> Content-Length: 0
>
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.17.0.252:5060;branch=z9hG4bK1645839794;rport=5060;received=172.17.0.252
> From: "7777" <sip:7777@kamailio3.telecom.ru>;tag=53756161
> To: <sip:7777@kamailio3.telecom.ru>;tag=5bf75eb19869d3e257cd1fde2cbf92c4.7224507f
> Call-ID: 308071885-5060-1
> CSeq: 2031 REGISTER
> Contact: <sip:7777@172.17.0.252:5060>;expires=1800;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>";reg-id=1, <sip:07777@172.17.0.250:5060>;expires=101, <sip:7777@172.1
> 0.250:5061>;expires=101, <sip:7777@172.17.0.252:5062>;expires=607;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>";reg-id=2
> Server: kamailio (5.4.8 (x86_64/linux))
> Content-Length: 0
>
> REGISTER sip:kamailio3.telecom.ru SIP/2.0
> Via: SIP/2.0/UDP 172.17.0.252:5062;branch=z9hG4bK212965390;rport
> From: "7777" <sip:7777@kamailio3.telecom.ru>;tag=1540711120
> To: <sip:7777@kamailio3.telecom.ru>
> Call-ID: 1127299103-5062-1
> CSeq: 2031 REGISTER
> Contact: <sip:7777@172.17.0.252:5062>;reg-id=2;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>"
> Authorization: Digest username="7777", realm="kamailio3.telecom.ru", nonce="Ysv862LL+78cGZE/vXJnQfemhCMiBilm", uri="sip:kamailio3.telecom.ru", response="6c3333159d41ae0fcaabfbbd8c5026e
> , algorithm=MD5
> Max-Forwards: 70
> User-Agent: Grandstream HT-502 V2.0A 1.0.9.1 chip V2.2
> Supported: path
> Expires: 1800
> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
> Content-Length: 0
>
>
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.17.0.252:5062;branch=z9hG4bK212965390;rport=5062;received=172.17.0.252
> From: "7777" <sip:7777@kamailio3.telecom.ru>;tag=1540711120
> To: <sip:7777@kamailio3.telecom.ru>;tag=5bf75eb19869d3e257cd1fde2cbf92c4.451b5a53
> Call-ID: 1127299103-5062-1
> CSeq: 2031 REGISTER
> Contact: <sip:7777@172.17.0.252:5060>;expires=1792;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>";reg-id=1, <sip:7777@172.17.0.250:5060>;expires=93, <sip:7777@172.17
> .250:5061>;expires=93, <sip:7777@172.17.0.252:5062>;expires=1800;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B82566BBB>";reg-id=2
> Server: kamailio (5.4.8 (x86_64/linux))
> Content-Length: 0
Later, when I use branching (with q=-1.0), the kamailio sends an invite to only one AOR from 7777@172.17.0.252:5062
If I use another Sip client without "instance" , such as Linksys-PAP2T, branching works fine.
GRUU is always disabled
modparam("registrar", "gruu_enabled", 0)
-->
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
How can I disable GRUU support completely?
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
kamailio -v
version: kamailio 5.4.8 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3181
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3181(a)github.com>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
when using exclude_hf_value function to exclude values on Supported header there is a comma left after applying the exclude
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
Before exclude_hf_value call : **Supported: 100rel, path, replaces**
After exclude_hf_value call : **Supported: 100rel,**
#### Reproduction
simple with sipp
```
route {
exclude_hf_value("Supported", "replaces");
exclude_hf_value("Supported", "path");
}
```
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
tested on kamailio 5.5.4 and kamailio 5.6.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
debian bullseye
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3180
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3180(a)github.com>