[asterisk-bugs] [Asterisk 0013202]: When I try to load asterisk it crashes

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Aug 1 23:43:08 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13202 
====================================================================== 
Reported By:                falves11
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   13202
Category:                   Core/AstMM
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     confirmed
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 134312 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-07-30 20:26 CDT
Last Modified:              2008-08-01 23:43 CDT
====================================================================== 
Summary:                    When I try to load asterisk it crashes
Description: 
Please see the attached files
====================================================================== 

---------------------------------------------------------------------- 
 (0091010) svnbot (reporter) - 2008-08-01 23:43
 http://bugs.digium.com/view.php?id=13202#c91010 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 135265

U   trunk/main/features.c
U   trunk/main/pbx.c

------------------------------------------------------------------------
r135265 | murf | 2008-08-01 23:43:07 -0500 (Fri, 01 Aug 2008) | 31 lines

(closes issue http://bugs.digium.com/view.php?id=13202)
Reported by: falves11
Tested by: murf

falves11 ==

The changes I introduce here seem to clear up the problem
for me. However, if they do not for you, please reopen this
bug, and we'll keep digging.

The root of this problem seems to be a subtle memory corruption
introduced when creating an extension with an empty extension
name. While valgrind cannot detect it outside of DEBUG_MALLOC
mode, when compiled with DEBUG_MALLOC, this is certain death.

The code in main/features.c is a puzzle to me. On the initial
module load, the code is attempting to add the parking extension
before the features.conf file has even been opened!

I just wrapped the offending call with an if() that will not
try to add the extension if the extension name is empty. THis
seems to solve the corruption, and let the "memory show allocations"
work as one would expect.

But, really, adding an extension with an empty name is a seriously
bad thing to allow, as it will mess up all the pattern matching 
algorithms, etc. So, I added a statement to the add_extension2 code to
return
a -1 if this is attempted.



------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=135265 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-01 23:43 svnbot         Note Added: 0091010                          
======================================================================




More information about the asterisk-bugs mailing list