[SR-Users] set_body_multipart and memory leak

Sergey Basov sergey.v.basov at gmail.com
Thu Apr 21 14:46:25 CEST 2016


Hi, All.

I have some problems with pkg_memory leak.

After each call used private memory of the "udp receiver" process
increases at 2500 bytes.
On test environment I hav set it to 2Mbyte, but it is full after 700 calls.

I need to modify SDP in invite and other packets.
When I do

====================================================

if(has_body("application/sdp"))
   set_body_multipart();
   if (msg_apply_changes())
    {
       xlog("L_INFO", "ISUP 1 Changes Applied Succesfully");
    }
}

record_route();
dlg_manage
route(RELAY);

====================================================


Debug from kamailio:

Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textops
[textops.c:2627]: has_body_f(): content type is 196611
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textops
[textops.c:1577]: set_multibody_helper():
delimiter<17>:[unique-boundary-1]
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textops
[textops.c:1486]: generate_boundary(): adding final CRLF+CRLF
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textops
[textops.c:1714]: set_multibody_helper():
content-type<44>:[multipart/mixed;boundary="unique-boundary-1"]
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textops
[textops.c:1766]: set_multibody_helper(): set flag FL_BODY_MULTIPART
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: ERROR: <core>
[msg_translator.c:1691]: get_boundary(): Content-Type hdr has no
params
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: WARNING: <core>
[msg_translator.c:1954]: build_req_buf_from_sip_req():
check_boundaries error
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[msg_translator.c:422]: clen_builder(): content-length: 251 (251)
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: textopsx
[textopsx.c:231]: msg_apply_changes_f(): SIP message content updated -
reparsing
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:608]: parse_msg(): SIP Request:
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:610]: parse_msg():  method:  <INVITE>
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:612]: parse_msg():  uri:
<sip:0637304494 at 10.56.42.27:5070;user=phone>
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:614]: parse_msg():  version: <SIP/2.0>
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_via.c:1254]: parse_via_param(): Found param type 232,
<branch> = <z9hG4bK09e6.2654d2382f7c4e4fb8bb62fe85f62dfa.0>; state=6
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_via.c:1254]: parse_via_param(): Found param type 236,
<i> = <1>; state=16
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_via.c:2642]: parse_via(): end of header reached, state=5
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:496]: parse_headers(): parse_headers: Via found,
flags=2
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:498]: parse_headers(): parse_headers: this is the
first via
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: INFO: <script>:
ISUP 1 Changes Applied Succesfully
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_via.c:1254]: parse_via_param(): Found param type 232,
<branch> = <z9hG4bKsr-s7wTDLa0zUfsTql5zpl0zpl0z.lRD.zok.TLz.lSk2Fw1RY9PJYMxpdED.dED.aEG38LkpcsWhqMQr1v1bFAyJGCxrCoQdB71Mtceh52GpZKDpX3zRFAzVFJzhBLGpeJe.TczW7cDuT8GLs7O37vBbn6BbTfGhM2Gpl*>;
state=16
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_via.c:2642]: parse_via(): end of header reached, state=5
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:496]: parse_headers(): parse_headers: Via found,
flags=ffffffffffffffff
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:509]: parse_headers(): parse_headers: this is the
second via
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/parse_addr_spec.c:894]: parse_addr_spec(): end of header
reached, state=10
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:173]: get_hdr_field(): DEBUG: get_hdr_field: <To>
[46]; uri=[sip:0637304494 at 10.56.42.27:5070;user=phone]
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:175]: get_hdr_field(): DEBUG: to body
[<sip:0637304494 at 10.56.42.27:5070;user=phone>#015#012]
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:153]: get_hdr_field(): get_hdr_field: cseq
<CSeq>: <2> <INVITE>
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:187]: get_hdr_field(): DEBUG: get_hdr_body :
content_length=251
Apr 21 15:38:20 sip1 /usr/sbin/kamailio-sipt[17775]: DEBUG: <core>
[parser/msg_parser.c:89]: get_hdr_field(): found end of header



--
Best regards,
Sergey Basov                     e-mail: sergey.v.basov at gmail.com



More information about the sr-users mailing list