<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>if you get a crash, then take the backtrace from the corefile
with gdb (inside the gdb session inspecting the corefile, do "bt
full"), it is very useful information to discover where the crash
happens.</p>
<p>It is also better to open on issue on bug tracker, so the
investigation of the crash can be done easier as well as reduce
the risck of forgetting about the report:</p>
<p> - <a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/issues">https://github.com/kamailio/kamailio/issues</a><br>
</p>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 03.12.17 18:41, M S wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFZQphyHJG4PAGhFABo-aDdmZJXgoPTqdCDgW+C2eZxrGpW6bw@mail.gmail.com">
<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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Development Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org">sr-dev@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>