Summary: | GL_ARB_sync objects are not properly synchronized across threads | ||
---|---|---|---|
Product: | Mesa | Reporter: | Steinar H. Gunderson <sgunderson> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | idr, mattst88 |
Version: | 11.0 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Suggested patch |
Description
Steinar H. Gunderson
2015-10-31 19:04:18 UTC
After looking at the code briefly, it looks like _mesa_validate_sync really needs to be _mesa_validate_sync_and_get_ref. Otherwise another thread might delete and unref the last RefCount, deleting the object. Not entirely sure how sharing between multiple threads is done with this, but from the looks of it, there's no refcount acquired there. So each function has to acquire a refcount for the duration of the call. This is separate from fixing validate_sync to not race against adds/removes to the hash set. I think there are quite a few kinds of GL objects that suffer from this problem. I recall Matt sending out some patches a few months ago that changed some of the locking around objects. I noticed this pre-existing problem while reviewing his code. Created attachment 120238 [details] [review] Suggested patch Hi, I think the included patch should resolve the problem. I've run with a variant of it for a while without any problems, although I had to go through some conflicts and such to forward-port it against git master, so testing would be appreciated. This was submitted as feb53912f8d8c29594a9fdff914d78bb36d6d56b (part of 11.2.0), but seemingly is missing from 11.1.2. Anyway, I'm closing it as fixed since 11.2.0 is out. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.