[SR-Users] problem unreferencing dialog in dialog module

Anton Roman antonroman at gmail.com
Fri Mar 18 13:01:30 CET 2011


Hi,

more than 3 millions calls have been processed and no problem (crash,
increment in memory allocation...) has been noticed since the update, so
this check works for us.

Thanks a lot,
regards

2011/3/4 Daniel-Constantin Mierla <miconda at gmail.com>

> Hello,
>
> just committed a safety check for this case. If anyone can give it some
> tests, then we can backport.
>
> I will analyze to see why it got in such case, but anyhow it is better and
> safer to detect bogus dereferences to dialogs and not crash.
>
> Thanks,
> Daniel
>
>
> On 3/3/11 11:34 AM, Timo Reimann wrote:
>
>> Argh:
>>
>>
>> On 03.03.2011 11:11, Timo Reimann wrote:
>>
>>> What I can tell though is that the crash happens because too much dialog
>>> reference counter decrementing takes place. Although I have no clue why,
>>>
>>                                                        ^^^^^^^^^^^^^^^^^
>>
>> ...the crash happens,
>>
>>  I believe the implementation of unref_dlg_unsafe() (a macro) could be
>>> somewhat more robust by not unlinking and destroying a dialog when the
>>> counter drops below zero. That is, instead of running the following block
>>>
>>> if ((_dlg)->ref<=0) { \
>>>         unlink_unsafe_dlg( _d_entry, _dlg);\
>>>         LM_DBG("ref<=0 for dialog %p\n",_dlg);\
>>>         destroy_dlg(_dlg);\
>>> }\
>>>
>>
>>  for _dlg->ref<= 0, I see no reason to change the compare operator to ==.
>>>
>> I see no reason *not* to change compare operator to ==. That is, I want
>> the block to execute iff the reference counter is found to be zero.
>>
>>
>> --Timo
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> --
> Daniel-Constantin Mierla
> http://www.asipto.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110318/b90a47fb/attachment.htm>


More information about the sr-users mailing list