asterisk/channels
Mark Michelson 61c0d20d20 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 #14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

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


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 21:08:03 +00:00
..
h323 Fix a couple more build issues related to ast_str_opaque 2008-12-15 17:21:38 +00:00
misdn we can now build with -Wformat=2, which found a couple of real bugs 2008-11-29 15:29:33 +00:00
xpmr Merged revisions 159025 via svnmerge from 2008-11-25 05:02:11 +00:00
chan_agent.c Janitor, use ARRAY_LEN() when possible. 2008-12-05 10:31:25 +00:00
chan_alsa.c Janitor, use ARRAY_LEN() when possible. 2008-12-05 10:31:25 +00:00
chan_console.c This is basically a complete rollback of r155401, as it was determined that 2008-11-25 01:01:49 +00:00
chan_dahdi.c Merged revisions 166380 via svnmerge from 2008-12-22 21:08:03 +00:00
chan_features.c Merged revisions 160207 via svnmerge from 2008-12-02 00:37:21 +00:00
chan_gtalk.c Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating 2008-09-12 23:30:03 +00:00
chan_h323.c Recorded merge of revisions 154263 via svnmerge from 2008-11-04 18:59:48 +00:00
chan_iax2.c Open a timer before loading configuration so that the trunking configuration option 2008-12-15 22:25:46 +00:00
chan_jingle.c Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating 2008-09-12 23:30:03 +00:00
chan_local.c Merged revisions 157305 via svnmerge from 2008-11-18 18:31:08 +00:00
chan_mgcp.c This commit does two things: 2008-11-12 06:46:04 +00:00
chan_misdn.c Numerous documentation updates. 2008-12-18 21:21:44 +00:00
chan_nbs.c one more place I forgot 2008-05-22 17:50:40 +00:00
chan_oss.c Numerous documentation updates. 2008-12-18 21:21:44 +00:00
chan_phone.c Silence a build warning. (chan_phone.c:810: warning: value computed is not used) 2008-12-01 23:18:48 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_sip.c Numerous documentation updates. 2008-12-18 21:21:44 +00:00
chan_skinny.c Fix codec capability setup in chan_skinny 2008-12-12 17:14:13 +00:00
chan_unistim.c Merge the cli_cleanup branch. 2008-09-28 23:32:14 +00:00
chan_usbradio.c Janitor, use ARRAY_LEN() when possible. 2008-12-05 10:31:25 +00:00
chan_vpb.cc incorporates r159808 from branches/1.4: 2008-11-29 17:57:39 +00:00
console_board.c import the recent additions for video console into trunk, 2008-06-29 21:17:14 +00:00
console_gui.c (closes issue #13557) 2008-10-09 14:17:33 +00:00
console_video.c (closes issue #13557) 2008-10-09 14:17:33 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
iax2-parser.c Merge ast_str_opaque branch (discontinue usage of ast_str internals) 2008-12-13 08:36:35 +00:00
iax2-parser.h Improve native transfers when a chain of IAX2 connections are in use. 2008-05-17 19:39:35 +00:00
iax2-provision.c - iax2-provision was not freeing iax_templates structure when unloading the chan_iax2.so module. 2008-12-03 19:25:30 +00:00
iax2-provision.h Don't reload a configuration file if nothing has changed. 2007-08-16 21:09:46 +00:00
iax2.h Merge changes from team/bbryant/keyrotation 2008-08-01 18:16:24 +00:00
Makefile There is a troublesome assert() in the alsa/control.h header that causes 2008-11-02 04:14:20 +00:00
misdn_config.c we can now build with -Wformat=2, which found a couple of real bugs 2008-11-29 15:29:33 +00:00
vcodecs.c (closes issue #13557) 2008-10-09 14:17:33 +00:00
vgrabbers.c free memory used by the x11 grabber when closing it. 2008-07-14 16:50:54 +00:00