[sr-dev] [kamailio] jsonrpc-c notification does not free shm memory (#296)

zxcpoiu notifications at github.com
Wed Aug 26 08:54:09 CEST 2015


I'm afraid that core files has been deleted.
Anyway, after test your patch, it seems there are still have issues.

#### So, let's from the ground up again:

I will attach **two** back trace below,
one is crashed **BEFORE your patch** that I reproduced, the other one is crashed **AFTER your patch**

both tested under `kamailio-4.3.1 stable` with only recompiled `jsonrpc-c.so`
if you need any further info,  just let me know which corefiles and the gdb command.

I will keep corefiles this time : )

#### bt_BEFORE_patch.corefile

```
#0  0x00007fdc4c1e03bf in json_tokener_parse_ex () from /lib/x86_64-linux-gnu/libjson.so.0
No symbol table info available.
#1  0x00007fdc4c1e1da6 in json_tokener_parse_verbose () from /lib/x86_64-linux-gnu/libjson.so.0
No symbol table info available.
#2  0x00007fdc4c1e1dfe in json_tokener_parse () from /lib/x86_64-linux-gnu/libjson.so.0
No symbol table info available.
#3  0x00007fdc4c3eae1a in cmd_pipe_cb (fd=6, event=2, arg=0x7ffff51d9750) at jsonrpc_io.c:152
        cmd = 0x7fdc71690608
        __FUNCTION__ = "cmd_pipe_cb"
        params = 0x15d4bf0
        payload = 0x2ea971e6
        req = 0x1c3115d
        json = 0x7ffff51d95f0 "\200M]\001"
        ns = 0x7fdc73cce438 "201:{ \"jsonrpc\": \"2.0\", \"method\": \"last_reg\", \"params\": { \"user\": \"5978002\", \"data\": [ \"1440567940\", \"5978002\", \"<sip:5978002 at 38.106.57.69:5060>;transport=TCP\", \"SIPp\\/Linux\", \"tcp:38.106.57.68:5003\" "...
        bytes = 140737305744928
        g = 0x7fdc4bfa22f8
        sent = 0
#4  0x00007fdc4bfa5254 in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#5  0x00007fdc4c3ea5ef in jsonrpc_io_child_process (cmd_pipe=6, _servers=0x7fdc738b16e8 "10.1.4.3:5013,3 10.1.4.1:5013,2 10.1.4.2:5013,1") at jsonrpc_io.c:93
        __FUNCTION__ = "jsonrpc_io_child_process"
        pipe_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x15cdf10}, ev_next = {tqe_next = 0x7fdc73cce1f8, tqe_prev = 0x15d4d50}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0x0}, min_heap_idx = -1}, ev_fd = 6, ev_base = 0x15d4bf0, _ev = {ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x15d5120}, ev_timeout = {tv_sec = 0,
                tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x15d5120}, ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 18, ev_res = 2, ev_flags = 130, ev_pri = 0 '\000',
          ev_closure = 2 '\002', ev_timeout = {tv_sec = 140733193388081, tv_usec = 8407324624}, ev_callback = 0x7fdc4c3eaaa7 <cmd_pipe_cb+8>, ev_arg = 0x7ffff51d9750}
#6  0x00007fdc4c3f350b in child_init (rank=0) at jsonrpc_mod.c:130
        pid = 0
#7  0x0000000000596a41 in init_mod_child (m=0x7fdc738a7db8, rank=0) at sr_module.c:898
        __FUNCTION__ = "init_mod_child"
#8  0x0000000000596779 in init_mod_child (m=0x7fdc738a8110, rank=0) at sr_module.c:895
        __FUNCTION__ = "init_mod_child"
#9  0x0000000000596d55 in init_child (rank=0) at sr_module.c:924
No locals.
#10 0x00000000004aafd3 in main_loop () at main.c:1650
        i = 24
        pid = 106880
        si = 0x0
        si_desc = "udp receiver child=23 sock=38.106.57.68:5003\000\000\000\000~/q\000\001\000\000\000\260TkQ\334\177\000\000\000\232\035\365\377\177\000\000\032\264N\000\000\000\000\000P\232\035\365\377\177\000\000\270:\312s\334\177\000\000\310K\270Q\334\177\000\000\260TkQ\334\177\000\000N\354\070p\000\000\000\000\260\210A\000\001\000\000"
        nrprocs = 24
        __FUNCTION__ = "main_loop"
#11 0x00000000004b0b5b in main (argc=13, argv=0x7ffff51d9cc8) at main.c:2533
        cfg_stream = 0x152e010
        c = -1
        r = 0
        tmp = 0x7ffff51db7c1 ""
        tmp_len = 32732
        port = -1809602704
        proto = 0
        options = 0x707db8 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
        ret = -1
        seed = 1532920115
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0x76
        p = 0x7ffff51d9bce ""
        __FUNCTION__ = "main"
quit
```

