Summary:ASTERISK-18072: Segfault when using Directory()
Reporter:Andrew Parisio (parisioa)Labels:
Date Opened:2011-06-28 12:49:18Date Closed:2011-06-28 15:56:10
Versions: Frequency of
Environment:Two seperate servers running Debian Lenny 5.0, mysqlAttachments:( 0) coredump.txt
( 1) voicemail_users_sql.txt
Description:With the attached voicemail_users dataset * will segfault (it happens in my original install of, as well as for testing and writing this bug report).  If you remove all of the 4 digit mailboxes * will not segfault, same for removing all of the 6 digit mailboxes. The dataset has been cleaned, all of the names, emails, and other attributes have been set to be the same in an  attempt to narrow down the issue.  This table is from my production server with cleanup done to it.  This issue didn't happen until I had to reformat my server, after reformat * segfaults on the directory(default) app.

Import the entire voicemail_users table i've attached:
*run it as is, * will segfault.  
*delete from voicemail_users where length(mailbox) = 4
-No Segfault
*delete from voicemail_users where length(mailbox) = 6
-No Segfault

Dialplan is very simple, same result with just Directory(), or adding further options:
exten => 1997,1,Directory(default)

CLI Output:

*CLI>   == Using SIP RTP TOS bits 184
 == Using SIP RTP CoS mark 5
   -- Executing [1997@from-staff:1] Directory("SIP/1593-00000001", "default") in new stack
 == Parsing '/etc/asterisk/voicemail.conf':   == Found
Segmentation fault (core dumped)

JIRA appears broken, but i'm using addons for

I played with the code a bit, and it crashes at ast_load_realtime_multientry() in app_directory.c at line 458.  
Comments:By: Andrew Parisio (parisioa) 2011-06-28 12:49:55.986-0500

Coredump Backtrace

By: Andrew Parisio (parisioa) 2011-06-28 12:50:19.232-0500

voicemail_users table

By: Andrew Parisio (parisioa) 2011-06-28 15:56:10.108-0500

This bug was fixed by asterisk-addons-1.6.2 revision 1151 by seanbright.