[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
Tue Oct 11 16:39:58 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=98172

--- Comment #3 from shinji.suzuki at gmail.com ---
(In reply to Michel Dänzer from comment #2)
> Created attachment 127204 [details] [review]
> Work with a local reference of so->fence
> 
> Does this patch help?

Yes, it does! Thank you for your interest and effort in solving the issue.
I've rebuilt mesa from ubuntu source and run my program with it. Without your
patch, the app segfaults like it did with the OS supplied library. With your
patch the app has not crashed even once so far. The app crashes, when it does,
mainly upon start up like 4 times out of 5. I run the app a few dozen times
successfully with the patched library.

My itch is that I can't see why your patch eliminates the race. My
understanding is that the segfault happens because the second thread tries to
dereference &so->fence, which had been nullified by the first thread and I
can't figure out how that is avoided by the patch.

FYI, here is the call-stack when the apps crashes without the patch.

(gdb) where
#0  pb_reference (src=0x0, dst=0x10)
    at ../../../../../../src/gallium/auxiliary/pipebuffer/pb_buffer.h:239
#1  radeon_fence_reference (dst=0x10, src=0x0)
    at ../../../../../../src/gallium/winsys/radeon/drm/radeon_drm_cs.c:670
#2  0x00007f9b52bff441 in r600_fence_reference (screen=<optimized out>, 
    dst=0x7f9b3003c218, src=0x0)
    at ../../../../../src/gallium/drivers/radeon/r600_pipe_common.c:768
#3  0x00007f9b5272ea7f in st_client_wait_sync (ctx=<optimized out>, 
    obj=0x7f9b3003c1f0, flags=<optimized out>, timeout=<optimized out>)
    at ../../../src/mesa/state_tracker/st_cb_syncobj.c:114
#4  0x00007f9b526b0217 in _mesa_ClientWaitSync (sync=<optimized out>, flags=1, 
    timeout=18446744073709551615) at ../../../src/mesa/main/syncobj.c:341
#5  0x0000000000466106 in Fence::clientWaitSync (this=0x7f9b3001c0c0)
    at /home/suzuki/src/xxxxxxx/ndro2016/gl_fence.cpp:25
#6  0x0000000000479e09 in Fenced<pixel_source*>::clientWaitSync (
    this=0x7f9b4cc26e70) at /home/suzuki/src/xxxxxxx/ndro2016/gl_fence.h:59
#7  0x00007f9b4de64f02 in FileReaderThread::work (this=0x1a7b540)
    at /home/suzuki/src/xxxxxxx/ndro2016/thrd_filereader.cpp:63
#8  0x0000000000465586 in WorkerThread::run (this=0x1a7b540)
    at /home/suzuki/src/xxxxxxx/ndro2016/thrd.cpp:173
#9  0x000000000046529e in WorkerThread::entry_func (worker=0x1a7b540)
    at /home/suzuki/src/xxxxxxx/ndro2016/thrd.cpp:144
#10 0x00007f9b567e36fa in start_thread (arg=0x7f9b4cc27700)
    at pthread_create.c:333
#11 0x00007f9b55a74b5d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

-- 
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/20161011/d3423a72/attachment.html>


More information about the mesa-dev mailing list