[asterisk-bugs] [Asterisk 0014057]: Deadlock chan_dahdi.c and channel.c

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Dec 22 15:55:55 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14057 
====================================================================== 
Reported By:                rtrauntvein
Assigned To:                putnopvut
====================================================================== 
Project:                    Asterisk
Issue ID:                   14057
Category:                   Channels/chan_dahdi
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.22 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-12-10 17:13 CST
Last Modified:              2008-12-22 15:55 CST
====================================================================== 
Summary:                    Deadlock chan_dahdi.c and channel.c
Description: 
I have an asterisk system that has been deadlocking on a weekly basis at
least once, and we cant seem to reliably reproduce it. It is a production
system with about 25 users that is being constantly used.

Running zaptel 1.4.12.1 with a TE220 card.
(Planning on installing the DAHDI release over the weekend as next
troubleshooting step)
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0013935 Calls are not beeing disconnected
====================================================================== 

---------------------------------------------------------------------- 
 (0096847) svnbot (reporter) - 2008-12-22 15:55
 http://bugs.digium.com/view.php?id=14057#c96847 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 166439

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_dahdi.c

------------------------------------------------------------------------
r166439 | mmichelson | 2008-12-22 15:55:54 -0600 (Mon, 22 Dec 2008) | 52
lines

Merged revisions 166382 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r166382 | mmichelson | 2008-12-22 15:08:03 -0600 (Mon, 22 Dec 2008) | 44
lines

Merged revisions 166380 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r166380 | mmichelson | 2008-12-22 14:56:29 -0600 (Mon, 22 Dec 2008) | 36
lines

Fix a deadlock relating to channel locks and autoservice

It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to 
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of 
autoservice.

The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.

The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.

In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.

It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.

(closes issue http://bugs.digium.com/view.php?id=14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

Review: http://reviewboard.digium.com/r/107/


........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=166439 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-22 15:55 svnbot         Checkin                                      
2008-12-22 15:55 svnbot         Note Added: 0096847                          
======================================================================




More information about the asterisk-bugs mailing list