Description

Kamailio is segfaulting after activating pubruri_caller_dlg_var and pubruri_callee_dlg_var from pua_dialoginfo.

modparam("pua_dialoginfo", "use_pubruri_avps", 1)
//modparam("pua_dialoginfo", "pubruri_caller_avp", "$avp(s:pubruris_caller)")
//modparam("pua_dialoginfo", "pubruri_callee_avp", "$avp(s:pubruris_callee)")
modparam("pua_dialoginfo", "pubruri_caller_dlg_var", "pubruri_caller")
modparam("pua_dialoginfo", "pubruri_callee_dlg_var", "pubruri_callee")

When i comment the corresponding lines and switch back to the regular avps Kamailio runs without problems.

Troubleshooting

Reproduction

In my setup it seems to be sufficient to just set the module parameters to provoke the segfault.
I dont have to wait for any SIP-Traffic or accessing the dlg_vars. Kamailio segfaults while starting.

Debugging Data

[root@kamroute ~]# gdb /usr/sbin/kamailio /core.6547
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/kamailio...Reading symbols from /usr/lib/debug/usr/sbin/kamailio.debug...done.
done.
[New LWP 6547]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/kamailio -P /var/run/kamailio/kamailio.pid -f /etc/kamailio/kamailio_'.
Program terminated with signal 11, Segmentation fault.
#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:31
31		movdqu	(%rdi), %xmm1
(gdb) bt full
#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:31
No locals.
#1  0x00007fc7c61786c4 in mod_init () at pua_dialoginfo.c:692
        bind_pua = 0x7fc7c6396b88 <bind_pua>
        s = {s = 0x0, len = -969002120}
        avp_spec = {type = 397561584, getf = 0x7fc7ce3b8827 <__fprintf+135>, setf = 0x3, pvp = {pvn = {type = 48, nfree = 0x7ffd17b24e80, u = {isname = {type = 397561264, name = {n = 7976200, s = {s = 0x79b508 "DEBUG", 
                      len = 397562576}, re = 0x79b508}}, dname = 0x7ffd17b24db0}}, pvi = {type = 0, u = {ival = 6547, dval = 0x1993}}}, trans = 0x79b508}
        __FUNCTION__ = "mod_init"
#2  0x00000000005661e2 in init_mod (m=0x7fc7cdbd3ac0) at core/sr_module.c:966
        __FUNCTION__ = "init_mod"
#3  0x0000000000565f1e in init_mod (m=0x7fc7cdbd3e50) at core/sr_module.c:963
        __FUNCTION__ = "init_mod"
#4  0x0000000000566519 in init_modules () at core/sr_module.c:995
        t = 0x20000003e4
        i = 994
        __FUNCTION__ = "init_modules"
#5  0x00000000004293e1 in main (argc=13, argv=0x7ffd17b252d8) at main.c:2584
        cfg_stream = 0x254c010
        c = -1
        r = 397562176
        tmp = 0x7ffd17b256e0 ""
        tmp_len = 0
        port = 0
        proto = 0
        options = 0x737a20 ":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 = 286186509
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0x0
        p = 0x0
        st = {st_dev = 18, st_ino = 37027, st_nlink = 2, st_mode = 16832, st_uid = 996, st_gid = 2, __pad0 = 0, st_rdev = 0, st_size = 60, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1507876455, tv_nsec = 469604021}, 
          st_mtim = {tv_sec = 1507878072, tv_nsec = 553083864}, st_ctim = {tv_sec = 1507878072, tv_nsec = 553083864}, __unused = {0, 0, 0}}
        __FUNCTION__ = "main"
(gdb) info locals
cfg_stream = 0x254c010
c = -1
r = 397562176
tmp = 0x7ffd17b256e0 ""
tmp_len = 0
port = 0
proto = 0
options = 0x737a20 ":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 = 286186509
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0x0
p = 0x0
st = {st_dev = 18, st_ino = 37027, st_nlink = 2, st_mode = 16832, st_uid = 996, st_gid = 2, __pad0 = 0, st_rdev = 0, st_size = 60, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1507876455, tv_nsec = 469604021}, st_mtim = {
    tv_sec = 1507878072, tv_nsec = 553083864}, st_ctim = {tv_sec = 1507878072, tv_nsec = 553083864}, __unused = {0, 0, 0}}
__FUNCTION__ = "main"
(gdb) list
26		mov	%edi, %ecx
27		and	$0x3f, %ecx
28		pxor	%xmm0, %xmm0
29		cmp	$0x30, %ecx
30		ja	L(next)
31		movdqu	(%rdi), %xmm1
32		pcmpeqb	%xmm1, %xmm0
33		pmovmskb %xmm0, %edx
34		test	%edx, %edx
35		jnz	L(exit_less16)
(gdb)

Log Messages

Nothing which seems to be interesting. Kamailios last words are:

 0(7450) DEBUG: <core> [core/sr_module.c:965]: init_mod(): pua_dialoginfo
 0(7450) DEBUG: <core> [core/sr_module.c:694]: find_mod_export_record(): find_export_record: found <bind_pua> in module pua [/usr/lib64/kamailio/modules/pua.so]
 0(7450) DEBUG: <core> [core/sr_module.c:694]: find_mod_export_record(): find_export_record: found <load_dlg> in module dialog [/usr/lib64/kamailio/modules/dialog.so]
 0(7448) ERROR: <core> [core/daemonize.c:303]: daemonize(): Main process exited before writing to pipe

SIP Traffic

no SIP Traffic needed

Possible Solutions

Additional Information

[root@kamroute ~]# kamailio -v
version: kamailio 5.0.3 (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 12:31:32 Sep 20 2017 with gcc 4.8.2

[root@kamroute ~]# rpm -qa|grep kamail
kamailio-presence-5.0.3-10.el7.x86_64
kamailio-outbound-5.0.3-10.el7.x86_64
kamailio-debuginfo-5.0.3-10.el7.x86_64
kamailio-5.0.3-10.el7.x86_64
kamailio-ims-5.0.3-10.el7.x86_64
kamailio-xmpp-5.0.3-10.el7.x86_64
kamailio-mysql-5.0.3-10.el7.x86_64
[root@kamroute ~]#

Up2date RHEL7.

[root@kamroute ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.4 (Maipo)
[root@kamroute ~]# uname -a
Linux kamroute.intranet.mydomain.de 3.10.0-514.26.1.el7.x86_64 #1 SMP Tue Jun 20 01:16:02 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@kamroute ~]# 

If you need any further information just let me know!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.