[asterisk-dev] [Code Review] Fixup deadlock in chan_sip transfer to parking lot

David Vossel reviewboard at asterisk.org
Mon Jul 18 14:12:31 CDT 2011


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



/tags/1.8.5-rc1/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1322/#comment7715>

    The pvt has to be unlocked here because there are instances where p->owner is locked in ast_parking_ext_valid().  The owner is unlocked at this point so that causes locking inversion between the pvt and owner.
    
    Could the pvt just be unlocked before calling sip_park() and locked again afterwards to fix this?


- David


On July 18, 2011, 1:48 p.m., irroot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1322/
> -----------------------------------------------------------
> 
> (Updated July 18, 2011, 1:48 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> =======================================================================
> === Currently Held Locks ==============================================
> =======================================================================
> ===
> === <pending> <lock#> (<file>): <lock type> <line num> <function> <lock name> <lock addr> (times locked)
> ===
> === Thread ID: 0xb6e91b90 (do_monitor           started at [25036] chan_sip.c restart_monitor())
> === ---> Lock #0 (chan_sip.c): MUTEX 24551 handle_request_do &netlock 0x1d3f80 (1)
> === ---> Lock #1 (chan_sip.c): MUTEX 22802 handle_request_refer p 0x9fe9170 (1)
> === ---> Lock #2 (channel.c): MUTEX 6300 ast_do_masquerade channels 0x9c0daf8 (1)
> === ---> Tried and failed to get Lock #3 (channel.c): MUTEX 6323 ast_do_masquerade clonechan 0xb6e1978 (0)
> === -------------------------------------------------------------------
> ===
> === Thread ID: 0x1e4cb90 (pbx_thread           started at [ 5079] pbx.c ast_pbx_start())
> === ---> Lock #0 (channel.c): MUTEX 4749 ast_write chan 0xad3ba860 (1)
> === -------------------------------------------------------------------
> ===
> === Thread ID: 0x54a0b90 (pbx_thread           started at [ 5079] pbx.c ast_pbx_start())
> === ---> Lock #0 (channel.c): MUTEX 3714 __ast_read chan 0xb6e1978 (1)
> === ---> Waiting for Lock #1 (chan_sip.c): MUTEX 7234 sip_read p 0x9fe9170 (1)
> === --- ---> Locked Here: chan_sip.c line 22802 (handle_request_refer)
> === -------------------------------------------------------------------
> ===
> =======================================================================
> 
> 
> This addresses bug ASTERISK-18149.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18149
> 
> 
> Diffs
> -----
> 
>   /tags/1.8.5-rc1/channels/chan_sip.c 325799 
> 
> Diff: https://reviewboard.asterisk.org/r/1322/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> irroot
> 
>

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


More information about the asterisk-dev mailing list