Summary: | ASTERISK-17559: [patch] chan_misdn segfaults when DEBUG_THREADS is enabled 1.8.4-rc4 | ||
Reporter: | Gregory Hinton Nietsky (irroot) | Labels: | |
Date Opened: | 2011-03-15 09:16:46 | Date Closed: | 2011-03-31 15:12:36 |
Priority: | Critical | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_misdn |
Versions: | 1.8.3 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ( 0) chan_misdn_lock.patch | |
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. | ||
Comments: | By: Gregory Hinton Nietsky (irroot) 2011-03-20 05:19:26 https://reviewboard.asterisk.org/r/1145 By: Digium Subversion (svnbot) 2011-03-31 15:11:42 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 ASTERISK-17559) Reported by: irroot ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=312022 By: Digium Subversion (svnbot) 2011-03-31 15:12:36 Repository: asterisk Revision: 312023 _U trunk/ U trunk/channels/chan_misdn.c ------------------------------------------------------------------------ r312023 | rmudgett | 2011-03-31 15:12:35 -0500 (Thu, 31 Mar 2011) | 21 lines Merged revisions 312022 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r312022 | rmudgett | 2011-03-31 15:11:40 -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 ASTERISK-17559) Reported by: irroot ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=312023 |