Summary:ASTERISK-10350: Seg fault with ael contexts if empty
Reporter:Darren Philips (dazza76)Labels:
Date Opened:2007-09-20 18:46:19Date Closed:2007-10-01 17:44:41
Versions:Frequency of
Environment:Attachments:( 0) 10777.diff
Description:A Segmentation Fault is Caused on reload if in an ael2 script has an empty context
Reproducibility is within 3 reloads
context Hello {


kernel: asterisk[21691]: segfault at 0000002a00000058 rip 0000002a99b5607f rsp 0000007fbfffd970 error 6
Comments:By: Steve Murphy (murf) 2007-09-21 23:52:07

dazza76-- I cannot reproduce this on my test system. I've done ael reloads till I'm blue in the face. I need you to recompile asterisk with no optimization; use make menuselect to do this. Run asterisk under gdb and get it to crash via your best magic. upload a backtrace of the stack.

By: Darren Philips (dazza76) 2007-09-23 18:10:53

sorry Forgot to mention
only crashes when doing a

not a "ael reload"

which is why it took me so long to find it .

By: Steve Murphy (murf) 2007-09-29 14:54:34

dazza76 -- doesn't make much difference... still need a backtrace to figure out what happened. Please attach...

By: Joshua C. Colp (jcolp) 2007-10-01 09:42:51

I can confirm that this issue happens under 1.4 pbx_ael, but not trunk. Simply having an extensions.ael with only the above context causes it to crash even upon just loading.

By: Steve Murphy (murf) 2007-10-01 12:07:56

please download the attached fix; and report as to whether it works or not.
File (Josh) sent me a bt that made sense...  I still can't repro this bug, but
I can see how this can happen, and see also why I might not be able to repro it.(depends on what's laying around on the stack).

By: Steve Murphy (murf) 2007-10-01 12:53:39

Uh, I forget to mention this, because I guess I expect everyone to naturally know that if a change is made to pbx/ael/ael.y, then you need to (by hand), do:

cd pbx/ael; bison -v -d ael.y; cd ../..; make; make install

but I keep forgetting that not everyone automatically realizes this.

So, please, dazza76, apply the patch, apply bison as directed, and re-run your tests.

By: Dmitry Andrianov (dimas) 2007-10-01 13:47:33

just curious why this voodoo magic is not a part of Makefile...

By: Steve Murphy (murf) 2007-10-01 14:41:31

It is; well.... at least the rules are there. But we distrib the output of bison and  flex with the source, so the rules are deactivated, lest some accident of dating requires you to have bison/flex to finish the build. Because of the 'deactivation', the only way to get the effect at the moment is to type in the bison/flex commands by hand, because make pbx/ael/ael_lex.c won't work, because... well, try it and you'll see.

I'm glad the commands are left in the makefile; they act as a guide as to how to build the .c files from source.

By: Digium Subversion (svnbot) 2007-10-01 15:08:48

Repository: asterisk
Revision: 84239

U   branches/1.4/pbx/ael/ael.tab.c
U   branches/1.4/pbx/ael/ael.y
U   branches/1.4/pbx/pbx_ael.c

r84239 | murf | 2007-10-01 15:08:46 -0500 (Mon, 01 Oct 2007) | 1 line

closes issue ASTERISK-10350 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.

By: Digium Subversion (svnbot) 2007-10-01 17:44:41

Repository: asterisk
Revision: 84327

_U  trunk/
U   trunk/pbx/pbx_ael.c
U   trunk/res/ael/ael.tab.c
U   trunk/res/ael/ael.y
U   trunk/res/ael/pval.c

r84327 | murf | 2007-10-01 17:44:40 -0500 (Mon, 01 Oct 2007) | 9 lines

Merged revisions 84239 via svnmerge from

r84239 | murf | 2007-10-01 14:27:52 -0600 (Mon, 01 Oct 2007) | 1 line

closes issue ASTERISK-10350 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.