[OpenSIPS-Users] Segfault on mi reload_routes

Mark Farmer farmorg at gmail.com
Wed Sep 25 11:29:09 EDT 2019


OK, I figured out my mistake with gdb so I now have a 'bt full' output of
the core dump:

GNU gdb (Ubuntu 8.1-0ubuntu3.1) 8.1.0.20180409-git
Copyright (C) 2018 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/sbin/opensips...done.
[New LWP 12152]
[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/local/sbin/opensips -P
/var/run/opensips/opensips.pid -m 128 -M 4 -u opens'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
No locals.
#1  0x0000562dc721ae56 in resolvehost (name=0x706475 <error: Cannot access
memory at address 0x706475>, no_ip_test=0) at resolve.c:464
        he = 0x0
        start = {tv_sec = 139802802612144, tv_usec = 0}
        ip = 0x0
        s = {s = 0x706475 <error: Cannot access memory at address
0x706475>, len = -2013680896}
#2  0x0000562dc71e477a in fix_actions (a=0x7f266dc3d1e0) at route.c:1320
        t = 0x7f266dc3de38
        ret = 0
        cmd = 0x7f2660636740 <cmds+480>
        acmd = 0xc51aa61587f9ab00
        he = 0x562dc718c990 <_start>
        ip = {af = 1417257328, len = 32764, u = {addrl = {139803026513288,
1841548528}, addr32 = {1841028488, 32550, 1841548528, 0}, addr16 = {56712,
28091, 32550, 0, 52464, 28099, 0, 0},
            addr = "\210ݻm&\177\000\000\360\314\303m\000\000\000"}}
        si = 0x7ffc5479a970
        host = {s = 0x7ffc5479a970 "\017", len = 0}
        proto = 0
        port = 32
        p = 0x562dc718c990 <_start>
        blh = 0x7f266dbda998
        i = 0
        s = {s = 0x7f266dc3d9d8 "CUSTOM_LOG: Rewriting host:port", len = 31}
        model = 0x7f266dc4b8e0
        models = {0x2f74, 0x562dc718c990 <_start>, 0x7ffc5479a170,
0x562dc71e2df5 <fix_expr+253>, 0x7f2660418f38 <cmds+184>}
        sp = 0x0
        xlp = 0x2f74
        ev_id = 32550
        __FUNCTION__ = "fix_actions"
