[Asterisk-code-review] RFC: ao2 reference storage location logging. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Aug 25 15:33:21 CDT 2016


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/3141

to look at the new patch set (#5).

Change subject: RFC: ao2 reference storage location logging.
......................................................................

RFC: ao2 reference storage location logging.

This change enables recording of additional information to the REF_DEBUG
log.  References can be associated with pointers and object sizes are
recorded.  This allows refcounter.py to filter out any references with
matching unrefs.  Leaked references can be associated with a memory
offset within another leaked object, marking the object as indirectly
leaked.  Logging storage locations is especially useful for certain
object types like formats that are long lived and widely used.

No attempt is made to report an error if the refs log says that a
pointer has been overwritten.  It is assumed this is the result of an
object being stored in an ao2_container where the object is associated
with offset 0 of the container.  The same can be done for linked lists
and vectors, though it is not automatic.  This is also needed to support
ao2_s_replace, and we add the new reference before removing the old
reference.

The refcounter.py script has been rewritten to use classes.  I attempted
to rework the procedural script to perform the new features but I felt
the code was becoming unreadable.  The updated refcounter.py takes
longer to run, but this is due to associating refs and unrefs together.
I feel that having an automated process take longer is worth the savings
in time spent manually reviewing the output.

ASTERISK-26171

Change-Id: Iacb0a51cefaa98c83eab18aa2b7d18850bb33951
---
M channels/chan_sip.c
M contrib/scripts/refcounter.py
M include/asterisk/astobj2.h
M include/asterisk/utils.h
M main/astobj2.c
M main/astobj2_container.c
M main/astobj2_container_private.h
M main/astobj2_hash.c
M main/astobj2_rbtree.c
M main/channel_internal_api.c
M main/format_cap.c
M res/res_musiconhold.c
12 files changed, 576 insertions(+), 271 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/41/3141/5
-- 
To view, visit https://gerrit.asterisk.org/3141
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iacb0a51cefaa98c83eab18aa2b7d18850bb33951
Gerrit-PatchSet: 5
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list