Deadlock

I’ve been trying to troubleshoot * locking up on me. I was curious if someone could explain what these messages mean and if it’s something that I should be worried about or that could be causing * to be locking up on me.

I simply grepped for deadlock in my logfile.

Jan 31 16:33:46 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-b6fe,2’
Jan 31 16:33:47 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-648d,2’
Jan 31 16:33:48 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-f5ab,2’
Jan 31 16:34:02 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-f504,2’
Jan 31 16:34:14 DEBUG[7429] channel.c: Avoiding initial deadlock for 'SIP/10.0.4.2-091bb4e8’
Jan 31 16:34:21 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-e75e,2’
Jan 31 16:34:21 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-e75e,2’
Jan 31 16:34:21 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-e75e,2’
Jan 31 16:34:21 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-e75e,2’
Jan 31 16:34:29 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-759d,2’
Jan 31 16:34:32 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-0909,2’
Jan 31 16:34:35 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-adb0,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3afa,2’
Jan 31 16:37:04 WARNING[7429] channel.c: Avoided initial deadlock for ‘0x90f68b8’, 10 retries!
Jan 31 16:37:07 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-1048,2’
Jan 31 16:37:10 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-da3b,2’
Jan 31 16:37:12 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-4cc3,2’
Jan 31 16:37:15 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-315a,2’
Jan 31 16:37:17 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-3647,2’
Jan 31 16:37:21 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-e25e,2’
Jan 31 16:37:22 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-9e9b,2’
Jan 31 16:37:22 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-9e9b,2’
Jan 31 16:37:22 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-9e9b,2’
Jan 31 16:37:22 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-9e9b,2’
Jan 31 16:37:24 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-eff0,2’
Jan 31 16:37:27 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2313240@examplecontext-a8d7,2’
Jan 31 16:37:28 DEBUG[7429] channel.c: Avoiding initial deadlock for 'Local/2303240@examplecontext-a0c8,2’
Jan 31 16:37:31 DEBUG[7429] channel.c: Avoiding initial deadlock for ‘Local/2313240@examplecontext-902d,2’
.

Next step is

http://www.voip-info.org/wiki/index.php?page=Asterisk+deadlock

How far along are you with this? Does your situation match the signs/symptoms described?

Have you tried a complete make clean and recompile?

Yeah, I’ve read that document and it does match those symptoms when it deadlocks. The messages above are pretty much being logged all the time and its locked up a total of 4 times in the past 5 months.

I think I’m going to try a newer version of asterisk. Right now I’m on 1.2.11 rev 40948 and I’ll likely be moving to 1.2.13 rev 47264. I noticed some deadlock fixes in the changelog between these versions.

I didn’t just pick these versions out of the sky. I’m using trixbox 1.2.2 currently (which has * 1.2.11) and am going to install trixbox 2.0 (which has * 1.2.13).

I haven’t recompiled yet, so far I’ve just been trying to determine what exactly was breaking.

My main question is: What are these messages telling me?

Is it "A deadlock almost occured, but I’m a good little * and I caught it"
Or “Hey, you got some problems bud and I saved your butt this time but I’m not sure if I can do it again”?

From a non-asterisk document on databases I found the following definition:

A deadlock exists whenever two or more processes,
which are vying for the same resources, reach an
impasse.

In this context, according to your debug channel.c is trying to establish a connection, but some other * process else already has an exclusive grip on essential related resources.