#### bt_AFTER_patch.corefile

```
#0  0x00007fe61e702165 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007fe61e7053e0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x0000000000620cc2 in fm_free (qm=0x7fe5dc50a000, p=0x112dca4002a, file=0x7fe5d7254d6e "jsonrpc-c: jsonrpc_io.c", func=0x7fe5d725710c "free_pipe_cmd", line=551) at mem/f_malloc.c:564
        f = 0x7fe5dca4a198
        __FUNCTION__ = "fm_free"
#3  0x00007fe5d724f9ea in free_pipe_cmd (cmd=0x7fe5dca4a1d0) at jsonrpc_io.c:551
        __FUNCTION__ = "free_pipe_cmd"
#4  0x00007fe5d72499d1 in cmd_pipe_cb (fd=6, event=2, arg=0x7fff85af5370) at jsonrpc_io.c:241
        cmd = 0x7fe5dca4a1d0
        __FUNCTION__ = "cmd_pipe_cb"
        params = 0x2328a40
        payload = 0x23285b0
        req = 0x0
        json = 0x2329170 ""
        ns = 0x7fe5feb2b438 "201:{ \"jsonrpc\": \"2.0\", \"method\": \"last_reg\", \"params\": { \"user\": \"5978002\", \"data\": [ \"1440568494\", \"5978002\", \"<sip:5978002 at 38.106.57.69:5060>;transport=TCP\", \"SIPp\\/Linux\", \"tcp:38.106.57.68:5003\" "...
        bytes = 206
        g = 0x7fe5feac9a98
        sent = 1
#5  0x00007fe5d6e02254 in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#6  0x00007fe5d72475e7 in jsonrpc_io_child_process (cmd_pipe=6, _servers=0x7fe5fe70e6e8 "10.1.4.3:5013,3 10.1.4.1:5013,2 10.1.4.2:5013,1") at jsonrpc_io.c:91
        __FUNCTION__ = "jsonrpc_io_child_process"
        pipe_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x2320f10}, ev_next = {tqe_next = 0x7fe5feb2b1f8, tqe_prev = 0x2327d50}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0x0}, min_heap_idx = -1}, ev_fd = 6, ev_base = 0x2327bf0, _ev = {ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x2328120}, ev_timeout = {tv_sec = 0,
                tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x2328120}, ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 18, ev_res = 2, ev_flags = 130, ev_pri = 0 '\000',
          ev_closure = 2 '\002', ev_timeout = {tv_sec = 140733193388081, tv_usec = 6537827312}, ev_callback = 0x7fe5d7247a9f <cmd_pipe_cb>, ev_arg = 0x7fff85af5370}
#7  0x00007fe5d7250547 in child_init (rank=0) at jsonrpc_mod.c:135
        pid = 0
#8  0x0000000000596a41 in init_mod_child (m=0x7fe5fe704db8, rank=0) at sr_module.c:898
        __FUNCTION__ = "init_mod_child"
#9  0x0000000000596779 in init_mod_child (m=0x7fe5fe705110, rank=0) at sr_module.c:895
        __FUNCTION__ = "init_mod_child"
#10 0x0000000000596d55 in init_child (rank=0) at sr_module.c:924
No locals.
#11 0x00000000004aafd3 in main_loop () at main.c:1650
        i = 24
        pid = 108881
        si = 0x0
        si_desc = "udp receiver child=23 sock=38.106.57.68:5003\000\000\000\000~/q\000\001\000\000\000\260$Q\334\345\177\000\000 V\257\205\377\177\000\000\032\264N\000\000\000\000\000pV\257\205\377\177\000\000\270\n\260\376\345\177\000\000\310\033\236\334\345\177\000\000\260$Q\334\345\177\000\000ZI\301\026\000\000\000\000\260\210A\000\001\000\000"
        nrprocs = 24
        __FUNCTION__ = "main_loop"
#12 0x00000000004b0b5b in main (argc=13, argv=0x7fff85af58e8) at main.c:2533
        cfg_stream = 0x2281010
        c = -1
        r = 0
        tmp = 0x7fff85af77c1 ""
        tmp_len = 32742
        port = 520714096
        proto = 0
        options = 0x707db8 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
        ret = -1
        seed = 1048170556
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0x76
        p = 0x7fff85af57ee ""
        __FUNCTION__ = "main"
quit
```









---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/296#issuecomment-134866858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150825/cf21cf80/attachment-0001.html>


More information about the sr-dev mailing list