[Home]

Summary:ASTERISK-02079: Avoided deadlock
Reporter:jimkou (jimkou)Labels:
Date Opened:2004-07-22 02:42:43Date Closed:2011-06-07 14:05:15
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bugnote-12220.txt
( 1) bugnote-12403.txt
( 2) exampleerror.log
( 3) gdb-07272004-01.txt
( 4) gdb-07272004-02.txt
Description:When I run asterisk for a while(about 7-9 Hours) users start complain to me :
they can't getting dial tone to make call even receive call...


****** ADDITIONAL INFORMATION ******

pbx*CLI> show channels
       Channel  (Context    Extension    Pri )   State Appl.         Data
       Zap/9-1  (inbound-pstn s            1   )      Up Bridged Call  Zap/15-1
      Zap/33-1  (inbound-internal s            1   )      Up Bridged Call  Zap/4-1
       Zap/4-1  (macro-dialinternal s            1   )      Up Dial          Zap/33r2|25|tr
      Zap/15-1  (macro-dialexternal s            2   )      Up Dial          Zap/g0/4311449@inbound-ldcp
      Zap/14-1  (inbound-ldcp s            1   )      Up Bridged Call  Zap/2-2
5 active channel(s)
Jul 22 13:03:35 WARNING[2244619]: channel.c:489 ast_channel_walk_locked: Avoided deadlock for 'Zap/2-2', 10 retries!
pbx*CLI> soft hangup zap/2-2
zap/2-2 is not a known channel

I can't restart asterisk even 'asterisk -rx "restart now"'
only "killall -9 mpg123 asterisk" can solve this problem.
Comments:By: Olle Johansson (oej) 2004-07-22 08:23:45

To complete this bug report we need
- version of Asterisk you are using
- information on the platform - os and distribution and version
- information if you have any special hardware installed (zaptel, capi etc)

By: jameson192 (jameson192) 2004-07-22 15:38:17

I get a similar error on "Asterisk CVS-HEAD-07/08/04-13:28:24 built by root@PBX on a i686 running Linux", Redhat 7.2 with two TDM400 w/ FXO modules. It happens for both Zap channels and SIP channels.

Jul 22 16:13:45 WARNING[13325]: channel.c:489 ast_channel_walk_locked: Avoided deadlock for 'SIP/haungs-e047', 10 retries!

Although I don't think users dialtone's are affected, atleast no one has complained about it yet. It happens to almost all of my SIP channels and most ZAP channels once in a while, both Cisco 7940 and Grandstream phones.

By: jimkou (jimkou) 2004-07-22 19:39:42

-Asterisk CVS-HEAD-07/21/04-08:14:32 built by root@pbx on a i686 running Linux
-Slackware 9.0 on Gigabyte 8EGXR Server Board, P4 2.8GHz, 1GB Ram
-T100P*2, CarrierAccess ABI * 2(fxo:9-12,21,23  fxs:1-8,13-20,25-48)

cat /proc/interrupts
          CPU0
 0:  212199316          XT-PIC  timer
 1:       8798          XT-PIC  keyboard
 2:          0          XT-PIC  cascade
 3: 2121856505          XT-PIC  t1xxp
 4: 2121890232          XT-PIC  t1xxp
 5:    3070136          XT-PIC  eth0
12:       1923          XT-PIC  PS/2 Mouse
14:    1545094          XT-PIC  ide0
15:          0          XT-PIC  ide1
NMI:          0
ERR:          0

jameson:
When "Avoided deadlock" happens, can users make or receive call?
In my case the users can't make any call, If someone call them they got busy tone.

By: Mark Spencer (markster) 2004-07-22 19:42:42

What triggers this effect, and when did you see the problem begin to happen, either of you.

By: jimkou (jimkou) 2004-07-22 20:13:17

Actually, I have no idea on this. I noticed that because users complained their phone does'nt work.
I can't restart asterisk in CLI even process 'asterisk -rx "restart now"',
kill asterisk to force restart asterisk is the only way to fix the problem.

By: Mark Spencer (markster) 2004-07-22 20:47:13

We need to know what the "stuck" channel is doing, this would require a gdb attach and the hope that it was actually in some sort of deadlock situation.  If it's a question of a lock getting locked and never unlocked, it's more challenging to find.  We really need to know what the user is doing that triggers this situation.

