[asterisk-dev] [Code Review] SIP Dialog ref counting in 1.6.0

Russell Bryant russell at digium.com
Thu Jul 2 08:31:05 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/302/#review929
-----------------------------------------------------------



/branches/1.6.0/channels/chan_sip.c
<http://reviewboard.digium.com/r/302/#comment2233>

    It would be best to use macros for this so that the ref count debug code knows where the reference count was _really_ modified, instead of reporting it from right here.
    
    (Actually, I think we only have that debug code in 1.6.1, but it would be good to do it this way anyway in case we end up needing to backport it at some point.)



/branches/1.6.0/channels/chan_sip.c
<http://reviewboard.digium.com/r/302/#comment2234>

    It would be best if we took the sip_pvt out of the pvt list here instead of in the destructor.  It needs to be impossible for another thread to get a hold of the object while we're destroying it.



/branches/1.6.0/channels/chan_sip.c
<http://reviewboard.digium.com/r/302/#comment2235>

    I think there is an AST_SCHED macro that does this checking for you.


- Russell


On 2009-07-01 15:10:44, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/302/
> -----------------------------------------------------------
> 
> (Updated 2009-07-01 15:10:44)
> 
> 
> Review request for Asterisk Developers and Russell Bryant.
> 
> 
> Summary
> -------
> 
> This patch adds reference counting for sip dialogs into 1.6.0.
> 
> When proc_session_timer() is called from the scheduler thread it has no guarantee the session timer's dialog won't be freed from underneath it.  Now the session timer holds a reference to the dialog, preventing it from being destroyed during the middle of proc_session_timer().
> 
> 
> This addresses bug 13623.
>     https://issues.asterisk.org/view.php?id=13623
> 
> 
> Diffs
> -----
> 
>   /branches/1.6.0/include/asterisk/sched.h 204652 
>   /branches/1.6.0/channels/chan_sip.c 204652 
> 
> Diff: http://reviewboard.digium.com/r/302/diff
> 
> 
> Testing
> -------
> 
> placed test calls, verified dialogs and session-timers get destroyed on hangup.
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list