Repeated use of http_request cause a crash related to the storage of the result in a PV.
Will upload backtraces and other info to this issue. If anyone else have seen this please add info to this bug report.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400
Is it latest 4.3 or master? There were couple of fixes in September, iirc.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-157664803
Backtrace from the curl module in dev. Looks similar with the http_request in 4.3
#0 0x00007fabdd0a20d5 in raise () from /lib/x86_64-linux-gnu/libc.so.6 No symbol table info available. #1 0x00007fabdd0a583b in abort () from /lib/x86_64-linux-gnu/libc.so.6 No symbol table info available. #2 0x0000000000632ad0 in qm_debug_frag (qm=0x7fabdc86b010, f=0x7fabdc93cf78) at mem/q_malloc.c:142 __FUNCTION__ = "qm_debug_frag" #3 0x0000000000634069 in qm_malloc (qm=0x7fabdc86b010, size=296, file=0x7fabdc65ce70 "pv: pv_svar.c", func=0x7fabdc65d01d "set_var_value", line=128) at mem/q_malloc.c:369 f = 0x7fabdc93cf78 hash = 168 list_cntr = 1 __FUNCTION__ = "qm_malloc" #4 0x00007fabdc61483b in set_var_value (var=0x7fabdc942658, value=0x7ffd762e8070, flags=1) at pv_svar.c:128 __FUNCTION__ = "set_var_value" #5 0x00007fabdc5fbfa8 in pv_set_scriptvar (msg=0x7fabdc8a9048, param=0x7fabdc939d18, op=254, val=0x7ffd762e8150) at pv_core.c:1988 avp_val = {n = -594293216, s = { s = 0x7fabdc93ce20 "{"status":"OK","uid":"device.john.smith","dom":"example.com","pwd":"7ymu0mAJ","recfile":"20151103144733822~0313809101~unspecified~example.com~john.smith","recdir":"example.com/2015/11/03","rec":true,"..., len = 295}, re = 0x7fabdc93ce20} flags = 1 __FUNCTION__ = "pv_set_scriptvar" #6 0x00007fabd2bc9f6e in curL_query_url (_m=0x7fabdc8a9048, _url=0x7ffd762eb490 "http://mws:3001/api/rtc/devpw/INVITE/sip:0313809101%40example.com", _dst=0x7fabdc939d00 "\017", _username=0x7ffd762e8490 "", _secret=0x7ffd762e9490 "", contenttype=0x7fabdc8ff698 "application/json", _post=0x7fabdc93dc20 "{"ah":"Digest algorithm=MD5, username=\"john.smith\", realm=\"example.com\", nonce=\"Vji8FVY4uulLhKFK2JwtBHn5FZ4hC6nj\", uri=\"sip:0313809101@example.com\", response=\"802228e5c68db80d419b72925c7beee"..., timeout=4, http_follow_redirect=0, oneline=0, maxdatasize=0) at functions.c:242 datasize = 295 curl = 0x15cb210 res = CURLE_OK value = {s = 0x7ffd762eb490 "http://mws:3001/api/rtc/devpw/INVITE/sip:0313809101%40example.com", len = 66} url = 0x7fabdc93e590 "http://mws:3001/api/rtc/devpw/INVITE/sip:0313809101%40example.com" at = 0x0 stream = { buf = 0x7fabdc93ce20 "{"status":"OK","uid":"device.john.smith","dom":"example.com","pwd":"7ymu0mAJ","recfile":"20151103144733822~0313809101~unspecified~example.com~john.smith","recdir":"example.com/2015/11/03","rec":true,"..., curr_size = 296, pos = 295, max_size = 0} stat = 200 dst = 0x7fabdc939d00 val = {rs = { s = 0x7fabdc93ce20 "{"status":"OK","uid":"device.john.smith","dom":"example.com","pwd":"7ymu0mAJ","recfile":"20151103144733822~0313809101~unspecified~example.com~john.smith","recdir":"example.com/2015/11/03","rec":true,"..., len = 295}, ri = 1982772372, flags = 4} download_size = 295 total_time = 0.091017000000000001 headerlist = 0x15c8500 __FUNCTION__ = "curL_query_url" #7 0x00007fabd2bcd569 in curl_con_query_url (_m=0x7fabdc8a9048, connection=0x7fabdc935868 "apiauth", _url=0x7fabdc93d548 "\360\231\223ܫ\177", _result=0x7fabdc939d00 "\017", contenttype=0x7fabdc8ff698 "application/json", _post=0x7fabdc939c80 "`\270\223ܫ\177") at functions.c:353 conn = 0x7fabdc8d2810 connstr = {s = 0x7fabdc935868 "apiauth", len = 7} usernamebuf = '\000' <repeats 4095 times> passwordbuf = '\000' <repeats 4095 times> connurlbuf = "mws:3001/api/rtc/devpw", '\000' <repeats 4073 times> urlbuf = "http://mws:3001/api/rtc/devpw/INVITE/sip:0313809101%40example.com", '\000' <repeats 445 times> urlbuf2 = {s = 0x7fabdc99fc00 "/INVITE/sip:0313809101%40example.com", len = 37} urlbuf3 = 0x7fabdc93e590 "http://mws:3001/api/rtc/devpw/INVITE/sip:0313809101%40example.com" postdatabuf = { s = 0x7fabdc9a98d0 "{"ah":"Digest algorithm=MD5, username=\"john.smith\", realm=\"example.com\", nonce=\"Vji8FVY4uulLhKFK2JwtBHn5FZ4hC6nj\", uri=\"sip:0313809101@example.com\", response=\"802228e5c68db80d419b72925c7beee"..., len = 205} postdata = 0x7fabdc93dc20 "{"ah":"Digest algorithm=MD5, username=\"john.smith\", realm=\"example.com\", nonce=\"Vji8FVY4uulLhKFK2JwtBHn5FZ4hC6nj\", uri=\"sip:0313809101@example.com\", response=\"802228e5c68db80d419b72925c7beee"... maxdatasize = 0 res = 2 __FUNCTION__ = "curl_con_query_url"
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-159557372
Please @oej use the markdown '```' in order to paste this kind of things. Usually data get detected as references for issues like in #5
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-159559869
Thanks maniac :-)
I am a bit at loss here, have looked at this backtrace for far too long and can't figure out what goes wrong. It happens now and then and is not easy to repeat with a single request, so it feels like a memory leak or slow corruption somewhere.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-159562112
It is a buffer overflow -- apparently curl module doesn't have the at least 558a65e48e6819140b409cf58a0340aa78b8c2cf
See the last commits to the utils module in 4.3:
``` git log -p modules/utils/ ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-159601386
Possible patch in #435
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-163532023
Hi @oej , Have you had any further issues in the curl module since my fixes went in?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-169616859
Closed #400.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#event-527709569
Closing this one as fixes were pushed more than a month ago -- if there are new issues, re-open or create a new one.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/400#issuecomment-175473851