<div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br><br></div>I have kamailio v5.0.4 git rev. 5f26a4e8c55cdf5a5a7eaf6864c4f5213d321293 installed on 32bit Debian Wheezy virtual machine (1GB RAM and 1 vCPU) for development and testing of a project.<br><br></div>We need to inspect sip traces to / from webrtc endpoint on kamailio side, for which we use siptrace module with following config,<br><br><br># ----- siptrace params -----<br>modparam("siptrace", "trace_on", 1)</div><div>modparam("siptrace", "hep_mode_on", 0)<br>modparam("siptrace", "xheaders_write", 1)</div><div>modparam("siptrace", "trace_to_database", 0)<br></div><div>modparam("siptrace", "trace_flag", FLT_SIP_TRACE)<br>modparam("siptrace", "traced_user_avp", "$avp(traced_user)")<br>modparam("siptrace", "duplicate_uri", "WEBRTC_SIP_TRACE_ADDRESS")<br></div><div><br></div><div><br></div>We observed multiple problems of memleaks and segfaults, here is a summary,<br><br></div>1. Calling sip_trace method without any arguements or with only one arguement (duplicate uri) crashes kamailio with segfault.<br><br><a href="https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.f.sip_trace">https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.f.sip_trace</a><br><br></div>2. To avoid segfault, either I have to specify both args (i am not sure what to set as 2nd arg, so i used "$ci" for it) OR disable "xheaders_write" module param. However, this causes slow memory leak and in about 48 hours kamailio runs out of memory (sip traffic is less then 10 concurrent users)<br><br><a href="https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.p.xheaders_write">https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.p.xheaders_write</a><br><br></div>3. If we remove siptrace module and use "network:msg" event route in corex module with "send_data" method then we ran in to PV buffer overflow problem (webrtc invites are very big > 10KB). So, I increased "pv_buffer_size" to 16K and "pv_buffer_slots" to 12. Which again crashes kamailio with segfault.<br><br><a href="https://kamailio.org/docs/modules/5.0.x/modules/corex.html#async.evr.network_io">https://kamailio.org/docs/modules/5.0.x/modules/corex.html#async.evr.network_io</a><br><br><a href="https://kamailio.org/docs/modules/5.0.x/modules/corex.html#corex.f.send_data">https://kamailio.org/docs/modules/5.0.x/modules/corex.html#corex.f.send_data</a><br><br><a href="http://www.kamailio.org/wiki/cookbooks/4.1.x/core#pv_buffer_size">http://www.kamailio.org/wiki/cookbooks/4.1.x/core#pv_buffer_size</a><br><br><a href="http://www.kamailio.org/wiki/cookbooks/4.1.x/core#pv_buffer_slots">http://www.kamailio.org/wiki/cookbooks/4.1.x/core#pv_buffer_slots</a><br><br></div><br>Removing "pv_buffer_slots" from config fixes the crash problem, and right now we are observing kamailio if stays stable.<br><br></div><br>Thank you.<br><div><div><br><br></div></div></div>