[Home]

Summary:ASTERISK-20577: Asterisk deadlocks waiting for timer in res_timing_pthread while running AGI script
Reporter:Kien Kennedy (kiennd)Labels:
Date Opened:2012-10-18 01:37:05Date Closed:2013-04-19 11:00:45
Priority:CriticalRegression?
Status:Closed/CompleteComponents:Resources/res_timing_pthread
Versions:1.8.15.0 1.8.18.0 Frequency of
Occurrence
Occasional
Related
Issues:
is related toASTERISK-21389 res_timing_pthread fails to return from write, causing timer dependent operations to block indefinitely
Environment:CentOS 5.6, Asterisk source 1.8.15.0/1.8.18Attachments:( 0) backtrace-threads_1310.txt
( 1) config.php
( 2) core-show-locks_1310.txt
( 3) function.php
( 4) main.php
Description:Asterisk is being deadlock (no calling response, no cli command response) every 2-3 hours after running 1-2 months. The system load, CPU, RAM are fine.
Comments:By: Matt Jordan (mjordan) 2012-10-18 08:46:13.202-0500

The deadlock appears to occur when {{res_timing_pthread}}'s {{find_timer}} goes out to lunch and never comes back.  A number of things using the timing source then start to block, including MoH and your AGI script.

What is your AGI script doing?  It appears to be executing an EXEC of some sort - can you provide the AGI script so we can make sure nothing is being done that would affect the timing source?

Does this problem occur when you use an alternate timing source, such as {{res_timing_timerfd}}?

(Note that {{res_timing_pthread}} is a rather inefficient source of timing - see [Timing Interfaces|https://wiki.asterisk.org/wiki/display/AST/Timing+Interfaces] for more information)

By: Kien Kennedy (kiennd) 2012-10-18 09:58:05.637-0500

Thank Jordan. My AGI script (PHPAGI) is just used for managing customers to hearing MOH with mainly command return $agi->exec("Goto","MOH1"). Please look into attached files. I'm using asterisk 1.8 and i don't know how to replace of using timing_pthread by timing_timerfd, because when I noload timing_pthread the music on hold not working.

Regards,
KK

By: Matt Jordan (mjordan) 2013-01-15 08:46:10.007-0600

{quote}
I'm using asterisk 1.8 and i don't know how to replace of using timing_pthread by timing_timerfd, because when I noload timing_pthread the music on hold not working.
{quote}

You should have to just ensure that some other timing source other than {{res_timing_pthread}} is built, installed, and loaded. If MoH doesn't work when one of the other timing sources is definitely present, than that's whole different problem.

Please note that {{res_timing_pthread}} is extended support, and development support for it comes from the Asterisk open source developer community. Response times for this issue may reflect that.

By: Matt Jordan (mjordan) 2013-04-19 10:56:40.251-0500

There is a patch on ASTERISK-21389 that should prevent res_timing_pthread from blocking callers. That should resolve this issue.

If you test with that patch and this issue is still a problem, please let a bug marshal know in #asterisk-bugs and we will be happy to reopen this issue. Thanks!