All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

STORM-1546 Crash in LLSecAPIBasicHandler::getCertificateStore

Review Request #435 - Created Aug. 9, 2011 and submitted

Vadim ProductEngine Reviewers
viewer
STORM-1546 davep
None viewer-development
Fixed a crash caused by a race condition in LLRefCount.

Reason:
secapiSSLCertVerifyCallback() seems to be called simultaneously by multiple threads,
which causes a race condition in LLRefCount::ref/unref() methods.
The reference counter in LLSecAPIBasicHandler::mStore goes to zero, and the object gets destroyed.

Fix:
Derive LLCertificateStore from LLThreadSafeRefCount instead of LLRefCount,
which should fix the race condition.

Note:
The LLThreadSafeRefCount constructor is private, so we have to wrap instances of the class with LLPointer.

 
Ship it!
Posted (Aug. 9, 2011, 1:45 p.m.)
Looks good -- make sure to ask QA to do a performance A/B test to make sure this doesn't introduce frame stalls.