By: jimkou (jimkou) 2004-07-22 21:10:06

Okay, I'll ask the user and report later.
Could you do me a favor? How can I force asterisk dump core?

By: Mark Spencer (markster) 2004-07-22 21:34:26

Don't dump core, just attach with gdb to the running process:

# gdb ./asterisk <pid of asterisk>
#
(gdb) info threads
.
.
.
(gdb) thread apply all bt

That'll be a start but it's most useful if you can find me on IRC to login to your system so I can look.

By: jimkou (jimkou) 2004-07-22 22:31:54

Thanks for the help.

I'm learning BitchX now, maybe I'll contact you tomorrow. :)

The user(A) told me that they was doing transfer call to another user(B),
user(B) pickup phone they got silence and both phone down.

By: Mark Spencer (markster) 2004-07-22 22:38:26

Zap transfer?

By: jimkou (jimkou) 2004-07-22 23:16:32

Yes Zap transfer, in my case the environment is pure zap set.
T100P*2 + CarrierAccess ABI*2

By: jimkou (jimkou) 2004-07-23 01:22:58

<bugnote-12220>

edited on: 07-26-04 20:14

By: jameson192 (jameson192) 2004-07-23 07:41:45

I added an example error log. When the error happens users do not complain about not being able to make or recieve calls. This does not happen with the old asterisk-stable branch.

By: Mark Spencer (markster) 2004-07-23 12:29:45

This debug appears to suggest a deadlock between threads 12 and 14.  However, I would need to login to the system to know for sure that this was the case.  Specifically I would need to know that the channel being locked in thread 12 is, in reality, the other leg of the three-way call.

By: Mark Spencer (markster) 2004-07-24 21:32:52

Okay if it's what I *think* it was, it should be fixed now in CVS, please try latest CVS and let me know if that gets it.

By: jimkou (jimkou) 2004-07-26 03:14:57

I upgrade asterisk to cvs-head this morning, but seems didn't work for me.
Until now, I got crash for 7 times... T_T

<bugnote-12403.txt>

edited on: 07-26-04 20:13

By: Mark Spencer (markster) 2004-07-26 13:04:54

Yes, sorry about that.  Please update again.

By: Mark Spencer (markster) 2004-07-26 21:08:44

This most recent debug does not appear to be from latest CVS based on the line numbers.  Please check out a clean copy of CVS and test with that.

By: jimkou (jimkou) 2004-07-26 21:49:22

I'm sure it's a clean cvs-head(remove asterisk sourece directory and cvs again)...
The asterisk crash immediate after upgrade to cvs-head :Q

<gdb-07272004-01.txt> & <gdb-07272004-02.txt>

By: Mark Spencer (markster) 2004-07-26 22:33:26

Just find me on IRC.

By: Mark Spencer (markster) 2004-07-28 17:30:50

What's the story here, still interested?  Have you beeen able to secure ssh access?

By: jimkou (jimkou) 2004-08-02 20:02:46

I change the dialplan last friday - dump all "local channel", works fine till today... so I *think* it's the "local channel" cause that problems!


previous version of extensions.conf:
 .
 .
 .
[inbound-pstn]
;============================================
; 外線撥入
;============================================
include => operator           ; å°Žå�‘自動總機
exten => t,1,Hangup           ; è‹¥ caller 沒有任何動作時, 直接 Hangup
exten => i,1,Playback(invalid)
 .
 .
 .
[operator]
exten => s,1,Answer                           ; 接è�½ä¾†é›»
exten => s,2,DigitTimeout,3                   ; Set Digit Timeout to 3 seconds
exten => s,3,ResponseTimeout,5                ; Set Response Timeout to 5 seconds
exten => s,4,SetLanguage(tw)                  ; é �設語言為 tw

include => operator-holiday|08:00-16:59|*|21|jun   ; 6/21 端å�ˆç¯€ä¼‘å�‡ä¸€å¤©
include => operator-holiday|08:00-16:59|*|30|jul   ; 7/30 å…¬å�¸æ—…é�ŠæŽ’休一天

