[asterisk-dev] [Code Review] 3209: Crash in ast_format_cmp on shutdown

Scott Griepentrog reviewboard at asterisk.org
Fri Mar 14 13:05:34 CDT 2014



> On March 13, 2014, 3:40 p.m., Corey Farrell wrote:
> > /branches/11/main/format.c, line 1119
> > <https://reviewboard.asterisk.org/r/3209/diff/2/?file=55881#file55881line1119>
> >
> >     I think this condition still needs !ast_undestroyed_channels().  If we have undestroyed channels then find_interface will be called many times per second.  format_attr_shutdown could free interfaces after find_interface has already checked it, allowing ao2_find on either an already freed or NULL pointer.

I think to resolve that properly would require a lock interaction between find_interfaces and shutdown, which would be a significant performance impact that should be avoided.  I'm not in favor of just leaking the memory due to shutdown order either.  I'll try Mark's suggestion of a ao2 global object instead.


- Scott


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3209/#review11181
-----------------------------------------------------------


On March 13, 2014, 12:37 p.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3209/
> -----------------------------------------------------------
> 
> (Updated March 13, 2014, 12:37 p.m.)
> 
> 
> Review request for Asterisk Developers, Corey Farrell and n8ideas.
> 
> 
> Bugs: ASTERISK-23103
>     https://issues.asterisk.org/jira/browse/ASTERISK-23103
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Alternate method to more safely shutdown interfaces container.  Set interface global to null first to avoid possible race condition, and also double check interfaces prior to all uses.
> 
> 
> Diffs
> -----
> 
>   /branches/11/main/format.c 410525 
> 
> Diff: https://reviewboard.asterisk.org/r/3209/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140314/ed8d9a12/attachment.html>


More information about the asterisk-dev mailing list