Summary:ASTERISK-19854: freeze channels showing in core show channels
Reporter:Jaxon (jaxon)Labels:
Date Opened:2012-05-09 04:00:35Date Closed:2012-05-30 12:21:52
Versions: Frequency of
Environment:libpri 1.4.12, dahdi 2.4.0, Ubuntu-server 10.04 32 bitAttachments:( 0) backtrace.txt
( 1) core-show-locks.txt
( 2) jira_asterisk_19854_v1.8.6.patch
Description:session Hangs while execute "pri show channels" or "dahdi show channels" from ami socket or asterisk -rx "" command. and "core show channels" shows some freeze channels. How to solve this?

I traced this problem, when I was using ami connection from my web server to asterisk server, Actualy I am doing "pri show channels" through ami socket for detecting free channels. sometimes this ami script hangs in between. I traced that while executing this command from AMI it hangs a ami session. Also "pri show channels" command on asterisk CLI shows empty output.

this also happen with asterisk -rx "pri show channels" and asterisk -rx "dahdi show channels". This error occurs anytime. IF I execute above commands then bash command gives no output and to exit from the command I have to do Ctrl+C to come out.

But there is no problem with calls. I can originate call from CLI.

if i type pri show channels in CLI then it gives me blank output.

I discussed this problem in IRC, And as per sugetion of Experts I have opened ticket here. Please help me to solve this problem.
Comments:By: Matt Jordan (mjordan) 2012-05-09 08:06:05.390-0500

Debugging deadlocks: Please select DEBUG_THREADS and DONT_OPTIMIZE in the Compiler Flags section of menuselect. Recompile and install Asterisk (i.e. make install).  This will then give you the console command "core show locks." When the symptoms of the deadlock present themselves again, please provide output of the deadlock via:

# asterisk -rx "core show locks" | tee /tmp/core-show-locks.txt
# gdb -se "asterisk" <pid of asterisk> | tee /tmp/backtrace.txt
gdb> bt
gdb> bt full
gdb> thread apply all bt

Then attach the core-show-locks.txt and backtrace.txt files to this issue. Thanks!

By: Jaxon (jaxon) 2012-05-09 12:25:44.806-0500

Ok Matt,

I will paste both file here when I encounter same issue again.

By: Jaxon (jaxon) 2012-05-12 14:04:54.551-0500

Hi Matt,

I am attaching here backtrace.txt and core-show-locks.txt

By: Jaxon (jaxon) 2012-05-12 14:16:42.139-0500

Hi Matt,

Please find attached files.


By: Jaxon (jaxon) 2012-05-12 14:36:49.235-0500

Hello Matt,

Can you Please check attached files to trace the issue..

By: Richard Mudgett (rmudgett) 2012-05-14 10:16:28.443-0500

The backtrace.txt file is empty.  You need to run gdb with the same permissions as asterisk to get the needed backtrace.

By: Jaxon (jaxon) 2012-05-23 06:19:07.053-0500

Hello Richard,

I have taken backtrace at the time when problem occurs. I have used same user from which asterisk running. But still backtrace.txt file shows empty?

Can you Please guide on this..

this is happening on my production server..Is this Bug in asterisk? Can you throw some light on this issue.

By: Richard Mudgett (rmudgett) 2012-05-23 09:55:31.374-0500

After taking a closer look at the [^core-show-locks.txt] file, it looks like sig_pri_lock_owner() is not avoiding deadlock properly.  I am surprised that this has not been an issue before.

By: Richard Mudgett (rmudgett) 2012-05-23 12:33:48.012-0500

[^jira_asterisk_19854_v1.8.6.patch] should fix your deadlock problem.  It fixes the deadlock avoidance code in sig_pri_lock_owner().

Please test.

By: Richard Mudgett (rmudgett) 2012-05-29 16:06:58.382-0500


By: Jaxon (jaxon) 2012-05-30 00:30:10.967-0500

Hi Richards,

It seems that problem has been gone away. I am using this patch with asterisk 1.8.12 version also. Thanks for your efforts and valuable support.