[asterisk-dev] [Code Review]: Resolve odbc segfaults by adding shared locks around usage of odbc handle in res_odbc

jrose reviewboard at asterisk.org
Tue Feb 7 16:16:05 CST 2012



> On Feb. 7, 2012, 3:32 p.m., Tilghman Lesher wrote:
> > /branches/1.8/include/asterisk/res_odbc.h, line 160
> > <https://reviewboard.asterisk.org/r/1719/diff/1/?file=23900#file23900line160>
> >
> >     Not a huge deal, but I think I'd rather a name like "ast_odbc_sanity_check2", in keeping with current conventions.  See ast_update2_realtime and ast_config_load2, for example.

I don't believe that is a particularly good convention. Simply adding a '2' in the name of a function doesn't serve at all to describe what the function actually is for.

For a counter example, see ast_audiohook_read_frame_all in audiohook.h from Asterisk 10 and trunk.  Yeah, it's cheating a little since I made that function, but I named it that way at the suggestion of dvossel at the time.


- jrose


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


On Feb. 7, 2012, 2:37 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1719/
> -----------------------------------------------------------
> 
> (Updated Feb. 7, 2012, 2:37 p.m.)
> 
> 
> Review request for Asterisk Developers, Mark Michelson, Tilghman Lesher, rmudgett, and wdoekes.
> 
> 
> Summary
> -------
> 
> This is a continuation of wdoekes patch seen in https://reviewboard.asterisk.org/r/1622/
> This adds Tilghman Lesher's suggested changes.
> 
> 
> This addresses bug ASTERISK-19011.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19011
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/include/asterisk/res_odbc.h 354164 
>   /branches/1.8/res/res_odbc.c 354164 
> 
> Diff: https://reviewboard.asterisk.org/r/1719/diff
> 
> 
> Testing
> -------
> 
> I started by confirming that the segfault could be easily reproduced with wdoekes' setup mentioned in the issue report.
> After finishing the changes to the patch, I confirmed that following the same steps no longer produced the segfault, undid the patch to double check that I was doing it right, and then decided it was safe to post this review.
> 
> 
> Thanks,
> 
> jrose
> 
>

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


More information about the asterisk-dev mailing list