#3  0x0000562dc71e3edd in fix_actions (a=0x7f266dc40c48) at route.c:1227
        t = 0x7f266dc40c48
        ret = 0
        cmd = 0x7f2660418e80 <cmds>
        acmd = 0xc51aa61587f9ab00
        he = 0x562dc718c990 <_start>
        ip = {af = 1417257632, len = 32764, u = {addrl = {139803026515496,
1841545040}, addr32 = {1841030696, 32550, 1841545040, 0}, addr16 = {58920,
28091, 32550, 0, 48976, 28099, 0, 0},
            addr = "(\346\273m&\177\000\000P\277\303m\000\000\000"}}
        si = 0x7ffc5479a970
        host = {s = 0x7ffc5479a970 "\017", len = 0}
        proto = 0
        port = 32
        p = 0x562dc718c990 <_start>
        blh = 0x7f266dbda620
        i = 0
        s = {s = 0x7f266dc3c740 "CUSTOM_LOG: Engaging rtpengine_offer with
flags: $var(rtpflags)", len = 63}
        model = 0x0
        models = {0x2f74, 0x562dc718c990 <_start>, 0x7ffc5479a2a0,
0x562dc71e2df5 <fix_expr+253>, 0x7f2660418f38 <cmds+184>}
        sp = 0x0
        xlp = 0x2f74
        ev_id = 32550
        __FUNCTION__ = "fix_actions"
#4  0x0000562dc71e3f31 in fix_actions (a=0x7f266dc40d70) at route.c:1231
        t = 0x7f266dc40d70
        ret = 0
        cmd = 0x7f2660418e80 <cmds>
        acmd = 0xc51aa61587f9ab00
        he = 0x562dc71e3127 <fix_expr+1071>
        ip = {af = 1417257936, len = 32764, u = {addrl = {139803026518464,
1841510768}, addr32 = {1841033664, 32550, 1841510768, 0}, addr16 = {61888,
28091, 32550, 0, 14704, 28099, 0, 0},
            addr = "\300\361\273m&\177\000\000p9\303m\000\000\000"}}
        si = 0x0
        host = {s = 0x7ffc5479a970 "\017", len = 0}
        proto = 0
        port = 1417259376
        p = 0x562dc718c990 <_start>
        blh = 0x7ffc5479a970
        i = 0
        s = {s = 0x7f266dc3ba38 "CUSTOM_LOG: Engaging rtpengine_offer with
flags: $var(rtpflags)", len = 63}
        model = 0x0
        models = {0x2f74, 0x562dc718c990 <_start>, 0x7ffc5479a3d0,
0x562dc71e2df5 <fix_expr+253>, 0x7f266577cf98 <cmds+1240>}
        sp = 0x0
        xlp = 0x7ffc5479a350
        ev_id = -988109291
        __FUNCTION__ = "fix_actions"
#5  0x0000562dc71e3f31 in fix_actions (a=0x7f266dc378c8) at route.c:1231
        t = 0x7f266dc40e98
        ret = 0
        cmd = 0x7f266577cf70 <cmds+1200>
        acmd = 0x1
        he = 0xc51aa61587f9ab00
        ip = {af = 12148, len = 0, u = {addrl = {140721725744416,
94754613807504}, addr32 = {1417258272, 32764, 3340290448, 22061}, addr16 =
{42272, 21625, 32764, 0, 51600, 50968, 22061, 0},
            addr = " \245yT\374\177\000\000\220\311\030\307-V\000"}}
        si = 0x562dc73564d0 <__FUNCTION__.10125>
        host = {s = 0x7ffc5479a970 "\017", len = 0}
        proto = 0
        port = 0
        p = 0x7f266f207740
        blh = 0x0
        i = 0
        s = {s = 0x7f266dc33630 "CUSTOM_LOG: Checking for Media Services
Routing...", len = 50}
        model = 0x0
        models = {0x0, 0x7ffc5479a550, 0x0, 0x7ffc5479af23, 0x2f74}
        sp = 0x0
        xlp = 0x7ffc5479a970
        ev_id = 0
        __FUNCTION__ = "fix_actions"
#6  0x0000562dc71e68a8 in fix_rls () at route.c:1767
        i = 4
        ret = 0
#7  0x0000562dc724659b in reload_routing_script () at cfg_reload.c:508
        sr = 0x7f266dc21428
        sr_bk = 0x0
        curr_wdir = 0x0
        cfg_buf = {
          s = 0x562dc8c83e40 "__OSSPP_FILEBEGIN__
\"/usr/local/etc/opensips/opensips.cfg\"\n__OSSPP_LINE__
1\n#\n__OSSPP_LINE__ 2\n# OpenSIPS residential configuration
script\n__OSSPP_LINE__ 3\n#     by OpenSIPS Solutions <team at opensips-s"...,
len = 43994}
        cnt_sleep = 1854342416
        ret = 0
        __FUNCTION__ = "reload_routing_script"
#8  0x0000562dc72d41e6 in w_reload_routes (params=0x7ffc5479a600,
async_hdl=0x0) at mi/mi_core.c:762
No locals.
#9  0x0000562dc72d0e9c in handle_mi_request (req=0x7ffc5479a6e0,
cmd=0x7f266dbf2ea8, async_hdl=0x0) at mi/mi.c:407
        resp = 0x7f266dbcf3a0
        cmd_recipe = 0x562dc75c2bc0 <mi_core_cmds+18272>
        cmd_params = {item = 0x0, list = 0x562dc75c2bc8
<mi_core_cmds+18280>}
        is_ambiguous = 0
        pos_params = 0
        __FUNCTION__ = "handle_mi_request"
#10 0x00007f2664cdc3bf in mi_fifo_server (fifo_stream=0x562dc8c04670) at
fifo_fnc.c:757
        parse_end = 0x0
        request = {req_obj = 0x562dc8c21700, id = 0x562dc8c21660, method =
0x562dc8c21610, params = 0x0, invalid = 0}
        read_len = 100
        parse_len = 0
        req_method = 0x562dc8c5f590 "reload_routes"
        file_sep = 0x7f266dc20409 ":{\"jsonrpc\": \"2.0\", \"id\":
\"13372\", \"method\": \"reload_routes\", \"params\": {}}"
        file = 0x7f266dbcf3a0 "/tmp/opensips_fifo_reply_4224"
        p = 0x7f266dc2040a "{\"jsonrpc\": \"2.0\", \"id\": \"13372\",
\"method\": \"reload_routes\", \"params\": {}}"
        cmd = 0x7f266dbf2ea8
        reply_stream = 0x562dc8c1ada0
        remain_len = 0
        hdl = 0x0
        response = 0x562dc8c6f0c0
        rc = 0
        buf = {s = 0x7f266dc203f0 ":opensips_fifo_reply_4224:{\"jsonrpc\":
\"2.0\", \"id\": \"13372\", \"method\": \"reload_routes\", \"params\":
{}}", len = 4096}
        __FUNCTION__ = "mi_fifo_server"
#11 0x00007f2664cd7d89 in fifo_process (rank=0) at mi_fifo.c:223
        fifo_stream = 0x562dc8c04670
        __FUNCTION__ = "fifo_process"
#12 0x0000562dc722f8d6 in start_module_procs () at sr_module.c:853
        m = 0x7f266dbacc10
        n = 0
        l = 0
        x = 0
        __FUNCTION__ = "start_module_procs"
#13 0x0000562dc72287d6 in main_loop () at main.c:774
        chd_rank = 0
        startup_done = 0x0
        last_check = 0
        rc = 1001
        __FUNCTION__ = "main_loop"
#14 0x0000562dc722be12 in main (argc=15, argv=0x7ffc5479a978) at main.c:1480
        cfg_log_stderr = 1
        c = -1
        r = 0
        tmp = 0x7ffc5479af07 ""
        tmp_len = 9
        port = 0
        proto = 1862227552
        protos_no = 1
        options = 0x562dc734bb98
"f:cCm:M:b:l:n:N:rRvdDFEVhw:t:u:g:p:P:G:W:o:a:k:s:"
        ret = -1
        seed = 2480117594
        rfd = 3
        __FUNCTION__ = "main"
(gdb)


On Wed, 25 Sep 2019 at 15:05, Mark Farmer <farmorg at gmail.com> wrote:

> To add a bit more, I've enabled core dumps but I've not been able to see
> anything useful:
>
> (gdb) core-file /var/log/opensips/core.12152
> [New LWP 12152]
> Core was generated by `/usr/local/sbin/opensips -P
> /var/run/opensips/opensips.pid -m 128 -M 4 -u opens'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00007f266e894646 in ?? ()
> (gdb) bt full
> #0  0x00007f266e894646 in ?? ()
> No symbol table info available.
> #1  0x0000562dc721ae56 in ?? ()
> No symbol table info available.
> #2  0x000000006dc3d9f7 in ?? ()
> No symbol table info available.
> #3  0x0000000000706475 in ?? ()
> No symbol table info available.
> #4  0x0000000000000000 in ?? ()
> No symbol table info available.
>
> I also 'upgraded' to a git clone so now running latest code.
>
>
> On Wed, 25 Sep 2019 at 13:33, Mark Farmer <farmorg at gmail.com> wrote:
>
>> Hi all
>>
>> I've seen reports of this elsewhere but didn't find a solution. When I
>> use opensips-cli to do a 'mi reload_routes' OpenSIPS segfaults.
>>
>> I did a git pull and install clean yesterday on opensips-cli.
>>
>> opensips -V
>> version: opensips 3.0.0 (x86_64/linux)
>> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
>> Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, CC_O0, FAST_LOCK-ADAPTIVE_WAIT
>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
>> MAX_URI_SIZE 1024, BUF_SIZE 65535
>> poll method support: poll, epoll, sigio_rt, select.
>> git revision: 435890a06
>> main.c compiled on 13:19:25 Jun 21 2019 with gcc 7
>>
>> Oddly, it doesn't seem to matter what is in the last line, it errors
>> regardless but this is the part of the route that seems to trigger it:
>>
>> else if (isflagset(Voicemail)) {
>>                 $var(rtpflags) ="replace-session-connection
>> replace-origin trust-address force symmetric in-face=external
>> out-face=internal";
>>                 xlog("CUSTOM_LOG: Call goes to Voicemail service - Route
>> to Asterisk.");
>>                 xlog("CUSTOM_LOG: Engaging rtpengine_offer with flags:
>> $var(rtpflags)");
>>                 rtpengine_offer($var(rtpflags));
>>                 xlog("CUSTOM_LOG: Rewriting host:port");
>>                 rewritehostport("10.150.50.53:5060");
>>                 force_send_socket(udp:10.150.50.51);
>>                 return(1);
>>
>> opensips-cli -d -x mi reload_routes
>> DEBUG: using config file /etc/opensips-cli.cfg
>> DEBUG: Loaded module 'database'
>> DEBUG: Loaded module 'diagnose'
>> DEBUG: Loaded module 'instance'
>> DEBUG: Loaded module 'mi'
>> DEBUG: sent command ':opensips_fifo_reply_23259:{"jsonrpc": "2.0", "id":
>> "16512", "method": "which", "params": []}'
>> DEBUG: Loaded module 'tls'
>> DEBUG: Loaded module 'trace'
>> DEBUG: Skipping module 'trap' - excluded on purpose
>> DEBUG: Loaded module 'user'
>> DEBUG: running in non-interactive mode '['mi', 'reload_routes']'
>> DEBUG: running command 'reload_routes' '[]'
>> DEBUG: named parameters are used
>> DEBUG: running command 'reload_routes' '{}'
>> DEBUG: sent command ':opensips_fifo_reply_20789:{"jsonrpc": "2.0", "id":
>> "10120", "method": "reload_routes", "params": {}}'
>> ERROR: communication exception for 'reload_routes' returned:
>> ERROR: Is OpenSIPS running?
>>
>> DBG:core:decode_mime_type: Decoding MIME type for:[application/sdp]
>> DBG:core:fix_actions: fixing t_on_reply,
>> /usr/local/etc/opensips/opensips.cfg:735
>> DBG:core:fix_actions: fixing is_registered,
>> /usr/local/etc/opensips/opensips.cfg:749
>> DBG:core:fix_actions: fixing is_registered,
>> /usr/local/etc/opensips/opensips.cfg:749
>> DBG:core:fix_actions: fixing insert_hf,
>> /usr/local/etc/opensips/opensips.cfg:751
>> DBG:core:fix_actions: fixing lookup,
>> /usr/local/etc/opensips/opensips.cfg:753
>> DBG:core:fix_actions: fixing is_from_gw,
>> /usr/local/etc/opensips/opensips.cfg:753
>> DBG:core:fix_actions: fixing rtpengine_offer,
>> /usr/local/etc/opensips/opensips.cfg:768
>> DBG:core:fix_actions: fixing do_routing,
>> /usr/local/etc/opensips/opensips.cfg:769
>> DBG:core:fix_actions: fixing rtpengine_offer,
>> /usr/local/etc/opensips/opensips.cfg:774
>> DBG:core:fix_actions: fixing do_routing,
>> /usr/local/etc/opensips/opensips.cfg:775
>> DBG:core:fix_actions: fixing rtpengine_offer,
>> /usr/local/etc/opensips/opensips.cfg:780
>> CRITICAL:core:sig_usr: segfault in process pid: 30907, id: 2
>> DBG:core:restore_segv_handler: restoring SIGSEGV handler...
>> DBG:core:restore_segv_handler: successfully restored system SIGSEGV
>> handler
>> DBG:core:handle_sigs: OpenSIPS exit status = 139
>> INFO:core:handle_sigs: child process 30907 exited by a signal 11
>> INFO:core:handle_sigs: core was generated
>> INFO:core:handle_sigs: terminating due to SIGCHLD
>>
>>
>> Thanks and regards
>> Mark.
>>
>>
>
> --
> Mark Farmer
> farmorg at gmail.com
>


-- 
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190925/3f99fc1a/attachment-0001.html>


More information about the Users mailing list