{"action":"created","issue":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/228","labels_url":"https://api.github.com/repos/kamailio/kamailio/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/kamailio/kamailio/issues/228/comments","events_url":"https://api.github.com/repos/kamailio/kamailio/issues/228/events","html_url":"https://github.com/kamailio/kamailio/issues/228","id":92686477,"number":228,"title":"kamcmd permissions.trustedReload crashes when using MySQL","user":{"login":"eschmidbauer","id":7139998,"avatar_url":"https://avatars.githubusercontent.com/u/7139998?v=3","gravatar_id":"","url":"https://api.github.com/users/eschmidbauer","html_url":"https://github.com/eschmidbauer","followers_url":"https://api.github.com/users/eschmidbauer/followers","following_url":"https://api.github.com/users/eschmidbauer/following{/other_user}","gists_url":"https://api.github.com/users/eschmidbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/eschmidbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschmidbauer/subscriptions","organizations_url":"https://api.github.com/users/eschmidbauer/orgs","repos_url":"https://api.github.com/users/eschmidbauer/repos","events_url":"https://api.github.com/users/eschmidbauer/events{/privacy}","received_events_url":"https://api.github.com/users/eschmidbauer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-02T17:08:40Z","updated_at":"2015-07-02T18:19:27Z","closed_at":null,"body":"When we reload trusted table and using MySQL as database, kamailio crashes.\r\nThis does not happen when using PostgreSQL\r\n\r\nWe only have one record in the database too:\r\nmysql> select * from trusted\\G\r\n*************************** 1. row ***************************\r\n          id: 1\r\n      src_ip: 192.168.110.152\r\n       proto: \r\nfrom_pattern: NULL\r\nruri_pattern: NULL\r\n         tag: fs02\r\n    priority: 0\r\n1 row in set (0.00 sec)\r\n"},"comment":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/comments/118115080","html_url":"https://github.com/kamailio/kamailio/issues/228#issuecomment-118115080","issue_url":"https://api.github.com/repos/kamailio/kamailio/issues/228","id":118115080,"user":{"login":"eschmidbauer","id":7139998,"avatar_url":"https://avatars.githubusercontent.com/u/7139998?v=3","gravatar_id":"","url":"https://api.github.com/users/eschmidbauer","html_url":"https://github.com/eschmidbauer","followers_url":"https://api.github.com/users/eschmidbauer/followers","following_url":"https://api.github.com/users/eschmidbauer/following{/other_user}","gists_url":"https://api.github.com/users/eschmidbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/eschmidbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschmidbauer/subscriptions","organizations_url":"https://api.github.com/users/eschmidbauer/orgs","repos_url":"https://api.github.com/users/eschmidbauer/repos","events_url":"https://api.github.com/users/eschmidbauer/events{/privacy}","received_events_url":"https://api.github.com/users/eschmidbauer/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T18:19:26Z","updated_at":"2015-07-02T18:19:26Z","body":"(gdb) bt full\r\n#0  0x00007f17e53d3832 in reload_trusted_table () at trusted.c:96\r\n        cols = {0x7f17e55e7800, 0x7f17e55e7810, 0x7f17e55e7820, 0x7f17e55e7830, 0x7f17e55e7840, 0x7f17e55e7850}\r\n        res = 0x7f17e8d9e530\r\n        row = 0x7f17e9898ea8\r\n        val = 0x1010\r\n        new_hash_table = 0xe6e6bd\r\n        old_hash_table = 0xbc90e5\r\n        i = 25\r\n        priority = -1161140908\r\n        pattern = 0x101e6b92634 <Address 0x101e6b92634 out of bounds>\r\n        ruri_pattern = 0x1030 <Address 0x1030 out of bounds>\r\n        tag = 0x6300e6e6d7 <Address 0x6300e6e6d7 out of bounds>\r\n        __FUNCTION__ = \"reload_trusted_table\"\r\n#1  0x00007f17e53d99d8 in reload_trusted_table_cmd () at trusted.c:610\r\n        __FUNCTION__ = \"reload_trusted_table_cmd\"\r\n#2  0x00007f17e53bfa06 in rpc_trusted_reload (rpc=0x7f17e60a0960, c=0x7ffcbaca6550) at mi.c:57\r\nNo locals.\r\n#3  0x00007f17e5e5ef51 in process_rpc_req (buf=0xe6e6b4 \"\\241\\003\\034\\nwg'\\221\\032permissions.trustedReload\", size=35, bytes_needed=0x7ffcbaca6734, sh=0x7ffcbaca66b0, saved_state=0xe7e6b8)\r\n    at binrpc_run.c:674\r\n        err = 0\r\n        val = {name = {s = 0x0, len = -380056976}, type = 1, u = {strval = {s = 0xe6e6bd \"permissions.trustedReload\", len = 25}, fval = 7.4763737817801413e-317, intval = 15132349, end = 15132349}}\r\n        rpc_e = 0x7f17e8d7ced8\r\n        f_ctx = {in = {ctx = {tlen = 28, cookie = 175597351, type = 0, flags = 1, offset = 28, in_struct = 0, in_array = 0}, s = 0xe6e6d7 \"\", end = 0xe6e6d7 \"\", record_no = 0, in_struct = 0}, out = {pkt = {\r\n              body = 0xd68b20 \"\\270\\224\\211\\351\\027\\177\", end = 0xd69b20 \"\", crt = 0xd68b20 \"\\270\\224\\211\\351\\027\\177\"}, structs = {next = 0x7ffcbaca65a0, prev = 0x7ffcbaca65a0}}, send_h = 0x7ffcbaca66b0, \r\n          method = 0xe6e6bd \"permissions.trustedReload\", gc = 0x0, replied = 0, err_code = 0, err_phrase = {s = 0x0, len = 0}}\r\n        ctx = 0x7ffcbaca6550\r\n        __FUNCTION__ = \"process_rpc_req\"\r\n#4  0x00007f17e5e8e942 in handle_stream_read (s_c=0xe6e680, idx=-1) at io_listener.c:511\r\n        bytes_free = 65535\r\n        bytes_read = 35\r\n        bytes_needed = 0\r\n        bytes_processed = 1\r\n        r = 0xe6e6a0\r\n        sh = {fd = 9, type = 0, from = {sa_in = {s = {sa_family = 26560, sa_data = \"Êº\\002\\000\\000\\000\\001\\000Êº\\374\\177\\000\"}, sin = {sin_family = 26560, sin_port = 47818, sin_addr = {s_addr = 2}, \r\n                sin_zero = \"\\001\\000Êº\\374\\177\\000\"}, sin6 = {sin6_family = 26560, sin6_port = 47818, sin6_flowinfo = 2, sin6_addr = {__in6_u = {\r\n                    __u6_addr8 = \"\\001\\000Êº\\374\\177\\000\\000\\020tÊº\\374\\177\\000\", __u6_addr16 = {1, 47818, 32764, 0, 29712, 47818, 32764, 0}, __u6_addr32 = {3133800449, 32764, 3133830160, 32764}}}, \r\n                sin6_scope_id = 8}}, sa_un = {sun_family = 26560, \r\n              sun_path = \"Êº\\002\\000\\000\\000\\001\\000Êº\\374\\177\\000\\000\\020tÊº\\374\\177\\000\\000\\b\\000\\000\\000\\000\\000\\000\\000\\001\\000\\000\\000\\000\\000\\000\\000 \\206\\026\\336\\027\\177\\000\\000\\253\\\\\\000\\000\\000\\000\\000\\000\\b\\276p\\000\\000\\000\\000\\000\\000\\004\\000\\000\\000\\000\\000\\000PgÊº\\001\\000\\000\\000 \\206\\026\\336\\027\\177\\000\\000PgÊº\\374\\177\\000\\000k\\346\\347\\345\\027\\177\\000\\000\\000\\000\\000\\000\\000\"}}, from_len = 0}\r\n        __FUNCTION__ = \"handle_stream_read\"\r\n#5  0x00007f17e5e90134 in handle_io (fm=0x7f17e8d7f7c0, events=1, idx=-1) at io_listener.c:706\r\n        ret = 1\r\n        __FUNCTION__ = \"handle_io\"\r\n#6  0x00007f17e5e88214 in io_wait_loop_epoll (h=0x7f17e60a1720, t=10, repeat=0) at ../../io_wait.h:1061\r\n        n = 1\r\n        r = 0\r\n        fm = 0x7f17e8d7f7c0\r\n        revents = 1\r\n        __FUNCTION__ = \"io_wait_loop_epoll\"\r\n#7  0x00007f17e5e8bdbc in io_listen_loop (fd_no=1, cs_lst=0xbc91b0) at io_listener.c:281\r\n        max_fd_no = 176\r\n        poll_err = 0x0\r\n        poll_method = 2\r\n        cs = 0x0\r\n        type = 2\r\n        __FUNCTION__ = \"io_listen_loop\"\r\n#8  0x00007f17e5e67406 in mod_child (rank=0) at ctl.c:320\r\n        pid = 0\r\n        cs = 0x7f17e9cc0c02\r\n        rpc_handler = 1\r\n        __FUNCTION__ = \"mod_child\"\r\n#9  0x00000000005a0317 in init_mod_child (m=0x7f17e8d3e4a8, rank=0) at sr_module.c:898\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#10 0x00000000005a0040 in init_mod_child (m=0x7f17e8d3e990, rank=0) at sr_module.c:895\r\n---Type <return> to continue, or q <return> to quit--- \r\n        __FUNCTION__ = \"init_mod_child\"\r\n#11 0x00000000005a0040 in init_mod_child (m=0x7f17e8d3ff18, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#12 0x00000000005a0040 in init_mod_child (m=0x7f17e8d40428, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#13 0x00000000005a0040 in init_mod_child (m=0x7f17e8d40778, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#14 0x00000000005a0040 in init_mod_child (m=0x7f17e8d40cf8, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#15 0x00000000005a0040 in init_mod_child (m=0x7f17e8d41080, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#16 0x00000000005a0040 in init_mod_child (m=0x7f17e8d416b0, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#17 0x00000000005a0040 in init_mod_child (m=0x7f17e8d41d18, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#18 0x00000000005a0040 in init_mod_child (m=0x7f17e8d42860, rank=0) at sr_module.c:895\r\n        __FUNCTION__ = \"init_mod_child\"\r\n#19 0x00000000005a0640 in init_child (rank=0) at sr_module.c:924\r\nNo locals.\r\n#20 0x00000000004ae61a in main_loop () at main.c:1650\r\n        i = 4\r\n        pid = 23721\r\n        si = 0x0\r\n        si_desc = \"udp receiver child=3 sock=185.71.5.63:5060\\000\\000\\000\\000\\000\\000\\b\\276p\\000\\000\\000\\000\\000\\020tÊº\\374\\177\", '\\000' <repeats 18 times>, \"0sÊº\\374\\177\\000\\000\\310\\001V\\351\\027\\177\\000\\000\\060\\000\\000\\000\\060\\000\\000\\000x\\333\\326\\350\\027\\177\\000\\000\\060qÊº\\374\\177\\000\\000\\000\\000\\000\\000\\001\\000\\000\"\r\n        nrprocs = 4\r\n        __FUNCTION__ = \"main_loop\"\r\n#21 0x00000000004b4065 in main (argc=13, argv=0x7ffcbaca7418) at main.c:2533\r\n        cfg_stream = 0xb50010\r\n        c = -1\r\n        r = 0\r\n        tmp = 0x7ffcbaca8f5a \"\"\r\n        tmp_len = 0\r\n        port = 0\r\n        proto = 0\r\n        options = 0x7199c8 \":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:\"\r\n        ret = -1\r\n        seed = 882959712\r\n        rfd = 4\r\n        debug_save = 0\r\n        debug_flag = 0\r\n        dont_fork_cnt = 0\r\n        n_lst = 0x7ffcbaca731e\r\n        p = 0x5657f0 \"s\"\r\n        __FUNCTION__ = \"main\"\r\n(gdb) \r\n(gdb) \r\n"}}