[Mesa-dev] [Bug 98172] Concurrent call to glClientWaitSync results in segfault in one of the waiters.
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Oct 13 15:46:44 UTC 2016
https://bugs.freedesktop.org/show_bug.cgi?id=98172
--- Comment #11 from shinji.suzuki at gmail.com ---
Sorry I've made too many mistake in writing. (Should have gone to bed before
writing.) I'll rewrite whole post below.
I'm afraid execution of st_fence_sync() can still race.
Thread-A can run upto
success = screen->fence_finish(screen, pipe, fence, 0);
and then get preempted and Thread-B can run upto the same location.
And then
screen->fence_reference(screen, &so->fence, NULL);
will be executed serially by both threads. If screen->fence_finish()
is thread-safe and return true only for the first invocation then all is fine
but likely it is not true as otherwise we will not be struggling with this
issue.
I think the gist of it is that checking of so->fence and nullifying of it
should be executed atomically. If "if (success)" is replaced with "if (success
&& so->fence)" then the program may behave correctly but I'm still not
comfortable about sreen->fence_finish() being called concurrently.
I'm also concerned that mutual exclusion on ctx->Shared->Mutex may introduce
unnecessarily strict serialization.
Can't we introduce per sync-object mutex so that excution of checking of
so->fence and nullyfying of it happen atomically?
Is that modification too intrusive? (At least it is unnecessary overhead when
st_fence_sync() is not executed concurrently on the same sync object.)
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161013/88f4ea46/attachment.html>
More information about the mesa-dev
mailing list