<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8525">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Backport compatible MALLOC_DEBUG changes.<br><br>* Add support for MALLOC_DEBUG and DEBUG_CHAOS to be used together.<br>* Add utils/astmm.c to .gitignore.<br>* Fix MALLOC_DEBUG variant of __ast_vasprintf. This function called<br> va_end(ap) upon allocation failure. This is incorrect since ap is<br> passed as an argument.<br><br>Change-Id: I9f27ced4ce3cbe4b39547a67f994fdff491978c0<br>---<br>M build_tools/cflags.xml<br>M main/astmm.c<br>M utils/.gitignore<br>3 files changed, 3 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/build_tools/cflags.xml b/build_tools/cflags.xml<br>index f05f428..c4f9458 100644<br>--- a/build_tools/cflags.xml<br>+++ b/build_tools/cflags.xml<br>@@ -78,11 +78,9 @@<br> <support_level>extended</support_level><br> </member><br> <member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations"><br>- <conflict>DEBUG_CHAOS</conflict><br> <support_level>core</support_level><br> </member><br> <member name="DEBUG_CHAOS" displayname="Randomly FAIL memory allocations or other operations"><br>- <conflict>MALLOC_DEBUG</conflict><br> <support_level>core</support_level><br> </member><br> <member name="ADDRESS_SANITIZER" displayname="Address Sanitizer"><br>diff --git a/main/astmm.c b/main/astmm.c<br>index accd2ff..3a07f39 100644<br>--- a/main/astmm.c<br>+++ b/main/astmm.c<br>@@ -216,6 +216,8 @@<br> unsigned int *fence;<br> int hash;<br> <br>+ DEBUG_CHAOS_RETURN(DEBUG_CHAOS_ALLOC_CHANCE, NULL);<br>+<br> if (!(reg = malloc(size + sizeof(*reg) + sizeof(*fence)))) {<br> astmm_log("Memory Allocation Failure - '%d' bytes at %s %s() line %d\n",<br> (int) size, file, func, lineno);<br>@@ -653,7 +655,6 @@<br> size = vsnprintf(&s, 1, fmt, ap2);<br> va_end(ap2);<br> if (!(*strp = __ast_alloc_region(size + 1, FUNC_VASPRINTF, file, lineno, func, 0))) {<br>- va_end(ap);<br> return -1;<br> }<br> vsnprintf(*strp, size + 1, fmt, ap);<br>diff --git a/utils/.gitignore b/utils/.gitignore<br>index dbdc6b6..7840265 100644<br>--- a/utils/.gitignore<br>+++ b/utils/.gitignore<br>@@ -3,6 +3,7 @@<br> aelparse.c<br> ast_expr2.c<br> ast_expr2f.c<br>+astmm.c<br> astman<br> astcanary<br> astdb2bdb<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8525">change 8525</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8525"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I9f27ced4ce3cbe4b39547a67f994fdff491978c0 </div>
<div style="display:none"> Gerrit-Change-Number: 8525 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>