Summary:ASTERISK-05694: deadlock errors
Reporter:Eldad Ran (eldadran)Labels:
Date Opened:2005-11-24 06:35:18.000-0600Date Closed:2011-06-07 14:10:17
Versions:Frequency of
Environment:Attachments:( 0) bt.txt
( 1) sip_debug.txt
Description:when having calls, I get this deadlock warning for each call, no matter what the load is, even on one call only.
WARNING[1484]: channel.c:784 channel_find_locked: Avoided initial deadlock for '0x8153c40', 10 retries!
Nothing much then that, doing 30 calls, didn't effect the system, just nagging, for now.
see the attached SIP debug, I've found a similar issue 5699, but couldn't add my case to it.


console verbose (you can see another error as well):
Nov 24 12:24:03 WARNING[1484]: channel.c:784 channel_find_locked: Avoided initial deadlock for '0x8153c40', 10 retries!
   -- Executing NoOp("SIP/teleconcept-f842", "") in new stack
   -- Executing Answer("SIP/teleconcept-f842", "") in new stack
   -- Executing Playback("SIP/teleconcept-f842", "please-enter-your") in new stack
   -- Playing 'please-enter-your' (language 'en')
 == Manager 'dialer' logged off from
   -- Executing Playback("SIP/teleconcept-f842", "telephone-number") in new stack
   -- Playing 'telephone-number' (language 'en')
   -- Executing BackGround("SIP/teleconcept-f842", "demo-congrats") in new stack
   -- Playing 'demo-congrats' (language 'en')
vox01*CLI> sip show channels
Peer             User/ANR    Call ID      Seq (Tx/Rx)  Form  Hold     Last Message  1234        3129d52f285  00102/00000  alaw  No       Tx: ACK        
1 active SIP channel
Nov 24 12:24:33 WARNING[1646]: file.c:583 ast_readaudio_callback: Failed to write frame
 == Spawn extension (loader, s, 5) exited non-zero on 'SIP/teleconcept-f842'
Comments:By: Olle Johansson (oej) 2005-11-24 08:08:32.000-0600

Which operating system? A clean asterisk or any third party addons?

By: Eldad Ran (eldadran) 2005-11-24 08:14:28.000-0600

Linux version 2.4.25-2mdksmp (nplanel@no.mandrakesoft.com) (gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)) #1 SMP

Clean Asterisk install, updated today from cvs-v1-2.
very basic installation, stripped down all unneeded modules, 39 modules are loaded, the only addon enabled is the cdr_mysql.
The dialplan playing is:
exten => s,1,NoOp(${DNID})
exten => s,n,Answer
exten => s,n,Playback('please-enter-your')
exten => s,n,Playback('telephone-number')
;exten => s,5,SendDTMF('1234567890*')
exten => s,n,BackGround(demo-congrats)
exten => s,n,BackGround(demo-congrats)
exten => s,n,BackGround(demo-congrats)

the other side disconnect after 30 seconds.

By: Eldad Ran (eldadran) 2005-11-24 08:14:52.000-0600

vox01*CLI> show modules
Module                         Description                              Use Count
res_musiconhold.so             Music On Hold Resource                   1        
res_indications.so             Indications Configuration                0        
res_monitor.so                 Call Monitoring Resource                 1        
res_agi.so                     Asterisk Gateway Interface (AGI)         0        
res_features.so                Call Features Resource                   1        
res_crypto.so                  Cryptographic Digital Signatures         1        
chan_sip.so                    Session Initiation Protocol (SIP)        0        
pbx_config.so                  Text Extension Configuration             0        
pbx_loopback.so                Loopback Switch                          1        
pbx_functions.so               Builtin dialplan functions               0        
app_dial.so                    Dialing Application                      0        
app_playback.so                Sound File Playback Application          0        
app_record.so                  Trivial Record Application               0        
app_senddtmf.so                Send DTMF digits Application             0        
app_macro.so                   Extension Macros                         0        
app_chanisavail.so             Check channel availability               0        
app_cdr.so                     Tell Asterisk to not maintain a CDR for  0        
app_cut.so                     Cut out information from a string        0        
app_read.so                    Read Variable Application                0        
app_setcdruserfield.so         CDR user field apps                      0        
app_eval.so                    Reevaluates strings                      0        
app_talkdetect.so              Playback with Talk Detection             0        
app_verbose.so                 Send verbose output                      0        
app_forkcdr.so                 Fork The CDR into 2 separate entities.   0        
app_dumpchan.so                Dump Info About The Calling Channel      0        
app_waitforsilence.so          Wait For Silence                         0        
app_mixmonitor.so              Mixed Audio Monitoring Application       0        
codec_gsm.so                   GSM/PCM16 (signed linear) Codec Translat 0        
codec_alaw.so                  A-law Coder/Decoder                      0        
codec_a_mu.so                  A-law and Mulaw direct Coder/Decoder     0        
format_gsm.so                  Raw GSM data                             0        
format_wav.so                  Microsoft WAV format (8000hz Signed Line 0        
format_wav_gsm.so              Microsoft WAV format (Proprietary GSM)   0        
format_pcm.so                  Raw uLaw 8khz Audio support (PCM)        0        
format_pcm_alaw.so             Raw aLaw 8khz PCM Audio support          0        
format_sln.so                  Raw Signed Linear Audio support (SLN)    0        
cdr_csv.so                     Comma Separated Values CDR Backend       0        
func_callerid.so               Caller ID related dialplan function      0        
cdr_addon_mysql.so             MySQL CDR Backend                        0        
39 modules loaded

By: Mark Spencer (markster) 2005-11-25 13:26:54.000-0600

Can you attach a deadlock backtrace? What arguments are you using for starting asteirsk?

By: Eldad Ran (eldadran) 2005-11-27 06:18:06.000-0600

Using the -p argument gives this error message, while using it without -p doesn't.

By: Eldad Ran (eldadran) 2005-11-27 07:02:30.000-0600

I was unable to debug this deadlock, I've enabled DEBUG in the Makefile, and attached gdb to asterisk but couldn't make a call while it is attached, see the attached 'thread apply all bt' result, attaching gdb after the call was init.

By: Kevin P. Fleming (kpfleming) 2005-12-12 20:44:55.000-0600

Your trace is incomplete; however, I would suggest that trying to operate Asterisk using realtime scheduling priority on such an old kernel is probably not wise. Is there anything else running on this server? If not, using -p will not provide any benefit at all, since Asterisk is the only process running, and in fact it could cause many other problems because threads will be handled in non-optimal ways (especially since you are not using the NPTL threading library).

By: Kevin P. Fleming (kpfleming) 2005-12-12 20:45:38.000-0600

Please reopen this bug if you can reproduce it using a more current kernel and threading library.