Summary:ASTERISK-07872: Core Dump Loading AEL2 Config
Reporter:Douglas Garstang (dgarstang)Labels:
Date Opened:2006-10-04 11:58:35Date Closed:2006-10-04 15:08:28
Versions:Frequency of
Description:Can someone, like, add new apps to the category pull down? There's no pbx_ael there.

/etc/asterisk/extensions.ael contains:
#include "include/syst/extensions.ael"

/etc/asterisk/include/syst/extensions.ael contains:
context foo {

Asterisk seems to core dump loading pbx_ael.so

[Oct  4 03:47:09] NOTICE[17811]: pbx_ael.c:3798 pbx_load_module: Starting AEL load process.
[Oct  4 03:47:09] NOTICE[17811]: pbx_ael.c:3805 pbx_load_module: AEL load process: calculated config file name '/etc/asterisk/extensions.ael'.
[Oct  4 03:47:09] NOTICE[17811]: ael.flex:429 ael_yylex:   --Read in included file /etc/asterisk/include/syst/extensions.ael, 17 chars
[Oct  4 03:47:09] NOTICE[17811]: pbx_ael.c:3808 pbx_load_module: AEL load process: parsed config file name '/etc/asterisk/extensions.ael'.
[Oct  4 03:47:09] NOTICE[17811]: pbx_ael.c:3811 pbx_load_module: AEL load process: checked config file name '/etc/asterisk/extensions.ael'.
   -- Registered extension context 'foo'
Segmentation fault

Here's the bt from the core file. DONT_OPTIMIZE enabled.

(gdb) bt full
#0  0xb7223c15 in add_extensions (exten=0x0) at pbx_ael.c:3434
       last = (struct ael_priority *) 0x0
       pr = (struct ael_priority *) 0xbfc20f68
       label = 0x0
       __PRETTY_FUNCTION__ = "add_extensions"
#1  0xb7224c3e in ast_compile_ael2 (local_contexts=0xbfc20fd0, root=0x81b2d40) at pbx_ael.c:3779
       p = (pval *) 0x0
       p2 = (pval *) 0x0
       context = (struct ast_context *) 0x81b2bd0
       buf = "@(\033\b\000\000\000\000\000\000\000\000H(\033\b????\000\000\000\000?????????P??<\f¿2\000\000\000????\000\000\000\000?\a¿\037???\a¿????\034\b¿#\037????\b¿?6?\003\000\000\000j??\034\b¿?\201\001\000?\201\001\000?\a¿????L\b¿#\037??????\b¿?6?\001\000\000\000j??L\b¿\001\000\000\220\000\000\000\000??#???\016\000\000\000\001\000\000\220\000\000\000\000\000\000\000\000????\001\000\000\000?E\022\b?\f¿\001\000\000\000"...
       exten = (struct ael_extension *) 0xb721b168
       exten_list = (struct ael_extension *) 0x0
       __PRETTY_FUNCTION__ = "ast_compile_ael2"
#2  0xb7224e57 in pbx_load_module () at pbx_ael.c:3812
       errs = 0
       sem_err = 0
       sem_warn = 0
       sem_note = 0
       rfilename = 0xbfc20f90 "/etc/asterisk/extensions.ael"
       local_contexts = (struct ast_context *) 0x81b2bd0
       con = (struct ast_context *) 0x0
       parse_tree = (struct pval *) 0x81b2d40
       __PRETTY_FUNCTION__ = "pbx_load_module"
#3  0xb72250f8 in load_module () at pbx_ael.c:3901
No locals.
#4  0x080a1f70 in load_resource (resource_name=0x81712e8 "pbx_ael.so", global_symbols_only=0) at loader.c:629
       mod = (struct ast_module *) 0x81b27d0
       tmp = "\033[33;40mMD5 digest dialplan functions\033[0;37;40m\00040m\00040m\0007;40m\000ll\033[0;37;40m\0000m\000CE?????\026¿\b\021¿?\235?0?\026\b?H\022\b\v\000\000\000<\021?? \021??0?\026\b?\a?\000?\235?D'???\026¿8\021¿0\021?? \021???H\022\b\220?\026\b?\235?*\000\000\000.\000\000\000\003\000\000\000(\021?? \021??j\000\000\000\003\000\000\000\024\001\000\000D'??\220\235??"...
       __PRETTY_FUNCTION__ = "load_resource"
ASTERISK-1  0x080a2778 in load_modules (preload_only=0) at loader.c:814
       __list_next = (struct load_order_entry *) 0x0
       __list_prev = (struct load_order_entry *) 0x0
       __new_prev = (struct load_order_entry *) 0x81712d8
       cfg = (struct ast_config *) 0x816dfd8
       mod = (struct ast_module *) 0x0
       order = (struct load_order_entry *) 0x81712d8
       v = (struct ast_variable *) 0x0
       load_count = 68
       load_order = {first = 0x81712d8, last = 0x81712d8}
       res = 0
       dirent = (struct dirent *) 0xbfc21208
       dir = (DIR *) 0xb7f80bc0
       __PRETTY_FUNCTION__ = "load_modules"
ASTERISK-2  0x0806f304 in main (argc=3, argv=0xbfc21744) at asterisk.c:2778
       c = -1
       filename = "/root/.asterisk_history", '\0' <repeats 56 times>
       hostname = "vmtest1", '\0' <repeats 56 times>
       tmp = " V\026\b\034\000\000\0008???\233?\020\b\021\026¿?\025¿W?\016\b\001\000\000\000?\002??\023\026¿K\n??X\216\021\b8???\021\026¿DV\026\b?\025¿?\v???\025¿\201{\006\bh?\023\b"
       xarg = 0x0
       x = 3
       f = (FILE *) 0x816b430
       sigs = {__val = {134238211, 0 <repeats 31 times>}}
       num = -1209985704
       is_child_of_nonroot = 0
       buf = 0xbfc21688 "?\026¿\t?\020\b?=\025\b ?\025\b\024\026¿?\026¿????"
       runuser = 0x0
       rungroup = 0x0
       __PRETTY_FUNCTION__ = "main"

Comments:By: Serge Vecher (serge-v) 2006-10-04 12:35:08

pbx_ael is part of the "Core Asterisk", not an Application.

By: Serge Vecher (serge-v) 2006-10-04 12:36:13

please always post code/debug information/backtraces as an attachment, not inline text.

By: Douglas Garstang (dgarstang) 2006-10-04 12:44:41

Added 123 => 1,NoOp() to the foo context, and it was happy. Guess it doesn't like empty contexts.

By: Steve Murphy (murf) 2006-10-04 12:51:58


My first 2-second knee-jerk response is that the crash is due to the empty
context. I've fixed a crash on an empty extension already, and it would make sense that the same weakness applies to an empty context. Quick put something in there and see if that solves the problem. In the meantime, I'll code up a check and a semantic error/warning/whatever for that. The thing is, that contexts can get registered in the dialplan without anything necessarily being associated with them, but... do you see any benefit or need with this? I will most likely drop any empty contexts... As an alternative, I **could** define the context, and insert an "s" extension with a NoOp() call in it in such a case... what do you think would be best?
BTW, thanks for the report! It's good to have such input, to help solidify AEL!

By: Douglas Garstang (dgarstang) 2006-10-04 13:00:08

murf: yeah, I put a 123 => NoOp() in the foo context, and it did not core dump. My opinion would just be to quietly ignore any empty contexts. :)

By: Steve Murphy (murf) 2006-10-04 15:06:38

My fixes to this problem are reflected in 1.4 r. 44380
the trunk version is repaired via 44377.

I also fixed a crash waiting in the wings for empty files while I was at it.

By: Steve Murphy (murf) 2006-10-04 15:08:28

I hope the world will not judge me harshly for closing this bug so swiftly. I really thought it was time to do so!