Review Board 1.7.16


Enable REF_DEBUG for ast_module_ref / ast_module_unref

Review Request #4141 - Created Nov. 2, 2014 and submitted

Corey Farrell
11, 13, trunk
ASTERISK-24479
Reviewers
asterisk-dev
Asterisk
This change includes an ABI change with compatibility stubs for 11 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.
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.
Total:
2
Open:
0
Resolved:
2
Dropped:
0
Status:
From:
Description From Last Updated Status
Review request changed
Updated (Feb. 11, 2015, 11:25 a.m.)
  • changed from pending to submitted
Committed in revision 431691

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.