Summary:ASTERISK-22757: segfault in res_clialiases.so on reload when mapping "module reload" command
Reporter:Kingsley Tart (skycomltd)Labels:
Date Opened:2013-10-24 03:41:57Date Closed:2014-02-03 20:22:51.000-0600
Versions:11.2.0 Frequency of
One Time
Environment:Centos 6.4 64bit Asterisk 11.2-cert2 glibc-2.12-1.107.el6_4.2.x86_64Attachments:( 0) backtrace.txt
( 1) cli_aliases.conf
Description:I performed a reload and asterisk crashed. There were a couple of new dynamic features changed and quite a lot of dialplan changes.

kernel: asterisk[17869]: segfault at 0 ip 00007f57848b1eec sp 00007f577a558cc8 error 4 in res_clialiases.so[7f57848b1000+2000]

backtrace attached
Comments:By: Kingsley Tart (skycomltd) 2013-10-24 03:42:38.683-0500

gdb backtrace

By: Rusty Newton (rnewton) 2013-10-25 18:33:12.251-0500

Any way you can reproduce this one with Asterisk compiled without optimizations? The backtrace may still be useful, but I thought I'd ask.

By: Kingsley Tart (skycomltd) 2013-10-25 18:51:00.919-0500

Unfortunately I don't think we are going to be able to reproduce it. The server concerned had an older snapshot of a new dialplan for a customer to test and then was updated with the latest development copy. We only have live releases in version control so without having the same starting point before the reload I doubt it will crash again.
If you could let me know what changes I can make to the build options (untick all optimisation settings) that would help in the future then I can do that on our staging server so any backtraces would be more useful if it happens again in the future.

By: Matt Jordan (mjordan) 2013-10-26 20:30:55.005-0500

It actually looks like it was an invalid {{cli_aliases.conf}} that did it. Can you attach that {{conf}} file?

I've played around with creating a few invalid {{cli_aliases.conf}} files, but haven't been able to reproduce a crash yet.

By: Kingsley Tart (skycomltd) 2013-10-27 10:19:07.430-0500

Here is the cli_aliases.conf file. Its not a feature we have made use of so its probably the default one which came with 11.2-cert1.

By: Corey Farrell (coreyfarrell) 2013-10-27 18:22:20.612-0500

Steps to cause segfault (I think on any current version, not just 11.x):
1) Start asterisk with cli_aliases.conf having reload=module reload
2) touch cli_aliases.conf (change timestamp to force reload)
3) From cli run 'reload'.  You will see warnings from cli.c about the reload command.
4) Press tab in asterisk CLI for command completion.  Segfault.

I know this isn't exactly how the segfault happened for Gareth, but since backtrace.txt shows the 'reload' alias in use I suspect it could be the same root cause (failure to remove the reload command alias).

By: Matt Jordan (mjordan) 2013-10-27 20:29:35.428-0500

Thanks for the reproduction Corey - I don't think I actually mapped the reload command when I was trying to reproduce it.