[OpenSIPS-Users] Potential memory leak in siptrace module
Steve Brisson
steve.brisson at librestream.com
Wed Jan 31 12:48:34 EST 2018
I've found that when I call the sip_trace method, in the main request routing block, the shmem used_size and fragments continually increases until the process crashes from an out of memory condition.
By enabling memory alloc debugging, I confirmed that the leaked allocation is the shm_malloc of a trace_info_t structure in the sip_trace_w method [siptrace.c:1539]. This piece of memory is supposed to be freed in the dialog terminated callback but because of the logic in the sip_trace_w method, trace_flags gets modified to TRACE_TRANSACTION and the dialog callbacks are never registered.
I haven't worked out the details of a proper fix yet. My workaround has been to remove the siptrace module from my config.
OpenSIPS config details:
opensips 2.3.2 (x86_64/linux)
#siptrace module config
modparam("siptrace", "trace_on", 0)
modparam("siptrace", "trace_id", "[tid]uri=mysql://db-user:db-pass@db-host/db-name;table=sip_trace;")
#siptrace method call in main request branch
sip_trace("tid", "d", "sip");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180131/b5ab59cb/attachment.html>
More information about the Users
mailing list