[OpenSIPS-Devel] [ opensips-Bugs-3545466 ] drouting in 1.8 causes crash

SourceForge.net noreply at sourceforge.net
Mon Jul 30 19:00:24 CEST 2012


Bugs item #3545466, was opened at 2012-07-18 09:44
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3545466&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.8.x
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Digipigeon (digipigeon)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: drouting in 1.8 causes crash

Initial Comment:
I think the problem eminates from drouting module, we have about 1,500,000 rules and and 50 gateways, testing on single calls works fine and problem cant be reproduced, however soon as I move over to production, the opensips crashes within 2 minutes.

Virtuall identical config (aside from 1.8 change requirements) is used accross our 1.7 servers.

See following dump

sudo gdb /usr/sbin/opensips CoreDump
    GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
    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://bugs.launchpad.net/gdb-linaro/>...
    Reading symbols from /usr/sbin/opensips...done.
    [New LWP 11878]
     
    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 `/usr/sbin/opensips -P /var/run/opensips/opensips.pid -m 2048 -M 32 -u opensips'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x00000000004dd6b9 in add_avp_last (flags=<optimized out>, name=<optimized out>, val=...) at usr_avp.c:174
    174                     for( ; last_avp && last_avp->next ; last_avp=last_avp->next);
    (gdb) list
    169             if (last_avp==NULL)
    170                     /* never got a end of list */
    171                     last_avp=*crt_avps;
    172             if (last_avp && last_avp->next)
    173                     /* end of list not updated */
    174                     for( ; last_avp && last_avp->next ; last_avp=last_avp->next);
    175
    176             if (last_avp==NULL) {
    177                     avp->next = *crt_avps;
    178                     *crt_avps = last_avp = avp;
    (gdb) bt full
    #0  0x00000000004dd6b9 in add_avp_last (flags=<optimized out>, name=<optimized out>, val=...) at usr_avp.c:174
            avp = 0x7fd883564570
            __FUNCTION__ = "add_avp_last"
    #1  0x00007fd8dffca58c in push_gw_for_usage (msg=0x7fd8e3a420f0, uri=<optimized out>, gw=0x7fd85cee9648, c_id=0x0, c_attrs=0x0, idx=<optimized out>) at drouting.c:1186
            val = {n = 1559140792, s = {s = 0x7fd85cee99b8 "3480.169.24.204500", len = 2}}
            __FUNCTION__ = "push_gw_for_usage"
    #2  0x00007fd8dffd0286 in do_routing (msg=0x7fd8e3a420f0, drg=<optimized out>, flags=0, whitelist=<optimized out>) at drouting.c:1576
            dsts_idx = {0, 1, 2, 3, 4, 5, 32767, 0, 19488, 58276, 32728, 0, 14, 0, 0, 0, 0, 0, 4, 0, 27456, 58272, 32728, 0, 65531, 65535, 0, 0, 8432, 58276, 32728, 0, 6,
              0, 0, 0, 0, 0, 0, 0, 31912, 23742, 32728, 0, 47781, 65, 0, 0, 31912, 23742, 32728, 0, 2855, 78, 0, 0, 0, 0, 0, 0, 7912, 58270, 32728, 0}
            carrier_idx = {31888, 58276, 32728, 0, 17896, 58272, 32728, 0, 65531, 65535, 0, 0, 8432, 58276, 32728, 0, 6, 0, 0, 0, 36565, 65, 0 <repeats 18 times>, 31888,
              58276, 32728, 0, 476, 0 <repeats 11 times>, 476, 0, 0, 0, 0, 0, 0, 0}
            from = <optimized out>
            uri = {user = {s = 0x7fd8e3a42d44 "441213433359 at 92.48.114.10:506070", len = 12}, passwd = {s = 0x0, len = 0}, host = {
                s = 0x7fd8e3a42d51 "92.48.114.10:506070", len = 12}, port = {s = 0x7fd8e3a42d5e "506070", len = 4}, params = {s = 0x0, len = 0}, headers = {s = 0x0,
                len = 0}, port_no = 5060, proto = 0, type = SIP_URI_T, 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}, u_name = {{s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}, {
                  s = 0x0, len = 0}, {s = 0x0, len = 0}}, u_val = {{s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}},
              u_params_no = 0}
            rt_info = 0x7fd863cc6038
            avp = <optimized out>
            avp_prefix = 0x0
            avp_index = <optimized out>
            parsed_whitelist = {s = 0x7fff82509f10 "C\216\005P", len = -2108645616}
            dst = 0x7fd863cc6088
            cdst = <optimized out>
            wl_list = 0x0
            prefix_len = 5
            rule_idx = 0
            wl_len = 8432
            username = {s = 0x7fd8e3a42d44 "441213433359 at 92.48.114.10:506070", len = 12}
            grp_id = 1
            i = <optimized out>
            j = <optimized out>
            n = <optimized out>
            val = {n = 1, s = {s = 0x7fd800000001 <Address 0x7fd800000001 out of bounds>, len = -475782928}}
            ruri = <optimized out>
            ret = -1
            tmp = <optimized out>
            ruri_buf = 0x7fd8e3a42d40 "sip:441213433359 at 92.48.114.10:506070"
            __FUNCTION__ = "do_routing"
    #3  0x00007fd8dffd1690 in do_routing_123 (msg=0x7fd8e3a420f0, grp=0x7fd8e3a11b28 "\001", param=<optimized out>, white_list=0x0) at drouting.c:956


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

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-07-30 10:00

Message:
Hi, this should be fixed by commit 9153 on trunk and 9154 on 1.8 branch.

Regards,
Bogdan

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

Comment By: Nicodemus ()
Date: 2012-07-25 15:18

Message:
I'm having the same issue as the OP. 

(gdb) bt
#0  0x00000000004882f3 in add_avp_last (flags=<value optimized out>,
name=<value optimized out>,
    val=...) at usr_avp.c:174
#1  0x00007f0f61f81733 in push_gw_for_usage (msg=<value optimized out>,
uri=0x762bc0,
    gw=0x7f0f5cffe358, c_id=0x7f0f5cffe858, c_attrs=0x7f0f5cffe880,
idx=<value optimized out>)
    at drouting.c:1186
#2  0x00007f0f61f8341d in do_routing (msg=<value optimized out>, drg=<value
optimized out>,
    flags=<value optimized out>, whitelist=<value optimized out>) at
drouting.c:1554
#3  0x00007f0f61f8513a in do_routing_123 (msg=0x7f0f6459a968, grp=<value
optimized out>,
    param=<value optimized out>, white_list=<value optimized out>) at
drouting.c:956
#4  0x0000000000413bf5 in do_action (a=0x7f0f64587e90, msg=0x7f0f6459a968)
at action.c:1478
#5  0x00000000004122ab in run_action_list (a=<value optimized out>,
msg=0x7f0f6459a968) at action.c:143
#6  0x0000000000459324 in eval_elem (e=0x7f0f64587f68, msg=0x7f0f6459a968,
val=0x4ce02464894cd824)
    at route.c:1438
#7  0x000000000045ab05 in eval_expr (e=0x7f0f5d0a0ecb, msg=0x7f0f6459a968,
val=0x0) at route.c:1783
#8  0x000000000045aa71 in eval_expr (e=0x7f0f64587fb8, msg=0x7f0f6459a968,
val=0x0) at route.c:1799
#9  0x000000000045aab9 in eval_expr (e=0x7f0f64588008, msg=0x7f0f6459a968,
val=0x0) at route.c:1804
#10 0x0000000000413f31 in do_action (a=0x7f0f645883d0, msg=0x7f0f6459a968)
at action.c:894
#11 0x00000000004122ab in run_action_list (a=<value optimized out>,
msg=0x7f0f6459a968) at action.c:143
#12 0x0000000000417a20 in run_actions (a=0x7f0f6457fd30,
msg=0x7f0f6459a968) at action.c:123
#13 run_top_route (a=0x7f0f6457fd30, msg=0x7f0f6459a968) at action.c:184
#14 0x000000000044c5b7 in receive_msg (buf=0x5059 <Address 0x5059 out of
bounds>, len=1370849264,
    rcv_info=0x5059) at receive.c:165
#15 0x0000000000487133 in udp_rcv_loop () at udp_server.c:424
#16 0x000000000042a0a9 in main_loop (argc=<value optimized out>,
argv=<value optimized out>)
    at main.c:749
#17 main (argc=<value optimized out>, argv=<value optimized out>) at
main.c:1520

(gdb) p *last_avp
$4 = {id = 0, flags = 2120, next = 0x7f0f619088e0, data = 0x7f0f5d0a0f28}
(gdb) p *(last_avp->next)
$5 = {id = 610044232, flags = 18640, next = 0x4ce02464894cd824, data =
0x2474894ce8246c89}
(gdb)

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

Comment By: Digipigeon (digipigeon)
Date: 2012-07-19 07:44

Message:
p last_avp
$1 = (struct usr_avp *) 0x7fd8832e7218

p *last_avp
$2 = {id = 11, flags = 2, next = 0x7fd88341d828, data = 0x7fd8832e7238}
$3 = {id = 11, flags = 2, next = 0x7fd88341d828, data = 0x7fd8832e7238}

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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-07-19 07:27

Message:
Hello,

Inside GDB, can you please do
    p *last_avp
and 
    p *(last_avp->next)

and paste here the output.

Regards,
Vlad

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3545466&group_id=232389



More information about the Devel mailing list