[OpenSIPS-Devel] [ opensips-Bugs-2950939 ] memory leak while accessing REGISTER contact uri

SourceForge.net noreply at sourceforge.net
Sat Feb 13 00:09:47 CET 2010


Bugs item #2950939, was opened at 2010-02-12 23:09
Message generated for change (Tracker Item Submitted) made by evereta
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2950939&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.6.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: eugene (evereta)
Assigned to: Nobody/Anonymous (nobody)
Summary: memory leak while accessing REGISTER contact uri

Initial Comment:
Hello,

We are running out of package memory while processing REGISTER messages. We narrowed down the leak to accessing uri of the contact header of the message: $(ct{nameaddr.uri}). Originally our script was xlog-ing some value and then adding a Contact header to the reply constructed from the contact uri of the request plus expires parameters, but we have confirmed that memory leaks even if all we do is xlog contact uri - please see our config file below.

After some number of requests (usually 50,000 - 80,000) we start getting these errors and no more requests get processed:

2010 Feb 10 02:55:08 <local0.err> tb1(Equinix) /usr/sbin/opensips[6646]: ERROR:core:parse_headers: pkg memory allocation failed
2010 Feb 10 02:55:08 <local0.err> tb1(Equinix) /usr/sbin/opensips[6646]: ERROR:core:build_res_buf_from_sip_req: parse_headers failed
2010 Feb 10 02:55:08 <local0.err> tb1(Equinix) /usr/sbin/opensips[6646]: ERROR:sl:sl_send_reply_helper: response building failed

Another observation that we had is that when we access the entire contact header, for example: xlog("L_INFO", "Contact: $ct;expires=3600\n");. then leak does not occur.

Attached is a sipp scenario we use to re-create the leak. We usually run 2-3 sipp sessions in parallel with this command:
sipp 192.168.1.33 -s vasya.pupkin -sf register1.xml -m 40000


Opensips config file is as follows:

#
# $Id: opensips.cfg 5503 2009-03-22 16:22:32Z bogdan_iancu $
#
# OpenSIPS basic configuration script
#     by Anca Vamanu <anca at voice-system.ro>
#
# Please refer to the Core CookBook at:
#      http://www.opensips.org/index.php?n=Resources.DocsCookbooks
# for a explanation of possible statements, functions and parameters.
#


####### Global Parameters #########

debug=3
fork=yes
children=8

dns=off
rev_dns=off
disable_tcp=yes
log_stderror=no
log_facility=LOG_LOCAL0

port=5060
listen=udp:192.168.1.33:5060

server_signature=no

####### Modules Section ########

#set module path
mpath="/usr/lib64/opensips/modules/"

loadmodule "sl.so"
loadmodule "textops.so"
loadmodule "xlog.so" 

# ----------------- setting module-specific parameters ---------------

route
{
	xlog("L_INFO", "Contact: <$(ct{nameaddr.uri})>;expires=3600\n"); 
#	xlog("L_INFO", "Contact: $ct;expires=3600\n"); 
	sl_send_reply("200", "OK");
	exit;
}


Thanks,
Eugene

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2950939&group_id=232389



More information about the Devel mailing list