[Mesa-dev] [Bug 99781] Some Unity games fail assertion on startup in glXCreateContextAttribsARB

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jun 30 06:50:51 UTC 2019


--- Comment #22 from Hal Gentz <zegentzy at protonmail.com> ---
Created attachment 144685
  --> https://bugs.freedesktop.org/attachment.cgi?id=144685&action=edit
Requested patch (does not work)

I tried implementing your suggested patch, Uli, but it did not work. 

XSync also tried to call LockDisplay, which for some reason blocks with our
call to LockDisplay. This behavior, I think, contradicts what the XLockDisplay
docs say: 

>  Nested calls to XLockDisplay work correctly; the display will not actually be unlocked until XUnlockDisplay has been called the same number of times as XLockDisplay.

This behavior really suprized me, so I'm not sure what's up. My only suspician
is that the mutex not being made with a call to pthread_mutex_init w/ the
PTHREAD_MUTEX_RECURSIVE attribute. I tried grepping for `pthread_mutex_init`,
`PTHREAD_MUTEX_RECURSIVE`, `pthread` and `RECURSIVE` in the libx11 codebase to
no avail. The only file I found was `UIThrStubs.c`, which if I understand
correctly, is only used when multi-threading support is disabled at compile

I found a call to some `xmutex_init` function in locking.c, however, this
function only receives one parameter, unlike the two required by
`pthread_mutex_init`. gdb shows (I had to use `si` instead of `s`) that calls
to `xmutex_init` actually result in `pthread_mutex_init` getting called,
however, I'm not sure if that's because `xmutex_init` is some clever macro, or
if `-O3` inlined it. Nevertheless, I could not find any definition for
`xmutex_init` beyond the one in `UIThrStubs.c`.

I think we could possibly move the call to XSync after the call to
UnlockDisplay, however, I'm concerned that this might lead to some sort of race
condition if some other thread locking the display between our call to
UnlockDisplay and XSync's call to LockDisplay.

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190630/dcfe1d5f/attachment.html>

More information about the mesa-dev mailing list