Summary:ASTERISK-21823: Segfault when autoload=yes in modules.conf
Reporter:Dolf Schimmel -- Freeaqingme (Freeaqingme)Labels:
Date Opened:2013-05-25 12:31:56Date Closed:2013-06-14 15:09:22
Versions:11.4.0 Frequency of
Description:I performed the following steps on an Ubuntu 12.04 machine:
curl http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz | tar -xvz -C /var/lib/puppet/src/asterisk --strip 1
make install{quote}

After setting up some very minimal configuration, asterisk just works. However, the moment I set the autoload directive to 'yes' in my modules.conf I get a segementation fault while starting Asterisk.

# gdb asterisk
(gdb) run -f /etc/asterisk/asterisk.conf -vvvvvv -g -dddddd -c

app_milliwatt.so => (Digital Milliwatt (mu-law) Test Application)
 == Registered custom function 'AES_DECRYPT'
 == Registered custom function 'AES_ENCRYPT'
func_aes.so => (AES dialplan functions)
 == Registered custom function 'SYSINFO'
func_sysinfo.so => (System information related functions)
 == Registered application 'MinivmRecord'
 == Registered application 'MinivmGreet'
 == Registered application 'MinivmNotify'
 == Registered application 'MinivmDelete'
 == Registered application 'MinivmAccMess'
 == Registered application 'MinivmMWI'
 == Registered custom function 'MINIVMACCOUNT'
Destroyed memory objects...
Failed to load configuration file. Module activated with default settings.
 == Registered custom function 'MINIVMCOUNTER'
app_minivm.so => (Mini VoiceMail (A minimal Voicemail e-mail System))
 == Registered custom function 'VERSION'
func_version.so => (Get Asterisk Version/Build Info)
 == Registered application 'ForkCDR'
app_forkcdr.so => (Fork The CDR into 2 separate entities)
Unable to load config phone.conf
 == Registered application 'Transfer'
app_transfer.so => (Transfers a caller to another extension)
 == Registered custom function 'PITCH_SHIFT'
func_pitchshift.so => (Audio Effects Dialplan Functions)
 == Registered custom function 'DIALGROUP'
func_dialgroup.so => (Dialgroup dialplan function)
 == Registered application 'SoftHangup'
app_softhangup.so => (Hangs up the requested channel)
 == Registered custom function 'VMCOUNT'
func_vmcount.so => (Indicator for whether a voice mailbox has messages in a given folder.)
 == Registered application 'SendURL'
app_url.so => (Send URL Applications)
 == Registered custom function 'CUT'
 == Registered custom function 'SORT'
func_cut.so => (Cut out information from a string)
Unable to load config dundi.conf
 == Registered custom function 'HANGUPCAUSE'
 == Registered custom function 'HANGUPCAUSE_KEYS'
No follow me config file (followme.conf), so no follow me
 == Registered application 'HangupCauseClear'
func_hangupcause.so => (HANGUPCAUSE related functions and applications)
 == Registered custom function 'LOCK'
 == Registered custom function 'TRYLOCK'
 == Registered custom function 'UNLOCK'
[New Thread 0x7fffb0611700 (LWP 3852)]
func_lock.so => (Dialplan mutexes)
pbx_loopback.so => (Loopback Switch)
Unable to load config unistim.conf
Parsing /etc/asterisk/extensions.conf
 == Parsing '/etc/asterisk/extensions.conf': Found
Parsing /etc/asterisk/users.conf
 == Parsing '/etc/asterisk/users.conf': Found

Program received signal SIGSEGV, Segmentation fault.
ast_hashtab_start_traversal (tab=0x0) at hashtab.c:711
711 it->next = tab->tlist;
(gdb) backtrace
#0  ast_hashtab_start_traversal (tab=0x0) at hashtab.c:711
#1  0x000000000052e1cc in ast_merge_contexts_and_delete (extcontexts=0x7fffb3f38d20, exttable=0x13fc960,
   registrar=0x7fffb3d36c98 "pbx_config") at pbx.c:8676
#2  0x00007fffb3d346d1 in pbx_load_module () at pbx_config.c:1855
#3  pbx_load_module () at pbx_config.c:1871
#4  load_module () at pbx_config.c:1877
#5  0x00000000004f18c5 in start_resource (mod=0xe77ee0) at loader.c:845
#6  0x00000000004f2526 in start_resource (mod=<optimized out>) at loader.c:841
#7  load_resource_list (load_order=0x7fffffffc370, global_symbols=0, mod_count=0x7fffffffc38c) at loader.c:1045
#8  0x00000000004f3965 in load_modules (preload_only=0) at loader.c:1198
#9  0x00000000004272bd in main (argc=<optimized out>, argv=<optimized out>) at asterisk.c:4180

Please let me know if there's anything else I can do to help reproduce or debug this issue. Perhaps there's a very logical explanation, but I figured a segmentation fault is not what should happen nonetheless ;)

Thanks for making an awesome product!
Comments:By: Rusty Newton (rnewton) 2013-05-30 17:07:18.406-0500

1. Rename extensions.conf and users.conf to *.bak and try again. Looks like it's crashing due to something during parsing of those config files. Let us know what happens. If it looks like it only crashes when reading those config files, then attach them to the issue so we can have a look. (assuming they are not nine billion lines long)

2. Attach complete backtraces of your core file following the instructions here: https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

3. Attach another debug log showing Asterisk's startup. Verify VERBOSE and DEBUG are turned on and turned up to level 5 at least.

By: Rusty Newton (rnewton) 2013-05-30 17:08:10.853-0500

Note: to attach debug (More Actions > Attach Files). We don't want them inline.

By: Rusty Newton (rnewton) 2013-06-14 15:09:04.574-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines