Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10848)

Issue 3405041: Review: texture race condition fix (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by larrygritz
Modified:
13 years, 4 months ago
Reviewers:
lg, oiio-dev, ckulla
Base URL:
http://svn.openimageio.org/oiio/trunk/
Visibility:
Public.

Description

Fix a subtle race condition in the texture code: in the bilinear and bicubic sampling code, the case where all samples lie on the same tile wasn't stashing the reference-counted tile pointer in a safe place for the duration of time that it would be potentially reading texel values out of the tile. It was not symptomatic, and I think it would take a rare circumstance to fail -- basically, the whole tile cache would need to be cycled through between the time it left the block with the ref-counted tile and the time it finished using the pointers to the texels within the tile, thus freeing the tile and invalidating the memory. Just something I noticed hunting a different bug and thought I should plug the hole.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -0 lines) Patch
src/libtexture/texturesys.cpp View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3
larrygritz
13 years, 5 months ago (2010-12-02 07:02:07 UTC) #1
ckulla
Are you sure this is needed? In the "one tile" case - won't thread_info->tile keep ...
13 years, 4 months ago (2010-12-02 17:02:46 UTC) #2
lg_larrygritz.com
13 years, 4 months ago (2010-12-02 17:35:00 UTC) #3
Yes!

Thanks, I didn't think of that.  I won't make this change, then, but I will add
a comment to clarify it for future observers.


On Dec 2, 2010, at 9:02 AM, ckulla@gmail.com wrote:

> Are you sure this is needed? In the "one tile" case - won't
> thread_info->tile keep pointing to the tile until the same thread does
> another lookup?
> 
> http://codereview.appspot.com/3405041/
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
lg@larrygritz.com


Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b