Hi dears When the below format from restful is sent, kamailio crashes
List List List (Json with 3 lists), With 2 lists it works properly, When diameter is translated to json with 3 lists by this module it also works properly, Json format is correct too.
Where is problem? Thanks
Closed #1686.
Reopened #1686.
Can you reproduce and get a core dump from the crash? Only with these logs is hard to discover what is wrong and reproducing by others might be hard (at least for me).
You have to run kamailio as root and do `ulimit -c unlimited` before starting kamailio. Then reproduce the issue and a core file should be generated -- take the backtrace from it with gdb tool.
Can you reproduce and get a core dump from the crash? Only with these logs is hard to discover what is wrong and reproducing by others might be hard (at least for me).
You have to run kamailio as root and do `ulimit -c unlimited` before starting kamailio. Then reproduce the issue and a core file should be generated -- take the backtrace from it with gdb tool.
gdb /usr/local/sbin/kamailio /home/corefiles/core.kamailio.sig11.1974 GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1 Copyright (C) 2014 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/kamailio...done. [New LWP 1974] [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/kamailio -f usr/local/etc/kamailio/kamailio.cfg -P /var/run/kam'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f5e23c4a11e in diameterserver_add_avp (m=0x0, d=0x7f5e1b5c2240 "", len=12, avp_code=431, flags=64, vendorid=0, data_do=2, func=0x7f5e23c51d6c <__FUNCTION__.20148> "parselist") at avp_helper.c:208 208 if (cdpb.AAAAddAVPToMessage(m, avp, m->avpList.tail) != AAA_ERR_SUCCESS) { (gdb) bt full #0 0x00007f5e23c4a11e in diameterserver_add_avp (m=0x0, d=0x7f5e1b5c2240 "", len=12, avp_code=431, flags=64, vendorid=0, data_do=2, func=0x7f5e23c51d6c <__FUNCTION__.20148> "parselist") at avp_helper.c:208 avp = 0x7f5e1b5c3bd0 __FUNCTION__ = "diameterserver_add_avp" #1 0x00007f5e23c4d0c8 in parselist (response=0x0, list=0x7fff9f21a8d0, item=0x11b67d0, level=2) at avp_helper.c:309 i = 1 flags = 64 x = "p\250!\237" avp_list = {head = 0x0, tail = 0x0} avp_list_s = {s = 0x7f5e1b5c2240 "", len = 12} __FUNCTION__ = "parselist" #2 0x00007f5e23c4cffc in parselist (response=0x7f5e1b5c3ab8, list=0x0, item=0x11b6550, level=1) at avp_helper.c:304 subitem = 0x11b67d0 i = 0 flags = 64 x = "\000\000\000" avp_list = {head = 0x0, tail = 0x0} avp_list_s = {s = 0x7fff9f21a8f0 "@\251!\237\377\177", len = 600070897} __FUNCTION__ = "parselist" #3 0x00007f5e23c4db3a in addAVPsfromJSON (response=0x7f5e1b5c3ab8, json=0x7f5e23e53950 <responsejson>) at avp_helper.c:349 subitem = 0x11b6550 i = 4 __FUNCTION__ = "addAVPsfromJSON" root = 0x11b4210 #4 0x00007f5e23c3fbdb in callback_cdp_request (request_in=0x7f5e1b5c19b0, param=0x0) at ims_diameter_server.c:193 fmsg = 0xab7840 <_faked_msg> backup_rt = 1 ctx = {rec_lev = 0, run_flags = 0, last_retcode = 1, jmp_env = {{__jmpbuf = {1, -5713032302318786866, 7971288, 7971288, 140042162528420, 0, -5713032302339758386, 5712822384154044110}, __mask_was_saved = 0, __saved_mask = {__val = { 140735863172072, 127, 0, 140042162532340, 140042389578761, 4222451713, 140042162532340, 140042162532340, 140042162532340, 140042162532340, 140042162532358, 140042162532467, 140042162532340, 140042162532467, 0, 0}}}}} response = 0x7f5e1b5c3ab8 __FUNCTION__ = "callback_cdp_request" #5 0x00007f5e24a705c0 in api_callback (p=0x7f5e1b598f50, msg=0x7f5e1b5c19b0, ptr=0x0) at api_process.c:83 t = 0x7f5e1b598f50 auto_drop = 32767 h = 0x7f5e1b5b3358 ---Type <return> to continue, or q <return> to quit---
thanks
I just pushed a simple safety check to avoid the crash.
I see @dunst0 has done a different commit in a personal git repo clone, likely trying to fix the behaviour in this case -- maybe he is going to make a pull request soon.
Thank you very much @miconda and @dunst0,It solved
Closed #1686.