[asterisk-dev] [Code Review] 4141: Enable REF_DEBUG for ast_module_ref / ast_module_unref

Scott Griepentrog reviewboard at asterisk.org
Fri Jan 30 11:01:32 CST 2015


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



/branches/11/main/loader.c
<https://reviewboard.asterisk.org/r/4141/#comment24892>

    I would recommend using a variable name such as "ref_debug" to better describe it's purpose.


- Scott Griepentrog


On Nov. 2, 2014, 1:13 a.m., Corey Farrell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4141/
> -----------------------------------------------------------
> 
> (Updated Nov. 2, 2014, 1:13 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24479
>     https://issues.asterisk.org/jira/browse/ASTERISK-24479
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This change includes an ABI change with compatibility stubs for 11, 12 and 13.  The compatibility stubs will not be included in trunk.  The point of this change is to have each module create an AO2 object on load, and hopefully destroy it on unload.  This allows module reference count errors to be debugged through REF_DEBUG.
> 
> When REF_DEBUG is enabled:
> * adds an empty ao2 object to 'struct ast_module'
> * Allocate ao2 when the module is loaded
> * Perform an ao2_ref in each place where mod->usecount is manipulated.
> * ao2_cleanup on module unload.
> 
> 
> The passthrough of file, line and func is needed for the REF_DEBUG to be of any use, so without the ABI changes this is not useful.
> 
> The change to bridge_builtin_features.c ensures that the module cannot be manually unloaded, but is able to be unloaded during ast_module_shutdown.  Note ast_module_shutdown only happens during clean shutdown and does not actually run dlclose so this is safe.
> 
> 
> Diffs
> -----
> 
>   /branches/11/main/loader.c 426830 
>   /branches/11/include/asterisk/module.h 426830 
>   /branches/11/bridges/bridge_builtin_features.c 426830 
> 
> Diff: https://reviewboard.asterisk.org/r/4141/diff/
> 
> 
> Testing
> -------
> 
> Using tests/manager/originate with REF_DEBUG enabled.  When the change to bridge_builtin_features.c is omitted the test fails due to that one reference leak.
> 
> 
> Thanks,
> 
> Corey Farrell
> 
>

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


More information about the asterisk-dev mailing list