[asterisk-bugs] [Asterisk 0018975]: [patch] chan_misdn segfaults when DEBUG_THREADS is enabled 1.8.4-rc4

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 31 15:11:42 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18975 
====================================================================== 
Reported By:                irroot
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18975
Category:                   Channels/chan_misdn
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:           1.8.2.4 
JIRA:                        
Regression:                 No 
Reviewboard Link:           https://reviewboard.asterisk.org/r/1145 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-03-15 09:16 CDT
Last Modified:              2011-03-31 15:11 CDT
====================================================================== 
Summary:                    [patch] chan_misdn segfaults when DEBUG_THREADS is
enabled 1.8.4-rc4
Description: 
This has caused me much frustration and pain will post a simple 1 line
patch to fix the problem.

when DEBUG_THREADS is enabled in 1.8.4-rc2 is enabled chan_misdn causes
asterisk to blow up this is related to mutex tracking somehow have a
trivial fix for it but not a reasonable explanation.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0018194 [patch] Loading chan_iax2.so allocates ...
====================================================================== 

---------------------------------------------------------------------- 
 (0133226) svnbot (reporter) - 2011-03-31 15:11
 https://issues.asterisk.org/view.php?id=18975#c133226 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 312022

U   branches/1.8/channels/chan_misdn.c

------------------------------------------------------------------------
r312022 | rmudgett | 2011-03-31 15:11:41 -0500 (Thu, 31 Mar 2011) | 14
lines

chan_misdn segfaults when DEBUG_THREADS is enabled.

The segfault happens because jb->mutexjb is uninitialized from the
ast_malloc().  The internals of ast_mutex_init() were assuming a nonzero
value meant mutex tracking initialization had already happened.  Recent
changes to mutex tracking code to reduce excessive memory consumption
exposed this uninitialized value.

Converted misdn_jb_init() to use ast_calloc() instead of ast_malloc().
Also eliminated redundant zero initialization code in the routine.

(closes issue https://issues.asterisk.org/view.php?id=18975)
Reported by: irroot

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-31 15:11 svnbot         Note Added: 0133226                          
======================================================================




More information about the asterisk-bugs mailing list