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

Matt Jordan reviewboard at asterisk.org
Fri Jul 11 21:45:39 CDT 2014


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

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/d682264d/attachment.html>


More information about the asterisk-dev mailing list