[sr-dev] Multiple memleaks and segfauts in Kamailio v5.0.4

Daniel-Constantin Mierla miconda at gmail.com
Sun Dec 3 21:24:46 CET 2017


Hello,

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.

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:

  - https://github.com/kamailio/kamailio/issues

Cheers,
Daniel

On 03.12.17 18:41, M S wrote:
> Hi,
>
> 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.
>
> We need to inspect sip traces to / from webrtc endpoint on kamailio
> side, for which we use siptrace module with following config,
>
>
> # ----- siptrace params -----
> modparam("siptrace", "trace_on", 1)
> modparam("siptrace", "hep_mode_on", 0)
> modparam("siptrace", "xheaders_write", 1)
> modparam("siptrace", "trace_to_database", 0)
> modparam("siptrace", "trace_flag", FLT_SIP_TRACE)
> modparam("siptrace", "traced_user_avp", "$avp(traced_user)")
> modparam("siptrace", "duplicate_uri", "WEBRTC_SIP_TRACE_ADDRESS")
>
>
> We observed multiple problems of memleaks and segfaults, here is a
> summary,
>
> 1. Calling sip_trace method without any arguements or with only one
> arguement (duplicate uri) crashes kamailio with segfault.
>
> https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.f.sip_trace
>
> 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)
>
> https://kamailio.org/docs/modules/5.0.x/modules/siptrace.html#siptrace.p.xheaders_write
>
> 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.
>
> 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#corex.f.send_data
>
> 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_slots
>
>
> Removing "pv_buffer_slots" from config fixes the crash problem, and
> right now we are observing kamailio if stays stable.
>
>
> Thank you.
>
>
>
>
> _______________________________________________
> Kamailio (SER) - Development Mailing List
> sr-dev at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20171203/112c4348/attachment.html>


More information about the sr-dev mailing list