[asterisk-dev] [Code Review] 2624: app_mixmonitor: Fix crashes caused by unloading app_mixmonitor while a MixMonitor is running on a channel

Joshua Colp reviewboard at asterisk.org
Fri Jun 14 11:09:54 CDT 2013


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

Ship it!


Applications and manager actions both bump the ref count automagically so when these are invoked you already can't unload, so bumping it up again should work fine. Looks good to me.

- Joshua Colp


On June 14, 2013, 4:05 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2624/
> -----------------------------------------------------------
> 
> (Updated June 14, 2013, 4:05 p.m.)
> 
> 
> Review request for Asterisk Developers, Joshua Colp, Matt Jordan, and Mark Michelson.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Unloading app_mixmonitor will cause a crash if a mixmonitor is running when you unload the module. I'm pretty sure this is because the mixmonitor thread's function is unloaded while it is running and this leads to a segfault.
> 
> Actually running the application or manager action should be fine I think since refcounts are bumped by core code that starts those functions. It's just what is going on between then and actually ending the mixmonitor that causes problems.
> 
> This patch fixes that by bumping the refcount for the module before executing the thread and releasing that reference upon exiting the thread (or if the thread fails to start, immediately after failure to start the thread).
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/apps/app_mixmonitor.c 391772 
> 
> Diff: https://reviewboard.asterisk.org/r/2624/diff/
> 
> 
> Testing
> -------
> 
> Performed unloads against app_mixmonitor while a mixmonitor was running.  They were appropriately rejected.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130614/715d39f2/attachment-0001.htm>


More information about the asterisk-dev mailing list