include => operator-day|08:00-16:59|Mon-Fri|*|*    ; 上ç�­ - 週一 ~ 周五
include => operator-day|08:00-11:59|Sat|*|*        ; 上ç�­ - 週六早上

include => operator-night                          ; 下ç�­æ™‚é–“

exten => _[1-5]NXX,1,SayDigits(${EXTEN})
exten => _[1-5]NXX,2,Playback(transfer)
exten => _[1-5]NXX,3,Dial(Local/${EXTEN}@extensions/n)
exten => _[1-5]NXX,4,Playback(pbx-invalid)

[operator-day]
exten => s,5,BackGround(operator-intro-day)   ; 撥放訊æ�¯è«‹å…¶è¼¸å…¥åˆ†æ©Ÿè™Ÿç¢¼

exten => 0,1,SetLanguage(en)                  ; 將語系設定為英語
exten => 0,2,Playback(pls-wait-connect-call)
exten => 0,3,Queue(salesq-en|tH|||45)         ; 置入佇列中等待行銷部å�Œä»�接è�½
exten => 0,4,Background(nbdy-avail-to-take-call)
exten => 0,5,Background(dial-ext-of-person)

exten => 1,1,Playback(transfer)
exten => 1,2,Queue(salesq|tH|||45)            ; 行銷部-佇列
exten => 1,3,Background(aa-nobodyavail)

exten => 2,1,Playback(transfer)
exten => 2,2,Queue(adq|tH|||45)               ; 管ç�†éƒ¨-佇列
exten => 2,3,Background(aa-nobodyavail)

exten => 3,1,Playback(transfer)
exten => 3,2,Queue(rdq|tH|||45)               ; 研發部-佇列
exten => 3,3,Background(aa-nobodyavail)

exten => 4,1,Playback(transfer)
exten => 4,2,Queue(pdq|tH|||45)               ; 生產部-佇列
exten => 4,3,Background(aa-nobodyavail)

exten => 9,1,Playback(transfer)
exten => 9,2,Queue(operatorq|tH|||45)         ; 總機人員-佇列
exten => 9,3,Background(aa-nobodyavail)

[operator-night]
exten => s,5,BackGround(operator-intro-night) ; 撥放訊�請其輸入分機號碼

[operator-holiday]
exten => s,5,BackGround(operator-intro-holiday) ; 撥放訊�請其輸入�絡窗�號碼

exten => 1,1,Playback(transfer)
exten => 1,2,Dial(${SALES})                   ; 行銷部è�¯çµ¡çª—å�£
exten => 1,3,Busy

exten => 2,1,Playback(transfer)
exten => 2,2,Dial(${AD})                      ; 管ç�†éƒ¨è�¯çµ¡çª—å�£
exten => 2,3,Busy

exten => 3,1,Playback(transfer)
exten => 3,2,Dial(${RD})                      ; 研發部è�¯çµ¡çª—å�£
exten => 3,3,Busy

exten => 4,1,Playback(transfer)
exten => 4,2,Dial(${PDPM})                    ; 生產部資æ��è�¯çµ¡çª—å�£
exten => 4,3,Busy

exten => 5,1,Playback(transfer)
exten => 5,2,Dial(${PDQC})                    ; 生產部å“�管è�¯çµ¡çª—å�£
exten => 5,3,Busy

exten => 6,1,Playback(transfer)
exten => 6,2,Dial(${CD})                   ; 高分å­�部è�¯çµ¡çª—å�£
exten => 6,3,Busy


new version of extensions.conf:
 .
 .
 .

[inbound-pstn]
;============================================
; 外線撥入
;============================================
include => operator           ; å°Žå�‘自動總機
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup           ; è‹¥ caller 沒有任何動作時, 直接 Hangup
exten => i,1,Playback(invalid)
 .
 .
 .
[operator]
exten => s,1,Answer                           ; 接è�½ä¾†é›»
exten => s,2,DigitTimeout,3                   ; Set Digit Timeout to 3 seconds
exten => s,3,ResponseTimeout,5                ; Set Response Timeout to 5 seconds
exten => s,4,SetLanguage(tw)                  ; é �設語言為 tw

