Summary:ASTERISK-17898: Call Sent to invlaid Macro Asterisk crashes
Reporter:aroberts (aroberts)Labels:
Date Opened:2011-05-20 13:47:09Date Closed:2011-07-26 14:09:19
Versions: Frequency of
Environment:Attachments:( 0) backtrace.txt
( 1) backtrace2.txt
( 2) valgrind.txt
Description:When sending a call to a macro that doesn't exist Asterisk crashes.
Comments:By: Paul Belanger (pabelanger) 2011-05-20 16:19:04

Thank you for your bug report. In order to move your issue forward, we require a backtrace[1] from the core file produced after the crash.

Also, be sure you have DONT_OPTIMIZE enabled in menuselect within the Compiler Flags section, then:

make install

after enabling, reproduce the crash, and then execute the backtrace[1] instructions.

When complete, attach that file to this issue report.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

By: aroberts (aroberts) 2011-05-23 11:59:35

Back trace has been attached, and here is the error.
[May 23 10:58:54] WARNING[18577]: app_macro.c:302 _macro_exec: No such context 'macro-receive-fax' for macro 'receive-fax'
Disconnected from Asterisk server

By: Paul Belanger (pabelanger) 2011-05-23 14:25:55

Your bacetrace is optimized, you'll bee to follow the instructions on the wiki and upload a new one.

By: aroberts (aroberts) 2011-05-23 14:49:11

I have added the backtrace without optimize.

By: aroberts (aroberts) 2011-06-14 12:13:44.620-0500

Is there any other information that you need me to provide for this issue?

By: aroberts (aroberts) 2011-07-22 11:54:50.234-0500

There is a $500 bounty that has been placed at the link below.


By: Tilghman Lesher (tilghman) 2011-07-22 11:55:33.893-0500

Given where it's crashing, it is likely that the crash is due to memory corruption, which usually has to be tracked down with valgrind.

By: Jason Parker (jparker) 2011-07-22 11:56:27.462-0500

Example dialplan would help immensely.

By: aroberts (aroberts) 2011-07-22 14:23:50.999-0500

exten => 1234567890,1,macro(macro-invalid)

By: Mikael Carlsson (mickecarlsson) 2011-07-22 16:05:00.859-0500

aroberts: You should probably mention that you are using Asterisk realtime.
And provide your databas driver, odbc or mysql.

By: aroberts (aroberts) 2011-07-22 16:15:06.838-0500

yes we are using asterisk realtiome and our database driver is mysql.

By: Mikael Carlsson (mickecarlsson) 2011-07-23 03:46:26.734-0500

Switch to ODBC and test if that makes any difference.

By: Alec Davis (alecdavis) 2011-07-23 03:58:28.450-0500

Just setup my system, with realtime.

Asterisk built by root @ asterix on a i686 running Linux on 2011-07-23 06:44:41 UTC

Extension 802 should as I understand it be the basis of what you have.
mysql> select * from extensions;
| id | context  | exten | priority | app      | appdata                    |
| 14 | phones   | 802   |        1 | Macro    | macro-invalid              |

I get the expected result of:

  -- Starting simple switch on 'DAHDI/35-1'
   -- Executing Macro("DAHDI/35-1", "macro-invalid")
[2011-07-23 20:56:33.705257] WARNING[7743]: app_macro.c:302 _macro_exec: No such context 'macro-macro-invalid' for macro 'macro-invalid'
   -- Auto fallthrough, channel 'DAHDI/35-1' status is 'UNKNOWN'
   -- Hungup 'DAHDI/35-1'

By: aroberts (aroberts) 2011-07-25 11:44:19.460-0500

We have autofallthrough = no in extensions.conf which is required for part of our dialplan and the inbound calls are from SIP or IAX. I tested this with autofallthrough = yes, which is the default and the problem doesnt exist. We do need a patch for autofallthrough = no

By: Alec Davis (alecdavis) 2011-07-25 15:25:35.201-0500

aroberts: I also tried with autofallthrough=no and had no failure.
Just by having the 1 line for extension 802 like I have, is that enough to get yours to fail, with this all I was doing was dialling 802 from a SIP or DAHDI extension.

Or is it like orginally reported some other fax related dialplan (or application) launching into 'macro-receive-fax'.


By: aroberts (aroberts) 2011-07-25 15:36:35.939-0500

I was just able to duplicate it again with my appdata as macro-invalid and autofallthrough=no.

- Executing macro("SIP/removed-0000000e", "macro-invalid")
[Jul 25 14:32:16] WARNING[28678]: app_macro.c:302 _macro_exec: No such context 'macro-macro-invalid' for macro 'macro-invalid'

By: Richard Mudgett (rmudgett) 2011-07-25 16:46:00.577-0500

Since the bactraces indicate the crash happened during memory allocation, the the problem is likely memory corruption.  Valgrind is the tool to use to find memory corruption problems as Tilghman Lesher has already pointed out earlier.

By: aroberts (aroberts) 2011-07-25 18:11:56.660-0500

We have confirmed that if we take realtime out of the config it doesn't crash, but as soon as we try to call a invalid macro through realtime with mysql as the driver we get the crash. We will run this under valgrind tomorrow to see if it produces any useful information.

By: aroberts (aroberts) 2011-07-26 10:28:35.770-0500

Here is the output from Valgrind.

By: Russell Bryant (russell) 2011-07-26 14:09:13.372-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions