<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/3209/">https://reviewboard.asterisk.org/r/3209/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm not a fan of this patch for two reasons:
1) We're preventing a crash by introducing a memory leak.
2) The condition of undestroyed channels doesn't seem like enough to guarantee that the interfaces container is not currently being referenced
A more graceful fix is to replace the interfaces ao2_container in format.c with an ao2 global object. This way, each time a piece of code attempts to get the container, they will need to get a reference using ao2_global_obj_ref() (and check the function for a NULL return). This protects access to the container and guarantees that the container will not be freed as long as someone may be trying to use it.</pre>
<br />
<p>- Mark Michelson</p>
<br />
<p>On February 11th, 2014, 7:37 p.m. UTC, Scott Griepentrog wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers, Corey Farrell and n8ideas.</div>
<div>By Scott Griepentrog.</div>
<p style="color: grey;"><i>Updated Feb. 11, 2014, 7:37 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-23103">ASTERISK-23103</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This fixes a possible crash on shutdown by preventing ao2_unref of interfaces while channels are active.
Patch by cfarrell
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/11/main/format.c <span style="color: grey">(407957)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3209/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>