[Mesa-dev] [Bug 101252] eglGetDisplay() is not thread safe

2017-06-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101252

Emil Velikov  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Emil Velikov  ---
Thanks for the report Emre.

Should be fixed in master as of
commit 311c0916588c4a596ca7e7b4bce89b059e0f
Author: Eric Engestrom 
Date:   Thu Jun 15 23:53:55 2017 +0100

egl/display: make platform detection thread-safe


Please give it a try and reopen if the issue persists.
Meanwhile we'll pick those for the stable release (might be 17.1.4, since the
17.1.3 queue is already out).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 101252] eglGetDisplay() is not thread safe

2017-06-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101252

Emre Ucan  changed:

   What|Removed |Added

 CC||eu...@de.adit-jv.com

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 101252] eglGetDisplay() is not thread safe

2017-05-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101252

Bug ID: 101252
   Summary: eglGetDisplay() is not thread safe
   Product: Mesa
   Version: git
  Hardware: Other
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: EGL
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: eu...@de.adit-jv.com
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 131599
  --> https://bugs.freedesktop.org/attachment.cgi?id=131599=edit
Sample code for reproducing the bug

Hello,

We found out this issue in our GPU driver tests. It happens when many threads
are created and every thread creates wl_display object and calls
eglGetDisplay(). Then, some threads are getting EGL_NO_DISPLAY.

I implemented a sample code for reproducing the bug (main.c). The issue occurs
very often when I run the binary with 300 threads. I tried it in mesa 11.2 but
I saw the related code for upstream is the same.

I debugged mesa code and I found out that a thread gets EGL_NO_DISPLAY only
when _eglGetNativePlatform() returns _EGL_INVALID_PLATFORM.

native_platform variable is defined as static in _eglGetNativePlatform().
Therefore, different threads are sharing the same variable. When I remove the
static keyword and recompile mesa binaries, the issue never occurs.

In my platform, EGL_PLATFORM and EGL_DISPLAY env variables are never defined.
Therefore, _eglGetNativePlatformFromEnv() function always returns
_EGL_INVALID_PLATFORM.

I think issue occurs when a thread is in the end of _eglGetNativePlatform()
just before returning found native_platform, and the other thread overwrites
this static variable in _eglNativePlatformFromEnv() function.

Most likely issue is introduced by this commit:
7adb9b094894a512c019b3378eb9e3c69d830edc

Best Regards,
Emre Ucan

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev