[Home]

Summary:ASTERISK-14475: [patch] Deadlock between ast_cel_report_event and ast_do_masquerade
Reporter:Laurent Steffan (lmsteffan)Labels:
Date Opened:2009-07-16 00:30:19Date Closed:2011-05-12 16:04:33
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ast_cel_deadlock_15512.diff
( 1) lock2.txt
Description:The symptoms are in particular the impossibility to actually perform the masquerade during a directed pickup (this was previously possible).

The included file, obtained through a "core show locks" command in the CLI, shows the abovementioned deadlock.

Comments:By: Leif Madsen (lmadsen) 2009-08-31 09:03:40

Assigned to mnicholson for review. Thanks!

By: David Vossel (dvossel) 2009-10-05 14:56:56

I believe the patch just uploaded should resolve this.

By: David Vossel (dvossel) 2009-10-05 16:40:40

If this patch does not resolve the issue, please provide gdb 'thread apply all bt" output as well so I can better isolate what is causing the deadlock.

By: David Vossel (dvossel) 2009-10-08 17:03:00

I'm going to go ahead and commit the patch as it is definitely a bug.  If this does not fix the issue you are having please reopen.

By: Digium Subversion (svnbot) 2009-10-08 17:08:05

Repository: asterisk
Revision: 222981

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r222981 | dvossel | 2009-10-08 17:08:05 -0500 (Thu, 08 Oct 2009) | 13 lines

Deadlock between ast_cel_report_event and ast_do_masquerade

chan_sip calls pbx_exec on a pvt's owner channel while only the
pvt lock is held.  Since pbx_exec calls ast_cel_report_event which
attempts to lock the channel, invalid locking order occurs.  Channels
should be locked before pvt's.

(closes issue ASTERISK-14475)
Reported by: lmsteffan
Patches:
     ast_cel_deadlock_15512.diff uploaded by dvossel (license 671)


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

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

By: Digium Subversion (svnbot) 2011-05-12 16:04:32

Repository: asterisk
Revision: 318636

U   branches/1.6.2/channels/chan_sip.c

------------------------------------------------------------------------
r318636 | rmudgett | 2011-05-12 16:04:31 -0500 (Thu, 12 May 2011) | 20 lines

Merged revision 222981 from
https://origsvn.digium.com/svn/asterisk/branches/1.8

Similar deadlock possible when running the Pickup application internally.

------------------------------------------------------------------------
r222981 | dvossel | 2009-10-08 17:04:41 -0500 (Thu, 08 Oct 2009) | 13 lines

Deadlock between ast_cel_report_event and ast_do_masquerade

chan_sip calls pbx_exec on a pvt's owner channel while only the
pvt lock is held.  Since pbx_exec calls ast_cel_report_event which
attempts to lock the channel, invalid locking order occurs.  Channels
should be locked before pvt's.

(closes issue ASTERISK-14475)
Reported by: lmsteffan
Patches:
     ast_cel_deadlock_15512.diff uploaded by dvossel (license 671)

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

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