[asterisk-bugs] [Asterisk 0015349]: Deadlock in do_monitor() of chan_sip

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Apr 19 08:03:09 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15349 
====================================================================== 
Reported By:                samy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15349
Category:                   Channels/chan_sip/General
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.0.10 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-06-17 22:08 CDT
Last Modified:              2010-04-19 08:03 CDT
====================================================================== 
Summary:                    Deadlock in do_monitor() of chan_sip
Description: 
Unfortunately I have no steps to reproduce this. Had about 30 calls going
through, all calls are SIP, and randomly ran into a SIP deadlock (`sip show
channels` would cause console to hang, no new SIP calls would begin).

It sort of looks like `dialoglist` is an infinite loop (every member
points to at least one other member, there is never a ->next that points to
null), but I don't see how that could happen in the code so I'm not sure.

I did get `core show locks` output a few times, and I have a modified
version that provides the time of the last time each lock was
locked/unlocked. This is interesting because we can see lock
https://issues.asterisk.org/view.php?id=0 never
changes and is held for multiple minutes before I restart, but lock
https://issues.asterisk.org/view.php?id=1
changes constantly.

The fact that lock https://issues.asterisk.org/view.php?id=1 (lock on
dialog->sip_pvt) is constantly changing in
do_monitor makes me think `dialoglist` is an infinite loop.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0015363 1.6.2.0_beta3 locks up in certain SIP s...
related to          0015862 chan_sip deadlock in mutex sip_alloc
====================================================================== 

---------------------------------------------------------------------- 
 (0120571) nduteil (reporter) - 2010-04-19 08:03
 https://issues.asterisk.org/view.php?id=15349#c120571 
---------------------------------------------------------------------- 
Hi,
Anything new on this ticket ?
I also have the  "strange things may happen" problem mentioned above.

WARNING[11687] channel.c:3681 in ast_do_masquerade: Fixup failed on
channel [Local,SIP/172.16.171.16:5060-082d87a8<MASQ>] (original =
[SIP;SIP/172.16.171.16:5060-082d87a8]), strange things may happen.
WARNING[11687]: channel.c:3689 in ast_do_masquerade: Hangup failed! 
Strange things may happen!
WARNING[11687]: channel.c:2044 in __ast_read: Failed to perform
masquerade
WARNING[11687]: channel.c:1247 in ast_channel_free: Channel
'SIP/172.16.171.16:5060-082d87a8' may not have been hung up properly

After that, asterisk server freeze within 30s.

Result of core show locks :

=======================================================================
=== Currently Held Locks ==============================================
=======================================================================
===
=== <file> <line num> <function> <lock name> <lock addr> (times locked)
===
=== Thread ID: 3077278640 (do_monitor           started at [16667]
chan_sip.c restart_monitor())
=== ---> Lock https://issues.asterisk.org/view.php?id=0 (chan_sip.c): MUTEX
16519 do_monitor &iflock 0xb772a760
(1)
=== ---> Lock https://issues.asterisk.org/view.php?id=1 (chan_sip.c): MUTEX
16531 do_monitor &sip->lock 0x82d87a8
(1)
=== -------------------------------------------------------------------
===
=== Thread ID: 3060448176 (pbx_thread           started at [ 2660] pbx.c
ast_pbx_start())
=== ---> Waiting for Lock https://issues.asterisk.org/view.php?id=0
(chan_sip.c): MUTEX 4673 sip_alloc &iflock
0xb772a760 (1)
=== --- ---> Locked Here: chan_sip.c line 16519 (do_monitor)
=== -------------------------------------------------------------------
===
=== Thread ID: 3068693424 (pbx_thread           started at [ 2660] pbx.c
ast_pbx_start())
=== ---> Waiting for Lock https://issues.asterisk.org/view.php?id=0
(chan_sip.c): MUTEX 4673 sip_alloc &iflock
0xb772a760 (1)
=== --- ---> Locked Here: chan_sip.c line 16519 (do_monitor)
=== -------------------------------------------------------------------
===
=== Thread ID: 3064134576 (session_do           started at [ 2521]
manager.c accept_thread())
=== ---> Lock https://issues.asterisk.org/view.php?id=0 (manager.c): RDLOCK 2280
process_message &actionlock
0x8174040 (1)
=== -------------------------------------------------------------------
===
=== Thread ID: 3069676464 (pbx_thread           started at [ 2660] pbx.c
ast_pbx_start())
=== ---> Waiting for Lock https://issues.asterisk.org/view.php?id=0
(chan_sip.c): MUTEX 4673 sip_alloc &iflock
0xb772a760 (1)
=== --- ---> Locked Here: chan_sip.c line 16519 (do_monitor)
=== -------------------------------------------------------------------
===
======================================================================= 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-04-19 08:03 nduteil        Note Added: 0120571                          
======================================================================




More information about the asterisk-bugs mailing list