[SR-Users] Dialog module is crashing after setting track_cseq_updates to 1

Fernando Aquilino fernando.aquilino at istmo.com.br
Wed Jan 28 21:14:37 CET 2015


Hi,

after setting track_cseq_updates to 1 in module dialog (and calling
dlg_manage() from request_route) I'm getting reproducible crashes in both
stable (4.2.2) and dev (4.3.0-dev3, 2015-01-28) releases.

I made the change to cope with CSeq not being incremented when sending
another INVITE with authentication information with by calling
uac_auth()/append_branch()/t_relay(). The SIP trunk on the asterisk server
I'm forwarding the request to requires so and sends me an "401
Unauthorized" message after the first INVITE.

Anyone using it would help me with the configuration?

Should I post to the dev list?


Thanks for any help,
Fernando Aquilino



-------------------- kamailio.cfg --------------------

modparam("uac","credential","username:domain:password")
modparam("uac","auth_realm_avp","$avp(i:101)")
modparam("uac","auth_username_avp","$avp(i:102)")
modparam("uac","auth_password_avp","$avp(i:103)")
modparam("uac","restore_mode","none")

modparam("dialog", "track_cseq_updates", 1)
modparam("dialog", "dlg_flag", 4)

...

failure_route["serial"] {

        if (t_check_status("401|407")) {
                if (isflagset(auth_sent)) {
                        xlog("Authentication failed on SIP Trunk: $ru");

                } else {

                        #realm
                        $avp(i:101) = "asterisk";
                        #username
                        $avp(i:102) = "user123";
                        #password
                        $avp(i:103) = "pass123";

                        if (uac_auth()) {

                                setflag(auth_sent);
                                t_on_failure("serial");
                                append_branch();
                                t_relay();
                        }
                }
                exit;
        }


        if (!t_next_contacts()) {
                exit;
        }

        t_on_failure("serial");
        t_relay();
}

------------------------------------------------------------


-------------------- debug log --------------------

Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_cseq.c:215]: dlg_cseq_msg_sent(): traking cseq updates
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_hash.c:633]: dlg_lookup(): ref dlg 0x7f9eeb4aec20 with 1 -> 2
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_hash.c:635]: dlg_lookup(): dialog id=9870 found on entry 2115
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_cseq.c:249]: dlg_cseq_msg_sent(): uac auth request - cseq inc needed
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_var.c:248]: print_lists(): Internal var-list ((nil)):
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_var.c:258]: print_lists(): Dialog var-list (0x7f9eeb4b2f38):
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9838]: DEBUG: dialog
[dlg_var.c:263]: print_lists(): cseq_diff=1 (flags 1)
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9856]: CRITICAL: <core>
[pass_fd.c:275]: receive_fd(): EOF on 20
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9856]: DEBUG: <core>
[tcp_main.c:3445]: handle_ser_child(): dead child 10, pid 9838 (shutting
down?)
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9856]: DEBUG: <core>
[io_wait.h:598]: io_watch_del(): DBG: io_watch_del (0x96cfe0, 20, -1, 0x0)
fd_no=37 called
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9828]: ALERT: <core>
[main.c:727]: handle_sigs(): child process 9838 exited by a signal 11
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9828]: ALERT: <core>
[main.c:730]: handle_sigs(): core was not generated
Jan 28 17:40:12 kamailio /usr/sbin/kamailio[9828]: INFO: <core>
[main.c:742]: handle_sigs(): terminating due to SIGCHLD

------------------------------------------------------------


-------------------- core dump* --------------------

