[asterisk-dev] [Code Review] Convert device state callbacks to ao2 objects to fix a deadlock.

Russell Bryant reviewboard at asterisk.org
Tue Jan 18 11:41:54 CST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1072/#review3103
-----------------------------------------------------------



/branches/1.6.2/main/pbx.c
<https://reviewboard.asterisk.org/r/1072/#comment6363>

    You might have a memory leak here when you init() the iterator the 2nd time.  You should probably destroy() before you init() again.



/branches/1.6.2/main/pbx.c
<https://reviewboard.asterisk.org/r/1072/#comment6364>

    I think I'd rather see an ao2_callback() used here with OBJ_UNLINK.  Have the callback return CMP_MATCH | CMP_STOP unconditionally so you always unlink the first item in the container.


- Russell


On 2011-01-12 15:20:34, Jeff Peeler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1072/
> -----------------------------------------------------------
> 
> (Updated 2011-01-12 15:20:34)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Lock scenario:
> Thread 1
>  holds ast_rdlock_contexts &conlock
>  holds handle_statechange hints
>  holds handle_statechange hint
>   waiting for cb_extensionstate
>    Locked Here: chan_sip.c line 7428 (find_call)
> Thread 2
>  holds handle_request_do &netlock
>  holds find_call sip_pvt_ptr
>   waiting for ast_rdlock_contexts &conlock
>    Locked Here: pbx.c line 9911 (ast_rdlock_contexts)
> 
> Chan_sip has an established locking order of locking the sip_pvt and then getting the context lock. So the as stated by the summary, the operations in thread 2 have been modified to no longer require the context lock.
> 
> 
> This addresses bug 18310.
>     https://issues.asterisk.org/view.php?id=18310
> 
> 
> Diffs
> -----
> 
>   /branches/1.6.2/main/pbx.c 301681 
> 
> Diff: https://reviewboard.asterisk.org/r/1072/diff
> 
> 
> Testing
> -------
> 
> one47 has reported on the issue that it has been going well so far (for 18 hours):
> https://issues.asterisk.org/view.php?id=18310#130297
> 
> 
> Thanks,
> 
> Jeff
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110118/ab0bd1a4/attachment-0001.htm>


More information about the asterisk-dev mailing list