[asterisk-dev] [Code Review] 2454: Fix lock errors on startup

Mark Michelson reviewboard at asterisk.org
Tue Apr 16 15:13:30 CDT 2013


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

Ship it!


Ship It!

- Mark Michelson


On April 16, 2013, 2:30 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2454/
> -----------------------------------------------------------
> 
> (Updated April 16, 2013, 2:30 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> I started noticing some messages that I didn't recognize while I was
> working on Stasis:
> 
>   message.c line 1017 (msg_tech_hash): Error obtaining read lock: Invalid argument
>   message.c line 1021 (msg_tech_hash): Error releasing rwlock: Invalid argument
> 
> I thought it was maybe something I did, so I tracked it down. Turns
> out to have been this way for a while.
> 
> In messages.c, there are several places in the code where we create a
> tmp_tech_holder and pass that into an ao2_find call. Unfortunately, we
> weren't initializing the rwlock on the tmp_tech_holder, which the hash
> function was locking. It's apparently harmless, but still not the best
> code.
> 
> This patch extracts all that copy/pasted code into two functions,
> msg_find_by_tech and msg_find_by_tech_name, which properly initialize
> and destroy the rwlock on the tmp_tech_holder.
> 
> 
> Diffs
> -----
> 
>   /branches/11/main/message.c 385815 
> 
> Diff: https://reviewboard.asterisk.org/r/2454/diff/
> 
> 
> Testing
> -------
> 
> Verified that the message is no longer printed.
> 
> 
> Thanks,
> 
> David Lee
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130416/a6053758/attachment.htm>


More information about the asterisk-dev mailing list