[OpenSIPS-Users] Possible memory leak related to AVPs

Mickael Marrache mickaelmarrache at gmail.com
Thu Jun 18 10:12:07 CEST 2015


Hi Razvan,

Here is what I've done.

I took a core dump of the attendant process. Then, I stopped OpenSIPS so
that it frees allocated fragments, and at the end lists all fragments that
are still allocated.

In this list of fragments, I can see a lot of AVPs.

I see some AVPs without data (avp->data == NULL, avp->flags == 0). But
something is weird, it looks like that all AVPs that don't have data have
the same id. It looks like duplicate AVPs (in different memory fragments).

Some AVPs do have data and have a format that looks valid.

Some AVPs looks corrupted. For example, I found an AVP with same ID as the
AVPs without data, but avp->data == 0x8000 which looks completely wrong.

Thanks,
Mickael

On Thu, Jun 18, 2015 at 10:11 AM, Mickael Marrache <
mickaelmarrache at gmail.com> wrote:

> Hi Razvan,
>
> I created a core dump for the attendant process. Is it enough or we also
> need core dumps for other processes? Note that the leak appears in shared
> memory.
>
> We do use QM debug for this version, this is how I discovered the
> remaining AVPs at shutdown where the remaining allocated memory fragments
> are listed.
>
> Do you know where I should look for the AVPs in the core dump?
>
> Thanks,
> Mickael
>
> On Tue, Jun 16, 2015 at 5:11 PM, Răzvan Crainea <razvan at opensips.org>
> wrote:
>
>>  Hi, Mickael!
>>
>> I don't know what exactly might cause the leak. What you can do is to try
>> to get a core dump (using tools like gcore) during low (or unexisting)
>> traffic and try to see what do the AVPs that are leaking contain. Are you
>> using QM debug?
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 05/27/2015 12:37 PM, Mickael Marrache wrote:
>>
>> Any idea? Is there something that may help finding the leak cause?
>>
>> On Tue, May 19, 2015 at 1:17 PM, Mickael Marrache <
>> <mickaelmarrache at gmail.com>mickaelmarrache at gmail.com> wrote:
>>
>>> Any idea what we should do?
>>>
>>>  I may be doing something wrong but I don't remember I had to take care
>>> of memory management when dealing with AVPs.
>>>
>>>  Am I right?
>>>
>>> On Mon, May 18, 2015 at 12:08 PM, Mickael Marrache <
>>> <mickaelmarrache at gmail.com>mickaelmarrache at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>>  We use customized sources based on 1.11.2.
>>>>
>>>>  However, we never modified the sources related to AVP.
>>>>
>>>>  Mickael
>>>>
>>>> On Mon, May 18, 2015 at 12:03 PM, Bogdan-Andrei Iancu <
>>>> bogdan at opensips.org> wrote:
>>>>
>>>>>  Hi Mickael,
>>>>>
>>>>> If you do not have any SIP message or transaction under processing,
>>>>> and still have AVPs in memory....well, it looks like a leak to me.
>>>>>
>>>>> What OpenSIPS version do you have ?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Bogdan-Andrei Iancu
>>>>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>>>>
>>>>>   On 17.05.2015 11:55, Mickael Marrache wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>  Here is what I've done:
>>>>>
>>>>>  1) Ensured OpenSIPS doesn't receive any calls.
>>>>> 2) Waited for all calls to terminate.
>>>>> 3) Checked that the inuse_transaction is 0.
>>>>> 4) Stopped OpenSIPS.
>>>>>
>>>>>  I confirm there are still a lot of AVPs in memory.
>>>>>
>>>>>  Who is supposed to free these AVPs? Is it a memory leak?
>>>>>
>>>>>  Thanks,
>>>>> Mickael
>>>>>
>>>>> On Fri, May 15, 2015 at 12:48 PM, Bogdan-Andrei Iancu <
>>>>> <bogdan at opensips.org>bogdan at opensips.org> wrote:
>>>>>
>>>>>>  Hi Michael,
>>>>>>
>>>>>> You can do "opensipsctl fifo get_statistics tm:" and you have the
>>>>>> "inuse_transaction" statistic :
>>>>>>
>>>>>> <http://www.opensips.org/html/docs/modules/1.11.x/tm.html#id296307>
>>>>>> http://www.opensips.org/html/docs/modules/1.11.x/tm.html#id296307
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>  Bogdan-Andrei Iancu
>>>>>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>>>>>
>>>>>>   On 14.05.2015 09:45, Mickael Marrache wrote:
>>>>>>
>>>>>>  I'm not sure there were no transactions in memory at shutdown.
>>>>>>
>>>>>>
>>>>>>
>>>>>> How can I check this? I didn't find an MI command for that.
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Bogdan-Andrei Iancu [ <bogdan at opensips.org>
>>>>>> mailto:bogdan at opensips.org <bogdan at opensips.org>]
>>>>>> *Sent:* Wednesday, May 13, 2015 6:44 PM
>>>>>> *To:* OpenSIPS users mailling list; <mickaelmarrache at gmail.com>
>>>>>> mickaelmarrache at gmail.com
>>>>>> *Subject:* Re: [OpenSIPS-Users] Possible memory leak related to AVPs
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Mickael,
>>>>>>
>>>>>> What means "a lot"  :) ? I'm asking as if you have 100 transactions
>>>>>> in memory (when doing shutdown) and you use ~10 AVPs per INVITE in script
>>>>>> -> you have 1000 AVPs in mem.
>>>>>>
>>>>>> When doing the shutdown, are any transaction in memory ? (with no
>>>>>> active transactions in mem, there are no AVPs in mem).
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>>  Bogdan-Andrei Iancu
>>>>>>
>>>>>> OpenSIPS Founder and Developer
>>>>>>
>>>>>> http://www.opensips-solutions.com
>>>>>>
>>>>>>  On 13.05.2015 17:53, Mickael Marrache wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>>
>>>>>> We have a memory leak and are trying to find the cause.
>>>>>>
>>>>>>
>>>>>>
>>>>>> We compiled the call with memory debugging and at shutdown, we see a
>>>>>> lot of allocated AVPs that are not released.
>>>>>>
>>>>>>
>>>>>>
>>>>>> opensips[27560]:     277067. N  address=0x2aae957a0330
>>>>>> frag=0x2aae957a0300 size=24 used=1
>>>>>>
>>>>>> opensips[27560]:             alloc'd from usr_avp.c: new_avp(119)
>>>>>>
>>>>>> opensips[27560]:         start check=f0f0f0f0f0f0f0f0, end check=
>>>>>> c0c0c0c0c0c0c0c0, abcdefedabcdefed
>>>>>>
>>>>>>
>>>>>>
>>>>>> Is it possible to have a memory leak related to AVPs? IIRC OpenSIPS
>>>>>> handles it internally.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Mickael
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>  _______________________________________________
>>>>>>
>>>>>> Users mailing list
>>>>>>
>>>>>> Users at lists.opensips.org
>>>>>>
>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>> _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150618/07a5c95f/attachment-0001.htm>


More information about the Users mailing list