<!--
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.
-->
I am currenlty trying to configure Kamailio to send via HTTP a JSON message to a webserver about an incoming call.
Unfortunatly Kamailio crashes in the process shortly after the build of the JSON message. This is happening every second and third call. I am getting the following error message, when Kamailio is about to crash:
```
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: ERROR: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}jansson [jansson_funcs.c:228]: janssonmod_set(): unrecognized input type
```
I tested this on three VMs with the same behaviour:
- VM with Debian 11 and Kamailio 5.6.
- VM with Debian 11 and Kamailio 5.7.
- VM with Debian 12 and Kamailio 5.7.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
When I set something like this in the kamailio.cfg, every second or third incoming calls are causing a crash and Kamailio restarts.
```
/* Build the JSON formatted HTTP Requests */
jansson_set("object", "Call", '{"CallType":"$var(CallType)"}', "$var(http_routing_query)");
jansson_set("string", "Call.DeviceId", $var(CallDeviceId), "$var(http_routing_query)");
```
Without the `jansson_set()` I can generate more than 100 concurrent calls without a problem.
#### 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/sbin/kamailio /home/ladmin/core
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 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/sbin/kamailio...
Reading symbols from /usr/lib/debug/.build-id/d7/49ff00b62a1c787a944d88d8b8292aca08ca1d.debug...
warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing
[New LWP 5716]
[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 SIGABRT, Aborted.
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt full
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {5641075408187236401}}
ret = <optimized out>
#1 0x00007f819c00ad2f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
No locals.
#2 0x00007f819bfbbef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#3 0x00007f819bfa6472 in __GI_abort () at ./stdlib/abort.c:79
save_stage = 1
act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {58, 0, 0, 140194624712704, 140194624715856, 140194624715856, 0, 93892812469232, 140721354859776, 1, 140194638635552, 140721354859776,
93892811155638, 93892812454032, 93892812120108, 140194638259824}}, sa_flags = 532412408, sa_restorer = 0x55651fbc7538 <__func__.1>}
#4 0x000055651f821c80 in qm_free (qmp=<optimized out>, p=<optimized out>, file=<optimized out>, func=<optimized out>, line=<optimized out>, mname=<optimized out>) at core/mem/q_malloc.c:499
qm = <optimized out>
f = <optimized out>
size = <optimized out>
next = <optimized out>
prev = <optimized out>
__func__ = "qm_free"
#5 0x000055651faa72d3 in free_to_params (tb=0x7f819b99fea0) at core/parser/parse_addr_spec.c:918
tp = <optimized out>
foo = 0x7f819b9ed9f0
tp = <optimized out>
foo = <optimized out>
__func__ = "free_to_params"
#6 free_to (tb=0x7f819b99fea0) at core/parser/parse_addr_spec.c:927
__func__ = "free_to"
#7 0x000055651fa901b7 in free_hdr_field_lst (hf=0x7f819b80d8f0) at core/parser/hf.c:216
foo = 0x7f819b80df18
__func__ = "free_hdr_field_lst"
#8 0x000055651fa975c6 in free_sip_msg (msg=msg@entry=0x7f819ba2a220) at core/parser/msg_parser.c:776
No locals.
#9 0x000055651f950d3d in receive_msg (buf=<optimized out>, len=<optimized out>, len@entry=1164, rcv_info=rcv_info@entry=0x7f81964f36a0) at core/receive.c:629
msg = 0x7f819ba2a220
ctx = {rec_lev = 2, run_flags = 0, last_retcode = 532062212, jmp_env = {{__jmpbuf = {140194549282440, 93892810816032, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 0, 0, 0, 140194644852349, 0,
5895253961443638784, 4095, 140194549283376, 140194549282440, 140721354861248, 2, 93892812120068, 4294967295}}}}}
bctx = <optimized out>
ret = <optimized out>
tvb = {tv_sec = 0, tv_usec = 0}
tve = {tv_sec = 0, tv_usec = 0}
diff = <optimized out>
inb = {
s = 0x5565204be320 "INVITE sip:+987654321@test-sbc-01.example.com:5060 SIP/2.0\r\nVia: SIP/2.0/TCP 192.168.80.6:5060;branch=z9hG4bK63d05bc5;rport\r\nMax-Forwards: 69\r\nFrom: \"+123456789\" <sip:+123456789@192.168.80.6>;tag=as4929383"..., len = 1164}
netinfo = {data = {s = 0x0, len = 0}, bufsize = 0, rcv = 0x0, dst = 0x0}
keng = <optimized out>
evp = {data = 0x7ffc3e5e6640, obuf = {s = 0x0, len = 0}, rcv = 0x7f81964f36a0, dst = 0x0, req = 0x0, rpl = 0x0, rplcode = 0, mode = 0}
cidlockidx = <optimized out>
cidlockset = <optimized out>
errsipmsg = <optimized out>
exectime = <optimized out>
__func__ = "receive_msg"
--Type <RET> for more, q to quit, c to continue without paging--
#10 0x000055651fa30681 in receive_tcp_msg (
tcpbuf=0x7f81964f3a30 "INVITE sip:+987654321@test-sbc-01.example.com:5060 SIP/2.0\r\nVia: SIP/2.0/TCP 192.168.80.6:5060;branch=z9hG4bK63d05bc5;rport\r\nMax-Forwards: 70\r\nFrom: \"+123456789\" <sip:+123456789@192.168.80.6>;tag=as4929383"..., len=1164, rcv_info=0x7f81964f36a0, con=con@entry=0x7f81964f3688) at core/tcp_read.c:1413
ret = 0
buf = 0x5565204be320 "INVITE sip:+987654321@test-sbc-01.example.com:5060 SIP/2.0\r\nVia: SIP/2.0/TCP 192.168.80.6:5060;branch=z9hG4bK63d05bc5;rport\r\nMax-Forwards: 69\r\nFrom: \"+123456789\" <sip:+123456789@192.168.80.6>;tag=as4929383"...
bsize = 65535
blen = 65535
__func__ = "receive_tcp_msg"
#11 0x000055651fa30b31 in tcp_read_req (con=0x7f81964f3688, bytes_read=bytes_read@entry=0x7ffc3e5e6ab8, read_flags=read_flags@entry=0x7ffc3e5e6ac0) at core/tcp_read.c:1604
bytes = <optimized out>
total_bytes = 1164
resp = 1
size = <optimized out>
req = 0x7f81964f37b0
dst = {send_sock = 0x55651fb6a004, to = {s = {sa_family = 8728, sa_data = "\273\037eU\000\000\340i^>\374\177\000"}, sin = {sin_family = 8728, sin_port = 8123, sin_addr = {s_addr = 21861}, sin_zero = "\340i^>\374\177\000"},
sin6 = {sin6_family = 8728, sin6_port = 8123, sin6_flowinfo = 21861, sin6_addr = {__in6_u = {__u6_addr8 = "\340i^>\374\177\000\000\030\000\000\000\000\000\000", __u6_addr16 = {27104, 15966, 32764, 0, 24, 0, 0, 0},
__u6_addr32 = {1046374880, 32764, 24, 0}}}, sin6_scope_id = 0}, sas = {ss_family = 8728,
__ss_padding = "\273\037eU\000\000\340i^>\374\177\000\000\030", '\000' <repeats 43 times>, "\001 \000\000@\n\243\233\201\177", '\000' <repeats 34 times>, "\310j^>\374\177\000\000\b\000\000\000\000\000\000",
__ss_align = 20}}, id = 1, send_flags = {f = 1, blst_imask = 0}, proto = 10 '\n', proto_pad0 = 0 '\000', proto_pad1 = 0}
c = 0 '\000'
ret = <optimized out>
__func__ = "tcp_read_req"
#12 0x000055651fa346a7 in handle_io (fm=fm@entry=0x7f819ba30a40, events=events@entry=1, idx=idx@entry=-1) at core/tcp_read.c:1855
ret = 458
n = 1164
read_flags = RD_CONN_SHORT_READ
con = 0x7f81964f3688
s = 10
resp = <optimized out>
t = <optimized out>
ee = 0x0
__func__ = "handle_io"
error = <optimized out>
#13 0x000055651fa3a75d in io_wait_loop_epoll (repeat=repeat@entry=0, t=<optimized out>, h=<optimized out>) at core/io_wait.h:1070
n = 1
r = 0
fm = 0x7f819ba30a40
revents = 1
__func__ = "io_wait_loop_epoll"
#14 0x000055651fa3af67 in tcp_receive_loop (unix_sock=<optimized out>) at core/tcp_read.c:1976
__func__ = "tcp_receive_loop"
#15 0x000055651fa245b7 in tcp_init_children (woneinit=woneinit@entry=0x7ffc3e5e6ffc) at core/tcp_main.c:5239
r = 0
i = <optimized out>
reader_fd_1 = 28
pid = <optimized out>
si_desc = "tcp receiver (generic)\000\000\001\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\006\a\235\037eU\000\000\004\240\266\037eU\000\000\2004\273\037eU\000\000\250\022\201\233\201\177\000\000\024", '\000' <repeats 15 times>, "\t\240\266\037eU\000\000\210\342\266\037eU\000\0008\005\000\000\000\000\000\000\004\240\266\037eU\000\000\277.\250\037eU\000"
si = <optimized out>
__func__ = "tcp_init_children"
error = <optimized out>
#16 0x000055651f833d13 in main_loop () at ./src/main.c:1851
i = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--c
pid = <optimized out>
si = <optimized out>
si_desc = "udp receiver child=1 sock=192.168.71.123:5060\000\000\000g\270\267\037eU\000\000\037M\272\037eU\000\000\235d\235d\000\000\000\000,\024\000\234\201\177\000\000\003\000\000\000\000\000\000\000\t\000\000\000\000\000\000\000Thu Jun \000\376\217X>&\320Q:48 2023\002\000\000\000\000\000\000"
nrprocs = <optimized out>
woneinit = 1
__func__ = "main_loop"
error = <optimized out>
#17 0x000055651f8254dc in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.c:3086
cfg_stream = <optimized out>
c = <optimized out>
r = <optimized out>
tmp = 0x7ffc3e5e8e7a ""
tmp_len = 0
port = 0
proto = -1675315600
ahost = 0x0
aport = 0
options = 0x55651fb6ccf0 ":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 = 2872567957
rfd = <optimized out>
debug_save = <optimized out>
debug_flag = <optimized out>
dont_fork_cnt = 0
n_lst = <optimized out>
p = <optimized out>
st = {st_dev = 23, st_ino = 1597, st_nlink = 2, st_mode = 16888, st_uid = 111, st_gid = 120, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1688030808, tv_nsec = 298133358},
st_mtim = {tv_sec = 1688030808, tv_nsec = 298133358}, st_ctim = {tv_sec = 1688030808, tv_nsec = 298133358}, __glibc_reserved = {0, 0, 0}}
tbuf = "\000\000\000\000\000\000\000\000p\266$\234\201\177\000\000\r\000\000\000\000\000\000\000\230!\025\234\201\177\000\0000v^>\374\177\000\000\370b\306\037eU\000\000 \360'\234\201\177\000\000\256\317%\234\201\177\000\000\001", '\000' <repeats 15 times>, "x\330$\234\201\177\000\000\3008&\234\201\177\000\000\000\000\000\000\000\000\000\000Pu^>\374\177\000\000\n", '\000' <repeats 15 times>, "0v^>\374\177\000\000\023\361%\234\201\177\000\000\000\000\000\000\000\000\000\000\370b\306\037eU\000\0000v^>\374\177\000\000\000\000\000\000\000\000\000\000\340\002(\234\201\177\000\000\000\000\000\000\000\000\000\000\240\026%\234\201\177\000\000"...
option_index = 12
long_options = {{name = 0x55651fb6b2d3 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55651fb749ae "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55651fb841b2 "alias", has_arg = 1, flag = 0x0, val = 1024}, {
name = 0x55651fb6b2d8 "subst", has_arg = 1, flag = 0x0, val = 1025}, {name = 0x55651fb6b2de "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x55651fb6b2e7 "substdefs", has_arg = 1, flag = 0x0, val = 1027}, {
name = 0x55651fb6b2f1 "server-id", has_arg = 1, flag = 0x0, val = 1028}, {name = 0x55651fb6b2fb "loadmodule", has_arg = 1, flag = 0x0, val = 1029}, {name = 0x55651fb6b306 "modparam", has_arg = 1, flag = 0x0, val = 1030}, {
name = 0x55651fb6b30f "log-engine", has_arg = 1, flag = 0x0, val = 1031}, {name = 0x55651fb74acb "debug", has_arg = 1, flag = 0x0, val = 1032}, {name = 0x55651fb6b31a "cfg-print", has_arg = 0, flag = 0x0, val = 1033}, {
name = 0x55651fb6b324 "atexit", has_arg = 1, flag = 0x0, val = 1034}, {name = 0x55651fb6b32b "all-errors", has_arg = 0, flag = 0x0, val = 1035}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
__func__ = "main"
(gdb) info locals
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {5641075408187236401}}
ret = <optimized out>
(gdb) list
39 in ./nptl/pthread_kill.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).
-->
```
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: ######################## INVITE #######################
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: incoming INVITE from +123456789 to +987654321
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route AUTH
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route REQINIT
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route NATDETECT
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route CANCEL
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route RETRANSMISSIONS
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route WITHINDLG
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route RECORD_ROUTE
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route DESTINATION
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route TWILIO_INCOMING
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route AVAYA_OUTGOING
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route HTTP_NOTIFICATION
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: ERROR: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}jansson [jansson_funcs.c:228]: janssonmod_set(): unrecognized input type
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Sending HTTP Request with ID 1234 to http://127.0.0.1:8080/action: {"Version":1,"MessageType":"Incomi
ngCall","Call":{"CallType":"TestCall","DeviceId":"XXXX","Device":{"Id":"2","Name":"XXX"},"Caller":"sip:+123456789@sip.twilio.com","XXXId":"sip:+123456789@sip.twilio.com","Destination":"sip:+987654321@avaya
.example.com;transport=tcp","ForwardedTo":"sip:+987654321@avaya.example.com","UCID":"0123456789","AvGlobalSessionId":"1234-5678-9123-4567"},"Sender":{"Hostname":"test-sbc-01","Location
":"Test"},"Timestamp":"2023-06-28T16:25:22Z"}
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route RELAY
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Branch Route MANAGE_BRANCH
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: new branch [0] to sip:+987654321@avaya.example.com;transport=tcp
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route NATMANAGE
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Entering Sub Route RTPENGINE
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2927]: INFO: {1 1 INVITE bd067878791fbae2f1490dc7a48915c8(a)0.0.0.0}<script>: Managing RTPEngine due to INVITE
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2928]: CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 8
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2915]: ALERT: <core> [main.c:776]: handle_sigs(): child process 2927 exited by a signal 11
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2915]: ALERT: <core> [main.c:779]: handle_sigs(): core was not generated
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2915]: INFO: <core> [main.c:801]: handle_sigs(): terminating due to SIGCHLD
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2926]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2922]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2925]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2920]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2921]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2918]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2917]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2919]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2916]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2923]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2928]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2924]: INFO: <core> [main.c:856]: sig_usr(): signal 15 received
Jun 28 16:29:48 test-sbc-01 /usr/sbin/kamailio[2915]: INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.7.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_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 12.2.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 12 (bookworm)
Release: 12
Codename: bookworm
Linux test-sbc-01 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3499
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3499(a)github.com>
warning on alpine dist
```
In file included from kz_amqp.c:32:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
In file included from kz_amqp.c:33:
/usr/include/amqp_framing.h:8:2: warning: #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead. [-Wcpp]
8 | #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead.
| ^~~~~~~
In file included from kz_amqp.c:34:
/usr/include/amqp_tcp_socket.h:7:2: warning: #warning "amqp_tcp_socket.h is deprecated, use rabbitmq-c/tcp_socket.h instead." [-Wcpp]
7 | #warning "amqp_tcp_socket.h is deprecated, use rabbitmq-c/tcp_socket.h instead."
| ^~~~~~~
In file included from kz_amqp.c:35:
/usr/include/amqp_ssl_socket.h:9:2: warning: #warning "amqp_ssl_socket.h is deprecated, use rabbitmq-c/ssl_socket.h instead. [-Wcpp]
9 | #warning "amqp_ssl_socket.h is deprecated, use rabbitmq-c/ssl_socket.h instead.
| ^~~~~~~
In file included from kz_amqp.h:35,
from kazoo.c:36:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
kz_amqp.c: In function 'kz_amqp_connection_open_ssl':
kz_amqp.c:815:13: warning: 'amqp_set_initialize_ssl_library' is deprecated [-Wdeprecated-declarations]
815 | amqp_set_initialize_ssl_library(1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/amqp_ssl_socket.h:11:
/usr/include/rabbitmq-c/ssl_socket.h:233:16: note: declared here
233 | void AMQP_CALL amqp_set_initialize_ssl_library(amqp_boolean_t do_initialize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC (gcc) [M kazoo.so] kz_fixup.o
CC (gcc) [M kazoo.so] kz_hash.o
In file included from kz_amqp.h:35,
from kz_hash.h:33,
from kz_hash.c:29:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
CC (gcc) [M kazoo.so] kz_json.o
CC (gcc) [M kazoo.so] kz_pua.o
kz_amqp.c: In function 'kz_amqp_send_ex':
kz_amqp.c:2327:12: warning: 'num_headers' may be used uninitialized [-Wmaybe-uninitialized]
2327 | if (num_headers > 0) {
| ^
kz_amqp.c:2281:9: note: 'num_headers' was declared here
2281 | int num_headers = 0;
| ^~~~~~~~~~~
CC (gcc) [M kazoo.so] kz_trans.o
In file included from kz_amqp.h:35,
from kz_trans.c:54:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
make[3]: Entering directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-95d33167cff13190b51c04b5347df6d419cf2630/src/lib/srdb1'
make[3]: 'libsrdb1.so.1.0' is up to date.
make[3]: Leaving directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-95d33167cff13190b51c04b5347df6d419cf2630/src/lib/srdb1'
LD (gcc) [M kazoo.so] kazoo.so
make[2]: --libs: No such file or directory
make[2]: --libs: No such file or directory
CC (gcc) [M rabbitmq.so] rabbitmq.o
CC (gcc) [M rabbitmq.so] utils.o
In file included from utils.c:47:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
In file included from utils.c:48:
/usr/include/amqp_framing.h:8:2: warning: #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead. [-Wcpp]
8 | #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead.
| ^~~~~~~
In file included from rabbitmq.c:55:
/usr/include/amqp_tcp_socket.h:7:2: warning: #warning "amqp_tcp_socket.h is deprecated, use rabbitmq-c/tcp_socket.h instead." [-Wcpp]
7 | #warning "amqp_tcp_socket.h is deprecated, use rabbitmq-c/tcp_socket.h instead."
| ^~~~~~~
In file included from rabbitmq.c:56:
/usr/include/amqp.h:7:2: warning: #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead." [-Wcpp]
7 | #warning "amqp.h is deprecated, use rabbitmq-c/amqp.h instead."
| ^~~~~~~
In file included from rabbitmq.c:57:
/usr/include/amqp_framing.h:8:2: warning: #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead. [-Wcpp]
8 | #warning "amqp_framing.h is deprecated, use rabbitmq-c/framing.h instead.
| ^~~~~~~
LD (gcc) [M rabbitmq.so] rabbitmq.so
CC (gcc) [M sctp.so] sctp_mod.o
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3464
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3464(a)github.com>
hello ,
I 'm trying to change value "xhttp_prom_timeout" to specific value , for instance 1 minute , to do i set command : modparam("xhttp_prom", "xhttp_prom_timeout", 1) , but it seems metrics is not deleted after 1 minute of not using this metric , only metric is deleted after 10 hours , even i set xhttp_prom_timeoutto 1
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3439
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3439(a)github.com>
### Description
_**Sipwise** hat on_
We noticed that pkg memory was getting exhausted and we found out that pv_cache_add() was the origin of the allocations.
We are using ``$xavp(user_<UUID>)`` variables that, for sure, are kind of dynamic.
There is a pv_cache_drop() that tries to remove ``$sht()`` occurrences when the cache is about to be filled but in our case that's not helping.
#### Log Messages
```
WARNING: ROUTE_SET_CALLEE_DIALOG_TOTAL <core> [core/pvapi.c:340]: pv_cache_add(): pv cache limit is going to be exceeded - pkg memory may get filled with pv declarations
WARNING: dialog:failed <core> [core/pvapi.c:340]: pv_cache_add(): pv cache limit is going to be exceeded - pkg memory may get filled with pv declarations
```
### Possible Solutions
Possible solutions that came on the top of my head:
- add a datetime member to struct _pv_cache so we can keep the last time it was accessed and search for the oldest and remove them in pv_cache_drop()
- add pv module parameter to define a magic prefix, for instance '__' that will mark those vars as "temporal" should remove it from cache when needed.
- add pv module parameter to control what types of variables will be added to cache
Any thoughts about this?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3440
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3440(a)github.com>
### Description
We've been experiencing random Kamailio crashes related to invalid memory access attempts at `0xffff` in `w_save` call, `ims_registrar_scscf_mod.c`:
```
Core was generated by `kamailio -w /home -DD -E -e -f /etc/kamailio/kamailio_scscf.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f5be796c452 in w_save (_m=0x7f5beafa5188, _route=0x7f5beaeab988 " \b\361\352[\177", _d=0x7f5be3bf8200 "", mode=0x7f5beafa5188 "4", _cflags=0xffff <error: Cannot access memory at address 0xffff>)
at ims_registrar_scscf_mod.c:628
```
We are running the latest Kamailio 5.6.4 using the official Docker image.
### Analysis
We were able to analyze corresponding core dump using `gdb` and determine the cause of those random crashes. It turns out that it is related to calling the `save` function of IMS Registrar SCSCF module with 2 arguments.
Example configuration:
```
save("REG_SAR_REPLY", "location");
```
According to documentation, this call is valid, as `mode` and `flags` parameters are optional:
https://kamailio.org/docs/modules/5.6.x/modules/ims_registrar_scscf.html#id…
The `save` function is exported in `ims_registrar_scscf_mod.c` as follows:
```
/*! \brief
* Exported functions
*/
static cmd_export_t cmds[] = {
{"save", (cmd_function) w_save, 2, assign_save_fixup3_async, 0, REQUEST_ROUTE | ONREPLY_ROUTE},
{"save", (cmd_function) w_save, 3, assign_save_fixup3_async, 0, REQUEST_ROUTE | ONREPLY_ROUTE},
{"save", (cmd_function) w_save, 4, save_fixup3, free_uint_fixup, REQUEST_ROUTE | ONREPLY_ROUTE},
...
}
```
And implemented as:
```
/*! \brief
* Wrapper to save(location)
*/
static int w_save(struct sip_msg* _m, char* _route, char* _d, char* mode, char* _cflags) {
if(_cflags){
return save(_m, _d, _route, ((int)(*_cflags)));
}
return save(_m, _d, _route, 0);
}
```
Using the 2-argument `save` variant in configuration effectively causes the `w_save` to be called from `src/core/action.c :: do_action` via a 3-argument function-pointer cast:
```
case MODULE2_T:
MODF_CALL(cmd_function, h, msg, a->val,
(char*)a->val[2].u.data,
(char*)a->val[3].u.data
);
break;
```
Unfortunately, this cast is inherently unsafe - it leaves the `mode` and `_cflags` undetermined. They are probably effectively bound to some memory area beyond the parameter values of the stack frame corresponding to the function call.
Our guess is that incidentally `_cflags == 0x0000` for most of those calls, due to how the stack is structured. But sometimes `_cflags == 0xFFFF` which satisfies the condition in `w_save`, causes `(int)(*_cflags)` dereference attempt and leads to the segmentation fault we've encountered.
### Workaround
Based on source code analysis, we have determined that always using `save` with a full set of arguments (including optional ones) will result in `w_save` being called via a 5-argument function pointer, which matches its signature and avoids the issue.
Example configuration with workaround applied:
```
save("REG_SAR_REPLY", "location", "0", "0");
```
After introducing this workaround on target environment we are no longer experiencing the problem.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3412
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3412(a)github.com>
We had a Kamailio 5.5.4 server crash. There were lots of the following errors repeated over and over in the Kamailio log:
Mar 10 14:59:14 px1 /usr/sbin/kamailio[1375]: WARNING: <core> [core/tcp_read.c:1840]: handle_io(): F_TCPCONN connection marked as bad: 0x7f48e97ecdc8 id 0 fd -1 refcnt 0 ([]:0 -> []:0)
Mar 10 14:59:14 px1 /usr/sbin/kamailio[1375]: CRITICAL: <core> [core/io_wait.h:596]: io_watch_del(): invalid fd -1, not in [0, 2)
And in the syslog it said:
Mar 10 14:59:14 px1 kernel: [731786.728781] kamailio[1363]: segfault at 10 ip 00007f48e6dde42d sp 00007ffc2d23ef00 error 4 in tls.so[7f48e6d9c000+47000]
Mar 10 14:59:14 px1 kernel: [731786.728814] Code: 98 01 5c 24 28 41 29 dd 49 01 84 24 40 01 00 00 c7 44 24 6c 00 00 00 00 85 c9 0f 85 be 08 00 00 49 8b 94 24 90 01 00 00 31
f6 <48> 8b 7a 10 31 d2 e8 38 10 fc ff 85 c0 0f 8e 90 0d 00 00 45 31 db
Is anyone able to advise whether this is a known issue, and if it's fixed in a more recent version? The only related bug report I found was issue #748 which was closed without resolution. Our Kamailio is installed from the Ubuntu 22.04 repository.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3392
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3392(a)github.com>
On Fedora Core when installed Kamailio and then installed additional packages then receive error
```
[root@caloes-1 ~]# journalctl -flu ostree-boot-complete.service -o cat
Starting ostree-boot-complete.service - OSTree Complete Boot...
error: ostree-finalize-staged.service failed on previous boot: During /etc merge: Modified config file newly defaults to directory 'kamailio', cannot merge
ostree-boot-complete.service: Main process exited, code=exited, status=1/FAILURE
ostree-boot-complete.service: Failed with result 'exit-code'.
Failed to start ostree-boot-complete.service - OSTree Complete Boot.
ostree-boot-complete.service - OSTree Complete Boot was skipped because all trigger condition checks failed.
ostree-boot-complete.service - OSTree Complete Boot was skipped because all trigger condition checks failed.
ostree-boot-complete.service - OSTree Complete Boot was skipped because all trigger condition checks failed.
```
Suggestion place default Kamailio config into dedicated package "kamailio-config-default".
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3252
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3252(a)github.com>