[asterisk-bugs] [Asterisk 0016311]: Recursion crash in pbx_ael.c

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Dec 24 00:51:59 UTC 2010


The following issue has been CLOSED 
====================================================================== 
https://issues.asterisk.org/view.php?id=16311 
====================================================================== 
Reported By:                dferrer
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16311
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 not fixable
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-11-23 08:11 CST
Last Modified:              2010-12-23 18:51 CST
====================================================================== 
Summary:                    Recursion crash in pbx_ael.c
Description: 
Attached extensions.ael makes asterisk crash on an 'ael reload'. Only
crashes for recursion >= 7, if delete 1 recursion step it doesn't crash.
Something about this is mentioned in
http://www.voip-info.org/wiki/view/Asterisk+AEL2:
"Macros have a serious limitation, in that one cannot recursively nest
macro calls deeper than 7 levels, due to limitations on thread stack
allocation sizes."

The insteresting thing is that only it crashes if attach via 'asterisk -r'
and do 'ael reload'. If I run within a console 'asterisk -vvvc' (or in tty9
if ran from asterisk init script) it doesn't crash, only crash if in
another tty I attach to asterisk process via asterisk -r. Because of that,
if I use /etc/init.d/asterisk script, pbx_ael.so gets loaded an compiled at
startup, when asterisk loads all its modules, but when I want to reload AEL
it crashes.

Attached bt and AEL code. If this is a thread stack allocation
restriction, I suggest to limit if-recursion to 7 levels, avoiding asterisk
crashes for "malformed" AEL code.
====================================================================== 

---------------------------------------------------------------------- 
 (0129937) tilghman (manager) - 2010-12-23 18:51
 https://issues.asterisk.org/view.php?id=16311#c129937 
---------------------------------------------------------------------- 
Unfortunately, there's no real fix for this, because as you correctly
pointed out, this is a problem inherent in the Macro application.  Some
uses will crash Asterisk at 7 levels deep (such as AEL), while others can
go to 12 levels deep without problems.  The real solution is to upgrade to
1.6.2 or 1.8, where subroutines have been changed to use Gosub, which does
not have this problem.  You can solve this for yourself by changing the
amount of stack allocated per thread in include/asterisk/utils.h
(AST_STACKSIZE is the define). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-23 18:51 tilghman       Note Added: 0129937                          
2010-12-23 18:51 tilghman       Status                   acknowledged => closed
2010-12-23 18:51 tilghman       Resolution               open => not fixable 
======================================================================




More information about the asterisk-bugs mailing list