Summary:ASTERISK-04474: [patch] res_agi.c, launch_netscript() does not handle any system call interuption
Reporter:Donny Kavanagh (donnyk)Labels:
Date Opened:2006-02-09 13:01:54.000-0600Date Closed:2008-01-15 16:47:25.000-0600
Versions:Frequency of
Environment:Attachments:( 0) res_agiv2.patch
Description:launch_netscript() within res_agi.c had no mechanism to handle any interuption, which could (and was caused) by running two agi scripts sequentially without any pause.

explanation from kevin:
"the problem is happening because FastAGI is getting called before the child process from the AGI call has been reaped, when the SIGCHLD comes in, it interrupts the system call and FastAGI does not handle that right"

****** STEPS TO REPRODUCE ******

exten => _4323,1,AGI(IVRRoute.php)
exten => _4323,2,AGI(agi://${IVR_IP}/${IVR_Args})

-- call a agi script, followed by another.  I'm not sure if the first must be non fast agi to trigger the effect.

-- This is not guaranteed to reproduce, it depends on system speed, load, etc. and who knows what other factors.


I wrote the patch for 1.2.4 as per kevins request.  Its very simple, so i'd imagine it will apply to trunk without issue.

My disclaimer is on file.

This may or may not be the most elegant solution, as i lack expirence with unix sockets.  So i'm open to suggestions.
Comments:By: Donny Kavanagh (donnyk) 2006-02-10 11:20:57.000-0600

bump, for this simple 2 second patch, resolving a functional bug in release trunk.

By: Donny Kavanagh (donnyk) 2006-02-11 23:07:27.000-0600

nothing changed, inadvertantally had some spaces instead of tabs in initial upload.

By: Donny Kavanagh (donnyk) 2006-02-14 10:00:14.000-0600


By: Kevin P. Fleming (kpfleming) 2006-02-14 17:38:34.000-0600

Committed to branch-1.2 and trunk. Thanks!

By: Digium Subversion (svnbot) 2008-01-15 16:47:24.000-0600

Repository: asterisk
Revision: 10108

U   branches/1.2/res/res_agi.c

r10108 | kpfleming | 2008-01-15 16:47:24 -0600 (Tue, 15 Jan 2008) | 2 lines

ensure that FastAGI launcher can handle system call interruption (issue ASTERISK-4474)



By: Digium Subversion (svnbot) 2008-01-15 16:47:25.000-0600

Repository: asterisk
Revision: 10109

_U  trunk/
U   trunk/res/res_agi.c

r10109 | kpfleming | 2008-01-15 16:47:24 -0600 (Tue, 15 Jan 2008) | 10 lines

Merged revisions 10021,10108 via svnmerge from

r10108 | kpfleming | 2006-02-14 18:36:57 -0600 (Tue, 14 Feb 2006) | 2 lines

ensure that FastAGI launcher can handle system call interruption (issue ASTERISK-4474)