When loaded mod kazoo i get error
```
/ # kamailio -DD -E
0(178) WARNING: <core> [core/cfg.y:3426]: warn_at(): warning in config file /etc/kamailio/default.cfg, line 67, column 12: raw socket support not compiled in
0(178) ERROR: <core> [core/sr_module.c:582]: load_module(): could not open module </usr/lib/kamailio/modules/kazoo.so>: Error relocating /usr/lib/kamailio/modules/kazoo.so: is_error: symbol not found
0(178) CRITICAL: <core> [core/cfg.y:3446]: yyerror_at(): parse error in config file /etc/kamailio/default.cfg, line 188, column 12-21: failed to load module
0(178) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <kazoo> found
```
And ldd output
```
/ # LD_PRELOAD=/usr/sbin/kamailio ldd /usr/lib/kamailio/modules/kazoo.so
ldd (0x5592f5d09000)
/usr/sbin/kamailio => /usr/sbin/kamailio (0x7fa6235bc000)
libjson-c.so.4 => /usr/lib/libjson-c.so.4 (0x7fa6233ae000)
libuuid.so.1 => /lib/libuuid.so.1 (0x7fa6231a8000)
librabbitmq.so.4 => /usr/lib/librabbitmq.so.4 (0x7fa622f8c000)
libevent-2.1.so.6 => /usr/lib/libevent-2.1.so.6 (0x7fa622d42000)
libsrdb1.so.1 => /usr/lib/kamailio//libsrdb1.so.1 (0x7fa622b21000)
libc.musl-x86_64.so.1 => ldd (0x5592f5d09000)
libssl.so.45 => /lib/libssl.so.45 (0x7fa6228d5000)
libcrypto.so.43 => /lib/libcrypto.so.43 (0x7fa62252a000)
Error relocating /usr/lib/kamailio/modules/kazoo.so: is_error: symbol not found
/ #
```
Symbol `is_error` is defined at `/usr/include/json-c/bits.h`
```
/**
* @deprecated
*/
#define is_error(ptr) (ptr == NULL)
```
I not know why this simple definition is not compiled into mod kazoo on latest Alpine:edge.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1540
### Description
When SIP message fails to be sent due to no socket found, apparently the TM module is not deleting the transaction and so it is causing a memory leak.
### Troubleshooting
#### Reproduction
The easiest way to reproduce the problem is to setup a dispatcher destination with SIP ping enabled. Kamailio should not be listening to the interface which is used to reach that destination. So this will cause Kamailio to complain about not finding a socket to send the OPTIONS.
After this happens, it is possible to see from the **kamcmd tm.stats** command that the "created" has increased by 1, freed has not changed and "delayed_free" also increased by 1.
Problem is that the delayed_free never gets freed and after checking the **kamcmd core.shmmem**, for every failed OPTIONS request under this condition, 5808 bits are leaked...
This goes on until there is no shared memory left.....
#### Debugging Data
#### Log Messages
```
/usr/sbin/kamailio[20755]: DEBUG: dispatcher [dispatch.c:2664]: ds_ping_set(): probing set #2, URI sip:10.11.12.13:6060
/usr/sbin/kamailio[20755]: DEBUG: tm [uac.c:427]: t_uac_prepare(): next_hop=<sip:10.11.12.13:6060>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/resolve.c:1225]: srv_sip_resolvehost(): 10.11.12.13:6060 proto=0
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/resolve.c:1346]: srv_sip_resolvehost(): returning 0xada520 (10.11.12.13:6060 proto=1)
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/forward.c:174]: get_out_socket(): socket determined: 0x7f33189ee298
/usr/sbin/kamailio[20755]: DEBUG: tm [uac.c:152]: dlg2hash(): hashid 8554
/usr/sbin/kamailio[20755]: DEBUG: tm [uac.c:238]: t_run_local_req(): executing event_route[tm:local-request]
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:600]: parse_msg(): SIP Request:
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:602]: parse_msg(): method: <OPTIONS>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:604]: parse_msg(): uri: <sip:10.11.12.13:6060>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:606]: parse_msg(): version: <SIP/2.0>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_via.c:1303]: parse_via_param(): Found param type 232, <branch> = <z9hG4bKa612.f9317e75000000000000000000000000.0>; state=16
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=5
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:491]: parse_headers(): Via found, flags=2
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:493]: parse_headers(): this is the first via
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_addr_spec.c:864]: parse_addr_spec(): end of header reached, state=10
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:171]: get_hdr_field(): <To> [25]; uri=[sip:10.11.12.13:6060]
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:172]: get_hdr_field(): to body [<sip:10.11.12.13:6060>#015#012]
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: <10> <OPTIONS>
/usr/sbin/kamailio[20755]: DEBUG: pv [pv_trans.c:564]: tr_eval_string(): i=0 j=10
/usr/sbin/kamailio[20755]: NOTICE: <script>: [479309551f] OPTIONS: Local Request to sip:10.11.12.13:6060 - sip:10.11.12.13:6060
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_cseq.c:115]: dlg_cseq_prepare_new_msg(): prepare new msg for cseq update operations
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:600]: parse_msg(): SIP Request:
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:602]: parse_msg(): method: <OPTIONS>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:604]: parse_msg(): uri: <sip:10.11.12.13:6060>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:606]: parse_msg(): version: <SIP/2.0>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_via.c:1303]: parse_via_param(): Found param type 232, <branch> = <z9hG4bKa612.f9317e75000000000000000000000000.0>; state=16
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=5
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:491]: parse_headers(): Via found, flags=2
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:493]: parse_headers(): this is the first via
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_cseq.c:59]: dlg_cseq_prepare_msg(): prepare msg for cseq update operations
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_addr_spec.c:864]: parse_addr_spec(): end of header reached, state=10
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:171]: get_hdr_field(): <To> [25]; uri=[sip:10.11.12.13:6060]
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:172]: get_hdr_field(): to body [<sip:10.11.12.13:6060>#015#012]
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: <10> <OPTIONS>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_addr_spec.c:185]: parse_to_param(): add param: tag=744e9d847dad9acc2d5178ac65520eba-8cc2
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/parser/parse_addr_spec.c:864]: parse_addr_spec(): end of header reached, state=29
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_cseq.c:382]: dlg_cseq_msg_sent(): traking cseq updates
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_hash.c:766]: internal_get_dlg(): no dialog callid='479309551fdf88bf-20755(a)55.66.77.88' found
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_hash.c:797]: get_dlg(): no dialog callid='479309551fdf88bf-20755(a)55.66.77.88' found
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_handlers.c:1202]: dlg_lookup_msg_dialog(): dlg with callid '479309551fdf88bf-20755(a)55.66.77.88' not found
/usr/sbin/kamailio[20755]: DEBUG: dialog [dlg_cseq.c:394]: dlg_cseq_msg_sent(): no dialog for this request
/usr/sbin/kamailio[20755]: DEBUG: tm [uac.c:638]: send_prepared_request_impl(): uac: 0x7f331184c5f8 branch: 0 to 10.11.12.13:6060
/usr/sbin/kamailio[20755]: DEBUG: tm [../../core/onsend.h:69]: run_onsend(): required parameters are not available - ignoring
/usr/sbin/kamailio[20755]: DEBUG: dispatcher [dispatch.c:2664]: ds_ping_set(): probing set #1, URI sip:12.34.56.78:6060
/usr/sbin/kamailio[20755]: DEBUG: tm [uac.c:427]: t_uac_prepare(): next_hop=<sip:12.34.56.78:6060>
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/resolve.c:1225]: srv_sip_resolvehost(): 12.34.56.78:6060 proto=0
/usr/sbin/kamailio[20755]: DEBUG: <core> [core/resolve.c:1346]: srv_sip_resolvehost(): returning 0xada520 (12.34.56.78:6060 proto=1)
/usr/sbin/kamailio[20755]: ERROR: <core> [core/forward.c:181]: get_out_socket(): no socket found
/usr/sbin/kamailio[20755]: ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding socket found for(udp:12.34.56.78:6060)
/usr/sbin/kamailio[20755]: ERROR: tm [ut.h:317]: uri2dst2(): no corresponding socket found for "12.34.56.78" af 2 (udp:12.34.56.78:6060)
/usr/sbin/kamailio[20755]: ERROR: tm [uac.c:449]: t_uac_prepare(): no socket found
/usr/sbin/kamailio[20755]: ERROR: dispatcher [dispatch.c:2683]: ds_ping_set(): unable to ping [sip:12.34.56.78:6060]
```
Real IPs were replaced, this is their usage:
10.11.12.13 = Kamailio listening IP in local network interface
12.34.56.78 = destination SIP trunk which does not have a matching listened socket by Kamailio
55.66.77.88 = Kamailio listening IP in public network interface
#### SIP Traffic
### Possible Solutions
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.0.6 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 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 04:19:46 Mar 30 2018 with gcc 4.8.5
```
* **Operating System**:
```
# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
# uname -a
Linux dev1-sbcaio-01 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1554