[asterisk-dev] [Code Review] 3752: astobj2: Fix race condition in ref_debug log

Matt Jordan reviewboard at asterisk.org
Sat Jul 12 15:48:44 CDT 2014


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

(Updated July 12, 2014, 3:48 p.m.)


Status
------

This change has been discarded.


Review request for Asterisk Developers and Corey Farrell.


Repository: Asterisk


Description
-------

As Corey noticed, when an object's reference is changed rapidly the ref debug log will report the wrong reference. This is due to accessing the reference (which is not thread safe) prior to the reference count being changed. Since the change in reference count is returned by internal_ao2_ref, it can be used instead to determine what the current state of the object is.


Diffs
-----

  /team/group/media_formats-reviewed-trunk/main/astobj2.c 418435 

Diff: https://reviewboard.asterisk.org/r/3752/diff/


Testing
-------

Objects that were incorrectly reported as leaked no longer are.


Thanks,

Matt Jordan

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


More information about the asterisk-dev mailing list