<div dir="ltr">Hi,<div>I'm using http_query to send a post request on a https URL. The weird part is it crashes with segmentation fault when the response from the server is 200. If the response was a 500, it works and continues processing.</div><div>Here's the function:</div><div>http_query("<a href="https://notify.abcd.com/onnet/call">https://notify.abcd.com/onnet/call</a>", "$avp(devices)", "Content-Type: application/json" "$var(response)");<br></div><div>xlog("L_INFO", "Response is $var(response)");</div><div><br></div><div>And here's the backtrace on crash:</div><div><div>0x00007f62f2bf8e38 in ?? ()</div><div>#1  0x00007f62ea22251b in http_query (_m=0x7f62f2c3a038, _url=0x7f62f2bf3548 "\330\064\277\362b\177", _dst=0x7f62f2bf9250 "\030\215\277\362b\177", _post=0x7f62f2bf35c8 "\200r\277\362b\177", </div><div>    _hdr=0x7f62f2bf91d0 "h\221\277\362b\177") at functions.c:226</div><div>#2  0x00007f62ea229e0b in w_http_query_post_hdr (_m=0x7f62f2c3a038, _url=0x7f62f2bf3548 "\330\064\277\362b\177", _post=0x7f62f2bf35c8 "\200r\277\362b\177", _hdr=0x7f62f2bf91d0 "h\221\277\362b\177", </div><div>    _result=0x7f62f2bf9250 "\030\215\277\362b\177") at utils.c:483</div><div>#3  0x000000000041f6b5 in do_action (h=0x7ffeb128c8c0, a=0x7f62f2bf8a58, msg=0x7f62f2c3a038) at action.c:1079</div><div>#4  0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2bf6fc0, msg=0x7f62f2c3a038) at action.c:1549</div><div>#5  0x000000000041f3ce in do_action (h=0x7ffeb128c8c0, a=0x7f62f2bfb9b0, msg=0x7f62f2c3a038) at action.c:1045</div><div>#6  0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2bb9388, msg=0x7f62f2c3a038) at action.c:1549</div><div>#7  0x000000000041bc28 in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b8f248, msg=0x7f62f2c3a038) at action.c:678</div><div>#8  0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b8e268, msg=0x7f62f2c3a038) at action.c:1549</div><div>#9  0x000000000041f3ce in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b91040, msg=0x7f62f2c3a038) at action.c:1045</div><div>#10 0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b8b7a8, msg=0x7f62f2c3a038) at action.c:1549</div><div>#11 0x000000000041bc28 in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b3a2c0, msg=0x7f62f2c3a038) at action.c:678</div><div>#12 0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b3a2c0, msg=0x7f62f2c3a038) at action.c:1549</div><div>#13 0x000000000041f3ce in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b47f00, msg=0x7f62f2c3a038) at action.c:1045</div><div>#14 0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b37e80, msg=0x7f62f2c3a038) at action.c:1549</div><div>#15 0x000000000041bc28 in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b1c9c8, msg=0x7f62f2c3a038) at action.c:678</div><div>#16 0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b1c9c8, msg=0x7f62f2c3a038) at action.c:1549</div><div>#17 0x000000000041f3ce in do_action (h=0x7ffeb128c8c0, a=0x7f62f2b1cc28, msg=0x7f62f2c3a038) at action.c:1045</div><div>#18 0x000000000042c2ea in run_actions (h=0x7ffeb128c8c0, a=0x7f62f2b170a0, msg=0x7f62f2c3a038) at action.c:1549</div><div>#19 0x000000000042ca93 in run_top_route (a=0x7f62f2b170a0, msg=0x7f62f2c3a038, c=0x0) at action.c:1635</div><div>#20 0x000000000051c115 in receive_msg (</div><div>    buf=0xab7520 <buf> "INVITE <a href="http://sip:bdbbf600000001b5b919d0@devsip.abcd.com:8321">sip:bdbbf600000001b5b919d0@devsip.abcd.com:8321</a> SIP/2.0\r\nRecord-Route: <sip:203.153.53.145:8300;r2=on;lr=on>\r\nRecord-Route: <sip:203.153.53.145:8321;transport=tcp;r2=on;lr=on>\r\nVia: SIP/2.0/UDP"..., len=1901, rcv_info=0x7ffeb128cc10) at receive.c:196</div><div>#21 0x000000000062d427 in udp_rcv_loop () at udp_server.c:495</div><div>#22 0x00000000004b28c1 in main_loop () at main.c:1593</div><div>#23 0x00000000004b9aa5 in main (argc=5, argv=0x7ffeb128d118) at main.c:2597</div></div><div><br></div><div>Can someone please confirm the crash so that I'll go ahead and report this as an issue on the tracker. Basically when it crashes, kamailio doesn't even execute the xlog function after the http_query call.</div><div>P.S. <a href="http://abcd.com">abcd.com</a> is a changed domain for confidential reasons.</div><div><br></div><div>Thanks,</div><div><br></div><div>- Jayesh</div><div><br></div></div>