Hello,
when I use
dns_try_naptr=on corelog=-1 debug=-1 enable_tls=yes use_dns_cache=off dns_cache_init=off modparam("topoh", "mask_key", "TEAI32l)- eauiDEUIA!?()")
and run Kamailio under valgrind, Kamailio logs:
20(21) ERROR: kemix [kemix_mod.c:229]: ki_kx_get_ruri_attr(): failed to parse the R-URI 20(21) ERROR: rr [loose.c:1011]: loose_route_mode(): failed to parse Request URI
The workflow is: I start Kamailio. A UDP-client registers. Then a websocket client calls the UDP-client. Finally the websocket client hangs up. Valgrind does not report anything suspicious.
When I use instead
modparam("topoh", "mask_key", "TEAI32l")
for the same workflow, with the same configuration, valgrind logs:
==14== Invalid read of size 4 ==14== at 0x4867E5: atomic_cmpxchg_int (atomic_x86.h:224) ==14== by 0x486830: futex_get (futexlock.h:99) ==14== by 0x490CE4: dns_hash_get (dns_cache.c:673) ==14== by 0x4972A6: dns_get_entry (dns_cache.c:2001) ==14== by 0x499288: dns_srv_get_he (dns_cache.c:2455) ==14== by 0x597AAD: no_naptr_srv_sip_resolvehost (resolve.c:1599) ==14== by 0x598332: naptr_sip_resolvehost (resolve.c:1675) ==14== by 0x5983C5: _sip_resolvehost (resolve.c:1707) ==14== by 0x49943B: dns_srv_sip_resolvehost (dns_cache.c:2516) ==14== by 0x49B3DD: dns_sip_resolvehost (dns_cache.c:2738) ==14== by 0x59846A: sip_hostport2su (resolve.c:1727) ==14== by 0x4CB951: forward_request (forward.c:515) ==14== by 0x99993CD: t_relay_to (t_funcs.c:300) ==14== by 0x99EBA32: _w_t_relay_to (tm.c:1764) ==14== by 0x99F4DEB: ki_t_relay (tm.c:2917) ==14== by 0xA80A94B: sr_kemi_lua_exec_func_ex (app_lua_api.c:1022) ==14== by 0xA81237D: sr_kemi_lua_exec_func (app_lua_api.c:1706) ==14== by 0xA81B93F: sr_kemi_lua_exec_func_209 (app_lua_kemi_export.c:1717) ==14== by 0xA8383C0: luaD_precall (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA84C4CA: luaV_execute (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA838C90: luaD_callnoyield (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA837029: luaD_rawrunprotected (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA8391DF: luaD_pcall (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA8333DE: lua_pcallk (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA806F0C: app_lua_run_ex (app_lua_api.c:773) ==14== by 0xA825F06: sr_kemi_config_engine_lua (app_lua_mod.c:119) ==14== by 0x5048BE: sr_kemi_route (kemi.c:3784) ==14== by 0x588909: receive_msg (receive.c:502) ==14== by 0xA609ADF: ws_frame_receive (ws_frame.c:644) ==14== by 0x4BCAAB: sr_event_exec (events.c:299) ==14== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==14== ==14== ==14== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==14== Access not within mapped region at address 0x0 ==14== at 0x4867E5: atomic_cmpxchg_int (atomic_x86.h:224) ==14== by 0x486830: futex_get (futexlock.h:99) ==14== by 0x490CE4: dns_hash_get (dns_cache.c:673) ==14== by 0x4972A6: dns_get_entry (dns_cache.c:2001) ==14== by 0x499288: dns_srv_get_he (dns_cache.c:2455) ==14== by 0x597AAD: no_naptr_srv_sip_resolvehost (resolve.c:1599) ==14== by 0x598332: naptr_sip_resolvehost (resolve.c:1675) ==14== by 0x5983C5: _sip_resolvehost (resolve.c:1707) ==14== by 0x49943B: dns_srv_sip_resolvehost (dns_cache.c:2516) ==14== by 0x49B3DD: dns_sip_resolvehost (dns_cache.c:2738) ==14== by 0x59846A: sip_hostport2su (resolve.c:1727) ==14== by 0x4CB951: forward_request (forward.c:515) ==14== by 0x99993CD: t_relay_to (t_funcs.c:300) ==14== by 0x99EBA32: _w_t_relay_to (tm.c:1764) ==14== by 0x99F4DEB: ki_t_relay (tm.c:2917) ==14== by 0xA80A94B: sr_kemi_lua_exec_func_ex (app_lua_api.c:1022) ==14== by 0xA81237D: sr_kemi_lua_exec_func (app_lua_api.c:1706) ==14== by 0xA81B93F: sr_kemi_lua_exec_func_209 (app_lua_kemi_export.c:1717) ==14== by 0xA8383C0: luaD_precall (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA84C4CA: luaV_execute (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA838C90: luaD_callnoyield (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA837029: luaD_rawrunprotected (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA8391DF: luaD_pcall (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA8333DE: lua_pcallk (in /lib64/kamailio/modules/app_lua.so) ==14== by 0xA806F0C: app_lua_run_ex (app_lua_api.c:773) ==14== by 0xA825F06: sr_kemi_config_engine_lua (app_lua_mod.c:119) ==14== by 0x5048BE: sr_kemi_route (kemi.c:3784) ==14== by 0x588909: receive_msg (receive.c:502) ==14== by 0xA609ADF: ws_frame_receive (ws_frame.c:644) ==14== by 0x4BCAAB: sr_event_exec (events.c:299)
The stacktrace with the values of the variables is available at https://github.com/kamailio/kamailio/issues/3350 . Or at least these things seem very similar to me.
Any idea?
I can share the OCI-image and the full configuration.
Greetings Дилян