### Description
We send HEP3 data to the UDP listener in kamailio. In this HEP3 data, there are SIP requests and replies. We want to route these SIP messages through `request_route` and `onreply_route`. For this, we use the SipCapture module with the following settings:
```
modparam("sipcapture", "db_url", DBURL)
modparam("sipcapture", "capture_on", 1)
modparam("sipcapture", "hep_capture_on", 1)
modparam("sipcapture", "insert_retries", 0)
modparam("sipcapture", "insert_retry_timeout", 0)
request_route {
xlog("L_INFO", "Got new request ($ci) $rm: $si => $Ri\n");
}
onreply_route {
xlog("L_INFO", "Got new reply ($ci) $rm: $si => $Ri - Reply Code $rs\n");
}
```
In the past (version kamailio 5.1.x - 5.4.x), this worked as expected. From the logs:
```
2(8) INFO: <script>: Got new request (7xkVDrAWegvcZl-ACaUb1HWHwiCYhAJR) INVITE: 217.116.121.230 => 172.20.21.4
3(9) INFO: <script>: Got new reply (7xkVDrAWegvcZl-ACaUb1HWHwiCYhAJR) INVITE: 172.20.21.4 => 217.116.121.230 - Reply Code 407
```
Starting with kamailio 5.5.x, some pseudo variables are broken. From the logs:
```
1(7) INFO: <script>: Got new request (7xkVDrAWegvcZl-ACaUb1HWHwiCYhAJR) INVITE: 217.116.121.230 => 217.116.121
2(8) INFO: <script>: Got new reply (7xkVDrAWegvcZl-ACaUb1HWHwiCYhAJR) INVITE: 172.20.21.4 => 172.20.21.4 3(9) INFO: <script>: ...
```
As you can see, the `$Ri` in the request is wrong. It looks like the first three octets of the `$si` and the fourth octet is missing entirely.
And for the reply:
- The `$Ri` is the `$si`.
- The line is missing the static text `Reply Code`, the actual reply code.
- The next log is on the same line (the new line is gone). (In this case, we simply sent a third HEP3 message.)
To my untrained eye this looks like possible memory corruption.
### Troubleshooting
#### Reproduction
1. Set up a kamailio 5.8.1 using the attached [kamailio.cfg](https://github.com/kamailio/kamailio/files/15161868/kamailio.…
`/usr/sbin/kamailio -E -DD -dd -f "/etc/kamailio/kamailio.cfg"`
2. Send the HEP3 data using [heplify](https://github.com/sipcapture/heplify)
`./heplify -t pcap -rf "sipcapture-bug.pcap" -hs localhost:9060 -e -eof-exit`
#### Debugging Data
#### Log Messages
see above
#### SIP Traffic
see attached [sipcapture-bug.pcap](https://github.com/kamailio/kamailio/files/15161698/si…
### Possible Solutions
Use kamailio 5.4.x or earlier versions.
### Additional Information
When setting `nonsip_hook` = `1`, then the `$hep(...)` pseudo variables look fine. Unfortunately, we don't know how process the SIP messages after that point.
```
modparam("sipcapture", "nonsip_hook", 1)
...
event_route[sipcapture:request] {
xlog("L_INFO", "version: $hep(version)\n");
xlog("L_INFO", "src_ipv4: $hep(0x003)\n");
xlog("L_INFO", "dst_ipv4: $hep(0x004)\n");
xlog("L_INFO", "src_proto: $hep(0x007)\n");
xlog("L_INFO", "dst_proto: $hep(0x008)\n");
xlog("L_INFO", "proto: $hep(0x00b)\n");
}
```
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.1 (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, MEM_JOIN_FREE, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_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:
compiled with gcc 12.2.0
```
Also tested with same error: 5.5.x, 5.6.x, 5.7.x
* **Operating System**:
```
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3835
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3835(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:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing 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
I tried to update to a new version of kamailio and it didn't start with the old configuration file, I found out that the regex module is responsible.
Log after start:
` 0(713737) INFO: regex [regex_mod.c:417]: load_pcres(): num groups = 1
0(713737) INFO: regex [regex_mod.c:419]: load_pcres(): <group[0]>((^[1-9]\d{5}$)|(^ukrb[12]$)) </group[0]> (size = 29)
0(713735) ERROR: <core> [core/daemonize.c:302]: daemonize(): Main process exited before writing to pipe`
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
grep regex /usr/local/etc/kamailio/kamailio.cfg
loadmodule "regex.so"
modparam("regex", "file", "/usr/local/etc/kamailio/regex_groups")
cat /usr/local/etc/kamailio/regex_groups
[0]
#cislo linky
(^[1-9]\d{5}$)
(^ukrb[12]$)
#### 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.
-->
```
gdb /usr/local/sbin/kamailio /core
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/sbin/kamailio...
warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing
[New LWP 713740]
warning: Section `.reg-xstate/713740' in core file too small.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/sbin/kamailio -S -P /run/kamailio/kamailio.pid -f /usr/local/etc/kam'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Section `.reg-xstate/713740' in core file too small.
#0 load_pcres (action=0) at regex_mod.c:466
466 *pcres = *pcres_tmp;
(gdb) bt full
#0 load_pcres (action=0) at regex_mod.c:466
i = 1
j = 32
f = 0x55c5775ea6b0
line = '\000' <repeats 499 times>
patterns = 0x7f7e7ad3a230
pcre_error_num = 100
pcre_error = '\000' <repeats 16 times>, "\277Fou\305U\000\000\000\000\000\000m\000\000\000(Hou\305U\000\000\332Gou\305U\000\000\220\000\000\000\000\000\000\000\020\240\303z~\177\000\000 \274$u\305U\000\000\037\000\000\000\004\000\000\000\001\000\000\000%\000\000\000\n\344\n\000\000\000\000\000 \274$u\305U\000\000\000\000\000\000\000\000\000\000\n\344\n\000\000\000\000\000\360\212\355\255\374\177\000"
pcre_erroffset = 0
num_pcres_tmp = 1
pcres_tmp = 0x7f7e7ad62c00
llen = 19
__func__ = "load_pcres"
#1 0x00007f7e79f62c92 in mod_init () at regex_mod.c:245
__func__ = "mod_init"
#2 0x000055c5754a99f7 in init_mod (m=0x7f7e7adeb1f0) at core/sr_module.c:1036
ret = -2097389668
__func__ = "init_mod"
#3 0x000055c5754a9687 in init_mod (m=0x7f7e7adeb6c0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#4 0x000055c5754a9687 in init_mod (m=0x7f7e7adebda0) at core/sr_module.c:1031
ret = -2097386271
__func__ = "init_mod"
#5 0x000055c5754a9687 in init_mod (m=0x7f7e7adec3b0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#6 0x000055c5754a9687 in init_mod (m=0x7f7e7adec910) at core/sr_module.c:1031
ret = -1376937648
__func__ = "init_mod"
#7 0x000055c5754a9687 in init_mod (m=0x7f7e7adece70) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#8 0x000055c5754a9687 in init_mod (m=0x7f7e7aded520) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#9 0x000055c5754a9687 in init_mod (m=0x7f7e7adedc10) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#10 0x000055c5754a9687 in init_mod (m=0x7f7e7adee1f0) at core/sr_module.c:1031
ret = -1376937902
__func__ = "init_mod"
#11 0x000055c5754a9687 in init_mod (m=0x7f7e7adeeaf0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#12 0x000055c5754a9687 in init_mod (m=0x7f7e7adef4d0) at core/sr_module.c:1031
ret = 16
__func__ = "init_mod"
#13 0x000055c5754a9687 in init_mod (m=0x7f7e7adef8e0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#14 0x000055c5754a9687 in init_mod (m=0x7f7e7adefdd0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#15 0x000055c5754a9687 in init_mod (m=0x7f7e7adf3320) at core/sr_module.c:1031
ret = 2053729903
__func__ = "init_mod"
#16 0x000055c5754a9687 in init_mod (m=0x7f7e7adf3770) at core/sr_module.c:1031
ret = -1
__func__ = "init_mod"
#17 0x000055c5754a9687 in init_mod (m=0x7f7e7adf3ba0) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#18 0x000055c5754a9687 in init_mod (m=0x7f7e7adf4140) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#19 0x000055c5754a9687 in init_mod (m=0x7f7e7adf4550) at core/sr_module.c:1031
ret = 0
__func__ = "init_mod"
#20 0x000055c5754a9687 in init_mod (m=0x7f7e7adf6140) at core/sr_module.c:1031
ret = 713738
__func__ = "init_mod"
#21 0x000055c5754a9dc4 in init_modules () at core/sr_module.c:1067
t = 0xae40a
i = -1
__func__ = "init_modules"
#22 0x000055c57526927c in main (argc=12, argv=0x7ffcaded9fd8) at main.c:3202
cfg_stream = 0x55c57746a2a0
c = -1
r = 0
tmp = 0x7ffcadedae88 ""
tmp_len = 832
port = 5060
proto = 0
aproto = 0
ahost = 0x0
aport = 0
options = 0x55c5756b8368 ":f:cm:M:dVIhEeb:B:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
ret = -1
seed = 4165046025
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0x98000000980
p = 0x180000000 <error: Cannot access memory at address 0x180000000>
st = {st_dev = 115, st_ino = 321140, st_nlink = 2, st_mode = 16888, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1712844094, tv_nsec = 899597355}, st_mtim = {tv_sec = 1712844094, tv_nsec = 899597355}, st_ctim = {tv_sec = 1712844094, tv_nsec = 899597355}, __glibc_reserved = {0, 0, 0}}
--Type <RET> for more, q to quit, c to continue without paging--
l1 = 2048
tbuf = "p\233\355\255\374\177\000\000\310%ǂ~\177\000\000\020D\373\202~\177\000\000\000\000\000\000\000\000\000\000\360\233\355\255\374\177\000\000\000\000\000\000\000\000\000\000\360\233\355\255\374\177", '\000' <repeats 18 times>, "`\307\373\202~\177\000\000\350\204\376\202~\177\000\000\204\311\373\202~\177\000\000\060\304\373\202~\177\000\000Hp\376\202~\177\000\000\000\300\373\202~\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000@\342ł~\177", '\000' <repeats 66 times>...
option_index = 12
long_options = {{name = 0x55c5756ba886 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55c5756b554c "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55c5756ba88b "alias", has_arg = 1, flag = 0x0, val = 1024}, {name = 0x55c5756ba891 "subst", has_arg = 1, flag = 0x0, val = 1025}, {name = 0x55c5756ba897 "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x55c5756ba8a0 "substdefs",
has_arg = 1, flag = 0x0, val = 1027}, {name = 0x55c5756ba8aa "server-id", has_arg = 1, flag = 0x0, val = 1028}, {name = 0x55c5756ba8b4 "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {name = 0x55c5756ba8bf "modparam", has_arg = 1, flag = 0x0, val = 1030}, {name = 0x55c5756ba8c8 "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {name = 0x55c5756ba8d3 "debug", has_arg = 1, flag = 0x0, val = 1032}, {
name = 0x55c5756ba8d9 "cfg-print", has_arg = 0, flag = 0x0, val = 1033}, {name = 0x55c5756ba8e3 "atexit", has_arg = 1, flag = 0x0, val = 1034}, {name = 0x55c5756ba8ea "all-errors", has_arg = 0, flag = 0x0, val = 1035}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
__func__ = "main"
```
#### 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).
-->
```
0(713842) WARNING: tls [tls_mod.c:747]: mod_register(): OpenSSL 1.1.1 setting cryptorand random engine
0(713842) INFO: rtimer [rtimer_mod.c:298]: stm_t_param(): created rtimer name=iptables interval=60 mode=1
0(713842) INFO: <core> [core/tcp_main.c:5205]: init_tcp(): using epoll_lt as the io watch method (auto detected)
loading modules under config path: /usr/local/lib64/kamailio/modules/
Listening on
udp: 81.31.45.42 [81.31.45.42]:5060
udp: 81.31.45.42 [81.31.45.42]:6688
udp: 81.31.45.42 [81.31.45.42]:443
udp: 81.31.45.42 [81.31.45.42]:6699
tcp: 81.31.45.42 [81.31.45.42]:5060
tcp: 81.31.45.42 [81.31.45.42]:443
tcp: 81.31.45.42 [81.31.45.42]:6688
tcp: 81.31.45.42 [81.31.45.42]:6699
tls: 81.31.45.42 [81.31.45.42]:5061
tls: 81.31.45.42 [81.31.45.42]:6689
tls: 81.31.45.42 [81.31.45.42]:6670
Aliases:
*: sip2.gope.cz:*
*: sipo.smartel.cz:*
*: sipi.smartel.cz:*
*: siptest.odorik.cz:*
*: *.odorik.cz:*
0(713844) INFO: rr [../outbound/api.h:53]: ob_load_api(): unable to import bind_ob - maybe module is not loaded
0(713844) INFO: rr [rr_mod.c:185]: mod_init(): outbound module not available
0(713844) INFO: geoip2 [geoip2_mod.c:96]: mod_init(): using GeoIP database path /var/kamailio/GeoLite2-City-17.06.22.mmdb, library version 1.5.2
0(713844) INFO: cfgutils [cfgutils.c:829]: mod_init(): no hash_file given, disable hash functionality
0(713844) INFO: regex [regex_mod.c:417]: load_pcres(): num groups = 1
0(713844) INFO: regex [regex_mod.c:419]: load_pcres(): <group[0]>(((^[1-9]\d{5}$))|((^ukrb[12]$)))</group[0]> (size = 33)
0(713842) ERROR: <core> [core/daemonize.c:302]: daemonize(): Main process exited before writing to pipe
```
#### 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`
```
kamailio -v
version: kamailio 5.8.1 (x86_64/linux) 215af5-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_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: 215af5 -dirty
compiled on 15:32:24 Apr 11 2024 with gcc 10.2.1
```
* **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`)
-->
```
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
uname -a
Linux serZT 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3812(a)github.com>
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
- we migrated rtpengine urls from udp to websocket, so that kamailio is communicating to rtpengine overwebsocket to manage the offer and answer. however we observed that, tcp reciever process is consuming pkg memory as, traffic increased, but when traffic is idle then its not getting freed automatically. and eventually its consume all memory.
-
-
-->
### Troubleshooting
- as checked further we particulartly tcp reciever process was consuming pkg memory , then further we checked from corex pkg_sumary for that process id, and found that rtpengine: rtpengine.c: send_rtpp_command was consuming highest memory.
#### Reproduction
console rtpengine url with ws endpoint.
<!--
If the issue can be reproduced, describe how it can be done.
-->
this is reproducible, we can configure websocket in rtpengine module and then we can initate calls. and increase the number of calls over the period of time
#### Debugging Data
<img width="1399" alt="Screenshot 2024-03-06 at 4 30 16 PM" src="https://github.com/kamailio/kamailio/assets/115363081/0904892e-6a6e-4dc1-85…">
kamcmd pkg.stats
entry: 24
pid: 378355
rank: 17
used: 7467640
free: 24348320
real_used: 9206112
total_size: 33554432
total_frags: 66
desc: tcp receiver (generic) child=0
kamcmd corex.pkg_summary pid 378355
Mar 6 16:31:52 coreproxy-4 /usr/local/sbin/kamailio[378355]: ALERT: qm_sums: qm_sums(): count= 8075 size= 4638760 bytes from rtpengine: rtpengine.c: send_rtpp_command(3040)
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
(paste your output here)
version: kamailio 5.7.0 (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, MEM_JOIN_FREE, 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_BLOCKLIST, 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 on 01:04:28 Jan 25 2024 with gcc 9.4.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`)
-->
```
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
Linux coreproxy-4 5.15.0-1045-oracle #51~20.04.1-Ubuntu SMP Fri Sep 22 14:25:26 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3777
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3777(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:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing 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
Kamailio segfaults on startup. After a bit of digging, it looks like the issue is caused by trying to publish something related to an expired dalog which is present in the database:
```
kamailio=# select * from dialog;
id | hash_entry | hash_id | callid | from_uri | from_tag | to_uri | to_tag | caller_cseq |
callee_cseq | caller_route_set | callee_route_set | caller_contact |
callee_contact | caller_sock | callee_sock | state | start_time | timeout | sflags | iflags | toroute_name | req_ur
i | xdata
----+------------+---------+---------------------------+------------------------------+----------+-------------------------------------------+---------------+-------------+-
------------+--------------------------------------------+------------------+---------------------------------------------------------------------------+--------------------
-----------------------------------+----------------------+----------------------+-------+------------+------------+--------+--------+--------------+------------------------
-------------------+-------
90 | 3720 | 11295 | msowdcchfzrlapg@localhost | sip:101@example.voismart.com | msfvz | sip:*9001*0039123456@example.voismart.com | HBQj442BFrH0N | 131 |
0 | <sip:172.23.42.1;lr=on;ftag=msfvz;nat=yes> | | sip:101_example_voismart_com@172.23.42.1:5065;alias=192.168.1.201~32878~1 | sip:*9001*003912345
6@172.23.42.211:5060;transport=udp | udp:172.23.42.3:5060 | udp:172.23.42.3:5060 | 4 | 1706715542 | 1706801943 | 0 | 1 | | sip:*9001*0039123456@ex
ample.voismart.com |
(1 row)
```
### Troubleshooting
#### 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.
-->
```
(gdb) bt full
#0 0x00007f193de1bc93 in free_str_list_all (del_current=0x2e656c706d617865) at /usr/local/src/pkg/src/modules/pua_dialoginfo/pua_dialoginfo.c:1109
del_next = <optimized out>
__func__ = "free_str_list_all"
#1 0x00007f193de1ebc6 in free_dlginfo_cell (param=0x7f1942265dc8) at /usr/local/src/pkg/src/modules/pua_dialoginfo/pua_dialoginfo.c:1079
cell = 0x7f1942265dc8
cell = <optimized out>
__func__ = <optimized out>
#2 free_dlginfo_cell (param=0x7f1942265dc8) at /usr/local/src/pkg/src/modules/pua_dialoginfo/pua_dialoginfo.c:1070
cell = 0x0
__func__ = "free_dlginfo_cell"
#3 0x00007f1940b7120b in destroy_dlg_callbacks_list (cb=0x0) at /usr/local/src/pkg/src/modules/dialog/dlg_cb.c:74
cb_t = 0x7f1942266050
__func__ = "destroy_dlg_callbacks_list"
#4 0x00007f1940ba5229 in destroy_dlg (dlg=0x7f1941b1a8a0) at /usr/local/src/pkg/src/modules/dialog/dlg_hash.c:369
ret = <optimized out>
var = <optimized out>
__func__ = "destroy_dlg"
#5 0x00007f1940ba6b08 in destroy_dlg_table () at /usr/local/src/pkg/src/modules/dialog/dlg_hash.c:436
dlg = 0x0
l_dlg = <optimized out>
i = 3720
__func__ = <optimized out>
#6 destroy_dlg_table () at /usr/local/src/pkg/src/modules/dialog/dlg_hash.c:422
dlg = <optimized out>
l_dlg = <optimized out>
i = <optimized out>
__func__ = "destroy_dlg_table"
#7 0x00007f1940b57b06 in mod_destroy () at /usr/local/src/pkg/src/modules/dialog/dialog.c:871
No locals.
#8 0x000055dd96a6d1e2 in destroy_modules () at core/sr_module.c:872
t = 0x7f1949d9d5f0
foo = 0x7f1949d94710
__func__ = "destroy_modules"
#9 0x000055dd96864d01 in cleanup (show_status=1) at /usr/local/src/pkg/src/main.c:573
memlog = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
__func__ = "cleanup"
#10 0x000055dd96c92a4d in shutdown_children.constprop.0 (show_status=show_status@entry=1, sig=15) at /usr/local/src/pkg/src/main.c:721
__func__ = <optimized out>
#11 0x000055dd9685fcd5 in handle_sigs () at /usr/local/src/pkg/src/main.c:821
chld = <optimized out>
chld_status = 139
any_chld_stopped = <optimized out>
memlog = <optimized out>
__func__ = "handle_sigs"
#12 0x000055dd96868aa4 in main_loop () at /usr/local/src/pkg/src/main.c:1988
i = <optimized out>
pid = <optimized out>
si = <optimized out>
si_desc = "udp receiver child=31 sock=172.23.42.3:9999\000\335U\000\000\000\260\312I\031\177\000\000\003\000\000\000\377\377\377\377\004\220\312\226\335U\000\000\004\000\000\000\031\177\000\000\003\000\000\000\000\000\000\000\t\000\000\000\000\000\000\000Tue Feb \000\023&\252U\314\342\207:34 2024\005\000\000\000\000\000\000"
nrprocs = <optimized out>
woneinit = 1
error = <optimized out>
__func__ = "main_loop"
#13 0x000055dd96859ffc in main (argc=<optimized out>, argv=<optimized out>) at /usr/local/src/pkg/src/main.c:3212
cfg_stream = <optimized out>
c = <optimized out>
r = <optimized out>
tmp = 0x7ffe9d9b7db4 ""
tmp_len = 1274056464
port = 32537
proto = 1275323104
ahost = 0x0
aport = 0
options = 0x55dd96cac300 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
ret = -1
seed = 3377142042
rfd = <optimized out>
debug_save = <optimized out>
debug_flag = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
dont_fork_cnt = <optimized out>
n_lst = <optimized out>
p = <optimized out>
st = {st_dev = 194, st_ino = 570312884, st_nlink = 2, st_mode = 16872, st_uid = 101, st_gid = 101, __pad0 = 0, st_rdev = 0, st_size = 6, st_blksize = 4096,
st_blocks = 0, st_atim = {tv_sec = 1707216241, tv_nsec = 46870706}, st_mtim = {tv_sec = 1707216227, tv_nsec = 573144090}, st_ctim = {tv_sec = 1707216227,
tv_nsec = 573144090}, __glibc_reserved = {0, 0, 0}}
tbuf = '\000' <repeats 16 times>, '/' <repeats 16 times>, "\230\r", '\000' <repeats 14 times>, "`", '\000' <repeats 15 times>, "\001", '\000' <repeats 143 times>...
option_index = 12
__func__ = "main"
long_options = {{name = 0x55dd96cabfe2 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55dd96cb3dc8 "version", has_arg = 0, flag = 0x0, val = 118}, {
name = 0x55dd96cc3731 "alias", has_arg = 1, flag = 0x0, val = 1024}, {name = 0x55dd96cabfe7 "subst", has_arg = 1, flag = 0x0, val = 1025}, {
name = 0x55dd96cabfed "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x55dd96cabff6 "substdefs", has_arg = 1, flag = 0x0, val = 1027}, {
name = 0x55dd96cac000 "server-id", has_arg = 1, flag = 0x0, val = 1028}, {name = 0x55dd96cac00a "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {
name = 0x55dd96cac015 "modparam", has_arg = 1, flag = 0x0, val = 1030}, {name = 0x55dd96cac01e "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {
name = 0x55dd96cb3ee5 "debug", has_arg = 1, flag = 0x0, val = 1032}, {name = 0x55dd96cac029 "cfg-print", has_arg = 0, flag = 0x0, val = 1033}, {
name = 0x55dd96cac033 "atexit", has_arg = 1, flag = 0x0, val = 1034}, {name = 0x55dd96cac03a "all-errors", has_arg = 0, flag = 0x0, val = 1035}, {name = 0x0,
has_arg = 0, flag = 0x0, val = 0}}
(gdb) info locals
del_next = <optimized out>
__func__ = "free_str_list_all"
(gdb) list
1104 in /usr/local/src/pkg/src/modules/pua_dialoginfo/pua_dialoginfo.c
```
#### 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).
-->
```
65(75) DEBUG: dialog [dlg_timer.c:232]: get_expired_dlgs(): start with tl=0x7f1941b1a900 tl->prev=0x7f1941a084d8 tl->next=0x7f1941a084d8 (45536602) at 45536603 and end with end=0x7f1941a084d8 end->prev=0x7f1941b1a900 end->next=0x7f1941b1a900
65(75) DEBUG: dialog [dlg_timer.c:237]: get_expired_dlgs(): getting tl=0x7f1941b1a900 tl->prev=0x7f1941a084d8 tl->next=0x7f1941a084d8 with 45536602
65(75) DEBUG: dialog [dlg_timer.c:243]: get_expired_dlgs(): end with tl=0x7f1941a084d8 tl->prev=0x7f1941b1a900 tl->next=0x7f1941b1a900 and d_timer->first.next->prev=(nil)
65(75) DEBUG: dialog [dlg_timer.c:280]: dlg_timer_routine(): tl=0x7f1941b1a900 next=(nil)
65(75) DEBUG: dialog [dlg_cb.c:267]: run_dlg_callbacks(): dialog=0x7f1941b1a8a0, type=64
65(75) DEBUG: pua_dialoginfo [pua_dialoginfo.c:395]: __dialog_sendpublish(): dialog over, from=sip:101@example.voismart.com
65(75) DEBUG: pua_dialoginfo [dialog_publish.c:410]: dialog_publish_multi(): CALLING dialog_publish for URI
65(75) DEBUG: <core> [core/parser/parse_uri.c:1389]: parse_uri(): bad uri, state 0 parsed: <> (4) / <> (28)
65(75) ERROR: pua_dialoginfo [dialog_publish.c:303]: dialog_publish(): failed to parse the PUBLISH R-URI
123(133) CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 133
123(133) DEBUG: <core> [core/tcp_main.c:3955]: handle_ser_child(): dead child 65, pid 75 (shutting down?)
123(133) DEBUG: <core> [core/io_wait.h:597]: io_watch_del(): DBG: io_watch_del (0x55dd96e1fba0, 133, -1, 0x0) fd_no=157 called
0(1) ALERT: <core> [main.c:791]: handle_sigs(): child process 75 exited by a signal 11
0(1) ALERT: <core> [main.c:795]: handle_sigs(): core was generated
0(1) INFO: <core> [main.c:818]: handle_sigs(): terminating due to SIGCHLD
2(12) INFO: <core> [main.c:874]: sig_usr(): signal 15 received
3(13) INFO: <core> [main.c:874]: sig_usr(): signal 15 received
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.7.4 (x86_64/linux) dc393e
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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_BLOCKLIST, 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: dc393e
compiled with gcc 11.4.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`)
-->
```
Linux c7a9e0ef942e 6.6.13-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Jan 20 18:03:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
```
Running in a Docker container based on Ubuntu Jammy which builds kamailio from git tag 5.7.4.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3743
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3743(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)
- [ ] 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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
When calling delete_urecord in DB_ONLY mode the location_attrs are not deleted. This fix makes sure to delete location_attrs when calling db_delete_urecord is called.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3827
-- Commit Summary --
* usrloc: delete location_attrs in db_only mode on delete_urecord
-- File Changes --
M src/modules/usrloc/ucontact.c (36)
M src/modules/usrloc/urecord.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3827.patchhttps://github.com/kamailio/kamailio/pull/3827.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3827
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3827(a)github.com>
These below is sample diagram, where kamailio/rtpengine act as an SBC
<img width="1604" alt="image" src="https://github.com/kamailio/kamailio/assets/143789335/b9540fb3-c1bf-4a78-b1…">
* There is an active call carrier, kamailio/rtpngine and Asterisk1
* Asterisk1 went down (power shortage, or network ..)
* What I want is kamailio self-redirect the call to Asterisk2
**Describe the solution you'd like**
Ideally, kamailio provide the command line to tell which call will be self-redirect to the new destination, eg:
`kamcmd -x sefl_redirect_callid <call-id> <destionation-ip>`
Noted: I read the https://blog.opensips.org/2021/06/09/media-re-anchoring-using-opensips-3-2/ but re-INVITE to carrier seem not appropriate in my case due to call rate limit. I'm looking for a new solution where I don't need to use re-INVITE when Asterisk down.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3773
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3773(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)
- [ ] 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 -->
This PR aims to update some warning levels used in `db_cluster` module to prevent silent failures.
When `db_cluster` tries to do some action in a `db_connector`, it should log some kind of warning (with `conid` that failed) or error instead of debug.
When iterating on db_connectors and one fails, it will log a warning with `conid` and if all of the available db are not available it will log an error indicating failure.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3834
-- Commit Summary --
* db_cluster: Update log levels
-- File Changes --
M src/modules/db_cluster/dbcl_api.c (83)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3834.patchhttps://github.com/kamailio/kamailio/pull/3834.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3834
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3834(a)github.com>
### Description
I can see this error during db_mysql compilation on CentOS 7
```
CC (gcc) [M db_mysql.so] km_dbase.o
CC (gcc) [M db_mysql.so] km_val.o
CC (gcc) [M db_mysql.so] km_row.o
CC (gcc) [M db_mysql.so] km_my_con.o
km_my_con.c: In function 'db_mysql_new_connection':
km_my_con.c:183:15: error: 'MYSQL_OPT_SSL_CA' undeclared (first use in this function)
ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
^
km_my_con.c:183:15: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [km_my_con.o] Error 1
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/kamailio-5.8.1/src'
make: *** [every-module] Error 2
```
This for 5.8.1 release.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3809
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3809(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:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
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
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
Hello. I use uac_req_send to send registration to the asterisk pool. If some asterisk did not authorize and re-sent the 401 code, the module causes a kamailio crash
### Troubleshooting
ds_select("BACKENDS","0");
while(ds_set_dst()) {
xlog("L_DBG",">>> BACKEND du=$du\n");
$uac_req(ruri)="sip:" + $(du{uri.host});
$uac_req(furi)="sip:" + $avp(username) + "@" + $(du{uri.host});
$uac_req(turi)=$uac_req(furi);
uac_req_send();
ds_next_dst();
}
#### 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.
-->
```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f /etc/kamailio/kamailio.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00005557272803b9 in timer_list_expire (t=1180105352, h=0x7f73b30a3bb8, slow_l=0x7f73b30a73a0, slow_mark=2907) at core/timer.c:846
846 core/timer.c: No such file or directory.
(gdb) bt full
#0 0x00005557272803b9 in timer_list_expire (t=1180105352, h=0x7f73b30a3bb8, slow_l=0x7f73b30a73a0, slow_mark=2907) at core/timer.c:846
tl = 0x7f73b3a49a88
ret = 0
#1 0x00005557272809cf in timer_handler () at core/timer.c:922
saved_ticks = 1180105352
run_slow_timer = 0
i = 859
__func__ = "timer_handler"
#2 0x0000555727280f53 in timer_main () at core/timer.c:961
No locals.
#3 0x0000555726f77736 in main_loop () at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:1831
i = 6
pid = 0
si = 0x0
si_desc = "udp receiver child=5 sock=10.153.5.40:5060\000\000\020\000\000\000\003\000\000\000!\000\000\000\000\262\270\224RE&\035(\247K'WU\000\000WqA'WU\000\000\000\000\000\000\000\000\000\000c\367@'WU\000\000!\000\000\000\000\000\000\000\260\325\022\371s\177\000\000 \236.\220\375\177\000\000ݕ\024'WU\000"
nrprocs = 6
woneinit = 1
__func__ = "main_loop"
#4 0x0000555726f83d11 in main (argc=12, argv=0x7ffd902ea398) at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:3078
cfg_stream = 0x555727e12380
c = -1
r = 0
tmp = 0x7ffd902ebe36 ""
tmp_len = 0
port = 0
proto = 0
ahost = 0x0
aport = 0
options = 0x55572744e898 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
ret = -1
seed = 4270110361
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0x7ffd902ea398
p = 0x7ffd902ea310 ""
st = {st_dev = 25, st_ino = 5514, st_nlink = 2, st_mode = 16888, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1690276408, tv_nsec = 971865637}, st_mtim = {tv_sec = 1690276408,
tv_nsec = 971865637}, st_ctim = {tv_sec = 1690276408, tv_nsec = 971865637}, __glibc_reserved = {0, 0, 0}}
tbuf = '\000' <repeats 80 times>, "\377\000\000\000\377\000\000\000\000\377\000\000\000\000\000\000", '/' <repeats 16 times>, "\230\r", '\000' <repeats 14 times>, "`", '\000' <repeats 15 times>, "\001", '\000' <repeats 144 times>...
option_index = 12
long_options = {{name = 0x55572740a2e9 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55572740b84a "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55572740f6e4 "alias", has_arg = 1, flag = 0x0, val = 1024}, {name = 0x55572740a2ee "subst",
has_arg = 1, flag = 0x0, val = 1025}, {name = 0x55572740a2f4 "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x55572740a2fd "substdefs", has_arg = 1, flag = 0x0, val = 1027}, {name = 0x55572740a307 "server-id", has_arg = 1, flag = 0x0, val = 1028},
{name = 0x55572740a311 "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {name = 0x55572740a31c "modparam", has_arg = 1, flag = 0x0, val = 1030}, {name = 0x55572740a325 "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {name = 0x55572740b967 "debug",
has_arg = 1, flag = 0x0, val = 1032}, {name = 0x55572740a330 "cfg-print", has_arg = 0, flag = 0x0, val = 1033}, {name = 0x55572740a33a "atexit", has_arg = 1, flag = 0x0, val = 1034}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
__func__ = "main"
(gdb) info locals
tl = 0x7f73b3a49a88
ret = 0
(gdb) list
841 in core/timer.c
(gdb)
```
```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f /etc/kamailio/kamailio.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f73f575d4d0 in free_hash_table () at /build/kamailio-5.6.4+ubuntu22.04/src/modules/tm/h_table.c:464
464 /build/kamailio-5.6.4+ubuntu22.04/src/modules/tm/h_table.c: No such file or directory.
(gdb) bt full
#0 0x00007f73f575d4d0 in free_hash_table () at /build/kamailio-5.6.4+ubuntu22.04/src/modules/tm/h_table.c:464
p_cell = 0x0
tmp_cell = 0x0
i = 64459
__func__ = "free_hash_table"
#1 0x00007f73f5793e46 in tm_shutdown () at /build/kamailio-5.6.4+ubuntu22.04/src/modules/tm/t_funcs.c:88
__func__ = "tm_shutdown"
#2 0x00005557271db17b in destroy_modules () at core/sr_module.c:842
t = 0x7f73f68a65a0
foo = 0x7f73f68a59e0
__func__ = "destroy_modules"
#3 0x0000555726f64029 in cleanup (show_status=1) at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:561
memlog = 0
__func__ = "cleanup"
#4 0x0000555726f66044 in shutdown_children (sig=15, show_status=1) at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:704
__func__ = "shutdown_children"
#5 0x0000555726f697dc in handle_sigs () at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:802
chld = 0
chld_status = 139
any_chld_stopped = 1
memlog = 0
__func__ = "handle_sigs"
#6 0x0000555726f78f42 in main_loop () at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:1900
i = 6
pid = 37846
si = 0x0
si_desc = "udp receiver child=5 sock=10.153.5.40:5060\000\000\020\000\000\000\003\000\000\000!\000\000\000\000\262\270\224RE&\035(\247K'WU\000\000WqA'WU\000\000\000\000\000\000\000\000\000\000c\367@'WU\000\000!\000\000\000\000\000\000\000\260\325\022\371s\177\000\000 \236.\220\375\177\000\000ݕ\024'WU\000"
nrprocs = 6
woneinit = 1
__func__ = "main_loop"
#7 0x0000555726f83d11 in main (argc=12, argv=0x7ffd902ea398) at /build/kamailio-5.6.4+ubuntu22.04/src/main.c:3078
cfg_stream = 0x555727e12380
c = -1
r = 0
tmp = 0x7ffd902ebe36 ""
tmp_len = 0
port = 0
proto = 0
ahost = 0x0
aport = 0
options = 0x55572744e898 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
ret = -1
seed = 4270110361
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0x7ffd902ea398
p = 0x7ffd902ea310 ""
st = {st_dev = 25, st_ino = 5514, st_nlink = 2, st_mode = 16888, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1690276408, tv_nsec = 971865637}, st_mtim = {tv_sec = 1690276408,
tv_nsec = 971865637}, st_ctim = {tv_sec = 1690276408, tv_nsec = 971865637}, __glibc_reserved = {0, 0, 0}}
tbuf = '\000' <repeats 80 times>, "\377\000\000\000\377\000\000\000\000\377\000\000\000\000\000\000", '/' <repeats 16 times>, "\230\r", '\000' <repeats 14 times>, "`", '\000' <repeats 15 times>, "\001", '\000' <repeats 144 times>...
option_index = 12
long_options = {{name = 0x55572740a2e9 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55572740b84a "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55572740f6e4 "alias", has_arg = 1, flag = 0x0, val = 1024}, {name = 0x55572740a2ee "subst",
has_arg = 1, flag = 0x0, val = 1025}, {name = 0x55572740a2f4 "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x55572740a2fd "substdefs", has_arg = 1, flag = 0x0, val = 1027}, {name = 0x55572740a307 "server-id", has_arg = 1, flag = 0x0, val = 1028},
{name = 0x55572740a311 "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {name = 0x55572740a31c "modparam", has_arg = 1, flag = 0x0, val = 1030}, {name = 0x55572740a325 "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {name = 0x55572740b967 "debug",
has_arg = 1, flag = 0x0, val = 1032}, {name = 0x55572740a330 "cfg-print", has_arg = 0, flag = 0x0, val = 1033}, {name = 0x55572740a33a "atexit", has_arg = 1, flag = 0x0, val = 1034}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
__func__ = "main"
(gdb) info locals
p_cell = 0x0
tmp_cell = 0x0
i = 64459
__func__ = "free_hash_table"
(gdb) list
459 in /build/kamailio-5.6.4+ubuntu22.04/src/modules/tm/h_table.c
```
#### 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).
-->
```
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f8a6c440050), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_send_info_clone(110) - ignoring
CRITICAL: <core> [core/mem/q_malloc.c:123]: qm_debug_check_frag(): BUG: qm: fragm. 0x7f74379f46b0 (address 0x7f74379f46e8) beginning overwritten (0)! Memory allocator was called from uac: uac_send.c:860. Fragment marked by (null):0. Exec from core/mem/q_malloc.c:511.
```
#### 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).
-->
```
proto:UDP 2023-07-25T10:00:44.452898Z 10.153.5.40:5060 ---> 192.168.50.107:5060
REGISTER sip:192.168.50.107 SIP/2.0
Via: SIP/2.0/UDP 10.153.5.40;branch=z9hG4bK6a0b.834627a6000000000000000000000000.0
To: <sip:3408@192.168.50.107>
From: <sip:3408@192.168.50.107>;tag=b2f228866a24b161d346cfb256d45132-a0527658
CSeq: 10 REGISTER
Call-ID: 2332840947916a3e-39417(a)10.153.5.40
Max-Forwards: 70
Content-Length: 0
Contact: <sip:3408@10.153.5.40:5060>
Expires: 150
User-Agent: PortSIP UC Client Android - v11.8.1
proto:UDP 2023-07-25T10:00:44.464436Z 192.168.50.107:5060 ---> 10.153.5.40:5060
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.153.5.40;rport=5060;received=10.153.5.40;branch=z9hG4bK6a0b.834627a6000000000000000000000000.0
Call-ID: 2332840947916a3e-39417(a)10.153.5.40
From: <sip:3408@192.168.50.107>;tag=b2f228866a24b161d346cfb256d45132-a0527658
To: <sip:3408@192.168.50.107>;tag=z9hG4bK6a0b.834627a6000000000000000000000000.0
CSeq: 10 REGISTER
WWW-Authenticate: Digest realm="vpp",nonce="1690279244/67fc12dbaf6a76fa34181a4bd504de00",opaque="1680d45809efac86",algorithm=md5,qop="auth"
Server: Asterisk
Content-Length: 0
proto:UDP 2023-07-25T10:00:44.466447Z 10.153.5.40:5060 ---> 192.168.50.107:5060
REGISTER sip:192.168.50.107 SIP/2.0
Via: SIP/2.0/UDP 10.153.5.40;branch=z9hG4bK7a0b.5673b4d4000000000000000000000000.0
To: <sip:3408@192.168.50.107>
From: <sip:3408@192.168.50.107>;tag=b2f228866a24b161d346cfb256d45132-a0527658
CSeq: 11 REGISTER
Call-ID: 2332840947916a3e-39417(a)10.153.5.40
Max-Forwards: 70
Content-Length: 0
Contact: <sip:3408@10.153.5.40:5060>
Expires: 150
Authorization: Digest username="3408", realm="vpp", nonce="1690279244/67fc12dbaf6a76fa34181a4bd504de00", uri="sip:192.168.50.107", opaque="1680d45809efac86", qop=auth, nc=00000001, cnonce="1935694403", response="38bc75e831e1267ce943bcc50f76390a", algorithm=MD5
User-Agent: PortSIP UC Client Android - v11.8.1
proto:UDP 2023-07-25T10:00:44.477675Z 192.168.50.107:5060 ---> 10.153.5.40:5060
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.153.5.40;rport=5060;received=10.153.5.40;branch=z9hG4bK7a0b.5673b4d4000000000000000000000000.0
Call-ID: 2332840947916a3e-39417(a)10.153.5.40
From: <sip:3408@192.168.50.107>;tag=b2f228866a24b161d346cfb256d45132-a0527658
To: <sip:3408@192.168.50.107>;tag=z9hG4bK7a0b.5673b4d4000000000000000000000000.0
CSeq: 11 REGISTER
WWW-Authenticate: Digest realm="vpp",nonce="1690279244/67fc12dbaf6a76fa34181a4bd504de00",opaque="5adc30b867f02d18",algorithm=md5,qop="auth"
Server: Asterisk
Content-Length: 0
```
### 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`
```
version: kamailio 5.6.4 (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_BLOCKLIST, 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 11.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`)
-->
```
5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3522
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3522(a)github.com>