root at kamailio:/etc/kamailio# gdb kamailio core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 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".
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/.build-id/62/86ce2a5e0241120986e5ec3ed803be5b945076.debug...done.
done.
[New LWP 3077]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `                                       '.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fbe4ba33dae in memcpy (__len=18446744073709551522,
__src=0x7fbe47c9f121, __dest=0x7ffff12ada6d) at
/usr/include/x86_64-linux-gnu/bits/string3.h:52
52      return __builtin___memcpy_chk (__dest, __src, __len, __bos0
(__dest));



(gdb) bt
#0  0x00007fbe4ba33dae in memcpy (__len=18446744073709551522,
__src=0x7fbe47c9f121, __dest=0x7ffff12ada6d) at
/usr/include/x86_64-linux-gnu/bits/string3.h:52
#1  dlg_cseq_msg_sent (data=0x7ffff12bda40) at dlg_cseq.c:298
#2  0x0000000000000000 in ?? ()



(gdb) bt full
#0  0x00007fbe4ba33dae in memcpy (__len=18446744073709551522,
__src=0x7fbe47c9f121, __dest=0x7ffff12ada6d) at
/usr/include/x86_64-linux-gnu/bits/string3.h:52
No locals.
#1  dlg_cseq_msg_sent (data=0x7ffff12bda40) at dlg_cseq.c:298
        msg = {id = 0, pid = 0, tval = {tv_sec = 0, tv_usec = 0},
fwd_send_flags = {f = 0 '\000', blst_imask = 0 '\000'}, rpl_send_flags = {f
= 0 '\000', blst_imask = 0 '\000'},
          first_line = {type = 1, flags = 1, len = 44, u = {request =
{method = {
                  s = 0x7fbe47c9f038 "INVITE sip:030636111 at 192.168.2.151
SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0"..., len = 6}, uri = {
                  s = 0x7fbe47c9f03f "sip:030636111 at 192.168.2.151
SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0337c5a7"..., len = 27}, version = {
                  s = 0x7fbe47c9f05b "SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0337c5a75bfeebaef0700dd30e433800.1\r\n"...,
len = 7}, method_value = 1}, reply = {version = {
                  s = 0x7fbe47c9f038 "INVITE sip:030636111 at 192.168.2.151
SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0"..., len = 6}, status = {
                  s = 0x7fbe47c9f03f "sip:030636111 at 192.168.2.151
SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0337c5a7"..., len = 27}, reason = {
                  s = 0x7fbe47c9f05b "SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0337c5a75bfeebaef0700dd30e433800.1\r\n"...,
len = 7}, statuscode = 1}}}, via1 = 0x7fbe504594b8, via2 = 0x7fbe50456778,
headers = 0x7fbe50459230,
          last_header = 0x7fbe504598c8, parsed_flag = 134284414, h_via1 =
0x7fbe50458810, h_via2 = 0x7fbe50459320, callid = 0x7fbe5044fee0, to =
0x7fbe504598c8,
          cseq = 0x7fbe50459020, from = 0x7fbe5045a3b0, contact = 0x0,
maxforwards = 0x0, route = 0x0, record_route = 0x7fbe50459230, content_type
= 0x0, content_length = 0x0,
          authorization = 0x0, expires = 0x0, proxy_auth = 0x0, supported =
0x7fbe50459108, require = 0x0, proxy_require = 0x0, unsupported = 0x0,
allow = 0x0, event = 0x0,
          accept = 0x0, accept_language = 0x0, organization = 0x0, priority
= 0x0, subject = 0x0, user_agent = 0x7fbe50459a60, server = 0x0,
content_disposition = 0x0,
          diversion = 0x0, rpid = 0x0, refer_to = 0x0, session_expires =
0x0, min_se = 0x0, sipifmatch = 0x0, subscription_state = 0x0, date = 0x0,
identity = 0x0,
          identity_info = 0x0, pai = 0x0, ppi = 0x0, path = 0x0, privacy =
0x0, body = 0x0, eoh = 0x0,
          unparsed = 0x7fbe47c9f2d8 "Contact: \"Fernando Aquilino\" <
sip:200 at 192.168.1.72:5060>\r\nAllow:
INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING,PRACK\r\nContent-Length:
252\r\nContent-Type: application/sdp\r\nMax-F"..., rcv = {src_ip = {af = 0,
len = 0, u = {addrl = {0, 0}, addr32 = {0, 0, 0, 0}, addr16 = {0, 0, 0, 0,
0, 0, 0, 0},
                addr = '\000' <repeats 15 times>}}, dst_ip = {af = 0, len =
0, u = {addrl = {0, 0}, addr32 = {0, 0, 0, 0}, addr16 = {0, 0, 0, 0, 0, 0,
0, 0},
                addr = '\000' <repeats 15 times>}}, src_port = 0, dst_port
= 0, proto_reserved1 = 0, proto_reserved2 = 0, src_su = {s = {sa_family = 0,
                sa_data = '\000' <repeats 13 times>}, sin = {sin_family =
0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero =
"\000\000\000\000\000\000\000"}, sin6 = {
                sin6_family = 0, sin6_port = 0, sin6_flowinfo = 0,
sin6_addr = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16
= {0, 0, 0, 0, 0, 0, 0, 0},
                    __u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}},
bind_address = 0x0, proto = 0 '\000'},
          buf = 0x7fbe47c9f038 "INVITE sip:030636111 at 192.168.2.151
SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0"..., len = 1357, new_uri = {s = 0x0, len
= 0}, dst_uri = {s = 0x0, len = 0}, parsed_uri_ok = 0, parsed_uri = {user =
{
              s = 0x0, len = 0}, passwd = {s = 0x0, len = 0}, host = {s =
0x0, len = 0}, port = {s = 0x0, len = 0}, params = {s = 0x0, len = 0},
sip_params = {s = 0x0, len = 0},
            headers = {s = 0x0, len = 0}, port_no = 0, proto = 0, type =
ERROR_URI_T, flags = 0, transport = {s = 0x0, len = 0}, ttl = {s = 0x0, len
= 0}, user_param = {s = 0x0,
              len = 0}, maddr = {s = 0x0, len = 0}, method = {s = 0x0, len
= 0}, lr = {s = 0x0, len = 0}, r2 = {s = 0x0, len = 0}, gr = {s = 0x0, len
= 0}, transport_val = {s = 0x0,
              len = 0}, ttl_val = {s = 0x0, len = 0}, user_param_val = {s =
0x0, len = 0}, maddr_val = {s = 0x0, len = 0}, method_val = {s = 0x0, len =
0}, lr_val = {s = 0x0,
              len = 0}, r2_val = {s = 0x0, len = 0}, gr_val = {s = 0x0, len
= 0}}, parsed_orig_ruri_ok = 0, parsed_orig_ruri = {user = {s = 0x0, len =
0}, passwd = {s = 0x0,
              len = 0}, host = {s = 0x0, len = 0}, port = {s = 0x0, len =
0}, params = {s = 0x0, len = 0}, sip_params = {s = 0x0, len = 0}, headers =
{s = 0x0, len = 0}, port_no = 0,
            proto = 0, type = ERROR_URI_T, flags = 0, transport = {s = 0x0,
len = 0}, ttl = {s = 0x0, len = 0}, user_param = {s = 0x0, len = 0}, maddr
= {s = 0x0, len = 0}, method = {
              s = 0x0, len = 0}, lr = {s = 0x0, len = 0}, r2 = {s = 0x0,
len = 0}, gr = {s = 0x0, len = 0}, transport_val = {s = 0x0, len = 0},
ttl_val = {s = 0x0, len = 0},
            user_param_val = {s = 0x0, len = 0}, maddr_val = {s = 0x0, len
= 0}, method_val = {s = 0x0, len = 0}, lr_val = {s = 0x0, len = 0}, r2_val
= {s = 0x0, len = 0}, gr_val = {
              s = 0x0, len = 0}}, add_rm = 0x0, body_lumps = 0x0,
reply_lump = 0x0, add_to_branch_s = '\000' <repeats 57 times>,
add_to_branch_len = 0, hash_index = 0, msg_flags = 0,
          flags = 0, set_global_address = {s = 0x0, len = 0},
set_global_port = {s = 0x0, len = 0}, force_send_socket = 0x0, path_vec =
{s = 0x0, len = 0}, instance = {s = 0x0,
            len = 0}, reg_id = 0, ruid = {s = 0x0, len = 0}, location_ua =
{s = 0x0, len = 0}, ldv = {flow = {decoded = 0, rcv = {src_ip = {af = 0,
len = 0, u = {addrl = {0, 0},
                    addr32 = {0, 0, 0, 0}, addr16 = {0, 0, 0, 0, 0, 0, 0,
0}, addr = '\000' <repeats 15 times>}}, dst_ip = {af = 0, len = 0, u =
{addrl = {0, 0}, addr32 = {0, 0, 0,
                      0}, addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, addr = '\000'
<repeats 15 times>}}, src_port = 0, dst_port = 0, proto_reserved1 = 0,
proto_reserved2 = 0, src_su = {s = {
                    sa_family = 0, sa_data = '\000' <repeats 13 times>},
sin = {sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero =
"\000\000\000\000\000\000\000"},
                  sin6 = {sin6_family = 0, sin6_port = 0, sin6_flowinfo =
0, sin6_addr = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>,
__u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0},
                        __u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}},
bind_address = 0x0, proto = 0 '\000'}}}}
---Type <return> to continue, or q <return> to quit---
        obuf = 0x7ffff12bda40
        direction = 1
        t = <optimized out>
        ninc = <optimized out>
        vinc = <optimized out>
        dlg = 0x7fbe47c9a8e0
        nval = {s = 0xa0ce84 "2", len = 1}
        pval = <optimized out>
        tbuf = "INVITE sip:030636111 at 192.168.2.151 SIP/2.0\r\nRecord-Route:
<sip:192.168.2.160;lr;did=34e.1782>\r\nRecord-Route:
<sip:192.168.2.163;lr>\r\nCSeq: 1 INVITE\r\nVia: SIP/2.0/UDP
192.168.2.160;branch=z9hG4bKa7ee.0"...
        tbuf_len = 237
        via = <optimized out>
        __FUNCTION__ = "dlg_cseq_msg_sent"
#2  0x0000000000000000 in ?? ()
No symbol table info available.
(gdb)


------------------------------------------------------------
*I generated a core dump by running kamailio from the shell as "kamailio -D
-d -E -l 192.168.2.160:5060"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150128/55f71dee/attachment.html>


More information about the sr-users mailing list