<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - multi-threaded usage of Gallium RadeonSI leads to NULL pointer exception in pb_cache_reclaim_buffer"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103304#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - multi-threaded usage of Gallium RadeonSI leads to NULL pointer exception in pb_cache_reclaim_buffer"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103304">bug 103304</a>
from <span class="vcard"><a class="email" href="mailto:nhaehnle@gmail.com" title="Nicolai Hähnle <nhaehnle@gmail.com>"> <span class="fn">Nicolai Hähnle</span></a>
</span></b>
<pre>After thinking about it some more, I think it's very likely that your
application also has a bug, a write-after-read bug to be precise.
What I'm suspecting is that you're doing this:
Thread 1 Thread 2
-------- --------
glBindTexture(tex);
glDraw*(...);
glFlush();
glTextureSubImage(tex, ...);
Unless you use glFinish() or glFenceSync() / glWaitSync() synchronization,
there is no guarantee that thread 1's draw has completed before thread 2's
texture change. In other words, the implementation is allowed to execute the
texture modification *before* the draw. Especially with Gallium threading, this
is quite likely to happen.
(We still also have a bug in the driver, but until I can actually double-check
your code, I'd say it's quite likely that you have a write-after-read hazard
like the one explained above.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>