include => operator-holiday|08:00-16:59|*|21|jun   ; 6/21 端å�ˆç¯€ä¼‘å�‡ä¸€å¤©
include => operator-holiday|08:00-16:59|*|30|jul   ; 7/30 å…¬å�¸æ—…é�ŠæŽ’休一天

include => operator-day|08:00-16:59|Mon-Fri|*|*    ; 上ç�­ - 週一 ~ 周五
include => operator-day|08:00-11:59|Sat|*|*        ; 上ç�­ - 週六早上

include => operator-night                          ; 下ç�­æ™‚é–“

exten => _[1-5]NXX,1,SayDigits(${EXTEN})
exten => _[1-5]NXX,2,Playback(transfer)
exten => _[1-5]NXX,3,Macro(dialinternal,${${EXTEN}},r1)

[operator-day]
exten => s,5,BackGround(operator-intro-day)   ; 撥放訊æ�¯è«‹å…¶è¼¸å…¥åˆ†æ©Ÿè™Ÿç¢¼

exten => 0,1,SetLanguage(en)                  ; 將語系設定為英語
exten => 0,2,Playback(pls-wait-connect-call)
exten => 0,3,Queue(salesq-en|tH|||45)         ; 置入佇列中等待行銷部å�Œä»�接è�½
exten => 0,4,Background(nbdy-avail-to-take-call)
exten => 0,5,Background(dial-ext-of-person)

exten => 1,1,Playback(transfer)
exten => 1,2,Queue(salesq|tH|||45)            ; 行銷部-佇列
exten => 1,3,Background(aa-nobodyavail)

exten => 2,1,Playback(transfer)
exten => 2,2,Queue(adq|tH|||45)               ; 管ç�†éƒ¨-佇列
exten => 2,3,Background(aa-nobodyavail)

exten => 3,1,Playback(transfer)
exten => 3,2,Queue(rdq|tH|||45)               ; 研發部-佇列
exten => 3,3,Background(aa-nobodyavail)

exten => 4,1,Playback(transfer)
exten => 4,2,Queue(pdq|tH|||45)               ; 生產部-佇列
exten => 4,3,Background(aa-nobodyavail)

exten => 9,1,Playback(transfer)
exten => 9,2,Queue(operatorq|tH|||45)         ; 總機人員-佇列
exten => 9,3,Background(aa-nobodyavail)

[operator-night]
exten => s,5,BackGround(operator-intro-night) ; 撥放訊�請其輸入分機號碼

[operator-holiday]
exten => s,5,BackGround(operator-intro-holiday) ; 撥放訊�請其輸入�絡窗�號碼

exten => 1,1,Playback(transfer)
exten => 1,2,Dial(${SALES})                   ; 行銷部è�¯çµ¡çª—å�£
exten => 1,3,Busy

exten => 2,1,Playback(transfer)
exten => 2,2,Dial(${AD})                      ; 管ç�†éƒ¨è�¯çµ¡çª—å�£
exten => 2,3,Busy

exten => 3,1,Playback(transfer)
exten => 3,2,Dial(${RD})                      ; 研發部è�¯çµ¡çª—å�£
exten => 3,3,Busy

exten => 4,1,Playback(transfer)
exten => 4,2,Dial(${PDPM})                    ; 生產部資æ��è�¯çµ¡çª—å�£
exten => 4,3,Busy

exten => 5,1,Playback(transfer)
exten => 5,2,Dial(${PDQC})                    ; 生產部å“�管è�¯çµ¡çª—å�£
exten => 5,3,Busy

exten => 6,1,Playback(transfer)
exten => 6,2,Dial(${CD})                      ; 高分å­�部è�¯çµ¡çª—å�£
exten => 6,3,Busy


ps.1 Sorry I was on vacation last week. :)
ps.2 SSH is secure.

By: Mark Spencer (markster) 2004-08-03 02:20:05

I'll take a look at local channel, glad to know your deadlock is no longer happening.

By: Digium Subversion (svnbot) 2008-01-15 15:03:26.000-0600

Repository: asterisk
Revision: 3505

U   trunk/channels/chan_zap.c

------------------------------------------------------------------------
r3505 | markster | 2008-01-15 15:03:26 -0600 (Tue, 15 Jan 2008) | 2 lines

Hold lock for three-way channel (bug ASTERISK-2079)

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

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