RESOLVED FIXED 182490
[GTK] WaylandCompositor misusing eglGetProcAddress
https://bugs.webkit.org/show_bug.cgi?id=182490
Summary [GTK] WaylandCompositor misusing eglGetProcAddress
Daniel Stone
Reported 2018-02-05 09:33:39 PST
In WaylandCompositor.cpp's initializeEGL(), eglBindWaylandDisplayWL() is called if eglGetProcAddress() returns any value for it. This causes a crash on newer Mesa when using software rendering: swrast drivers do not provide BindWaylandDisplay (as they rely on wl_shm instead of Mesa extensions), and newer Mesa asserts that the extension is enabled when the entrypoint is called. The trivial fix would be to check for the extension's presence and fail initializeEGL() if they are not there. The Mesa bug is here: https://bugs.freedesktop.org/show_bug.cgi?id=104949
Attachments
Patch (4.90 KB, patch)
2018-02-07 08:09 PST, Miguel Gomez
no flags
Michael Catanzaro
Comment 1 2018-02-05 10:27:40 PST
Mesa devs say "[WebKit] seems to be doing the most common and silly mistakes - uses the function pointers w/o checking for the extension string" in the upstream bug. We need to make sure we get this right everywhere, not just WaylandCompositor.cpp.
Miguel Gomez
Comment 2 2018-02-07 08:09:21 PST
Miguel Gomez
Comment 3 2018-02-07 08:11:35 PST
(In reply to Michael Catanzaro from comment #1) > Mesa devs say "[WebKit] seems to be doing the most common and silly mistakes > - uses the function pointers w/o checking for the extension string" in the > upstream bug. We need to make sure we get this right everywhere, not just > WaylandCompositor.cpp. I've fixed WaylandCompositor.cpp. The rest of the places calling eglGetProcAddress seem to be properly checking for the required extensions.
Michael Catanzaro
Comment 4 2018-02-07 08:35:36 PST
Comment on attachment 333283 [details] Patch Thanks
Daniel Stone
Comment 5 2018-02-07 08:41:48 PST
Don't think my r+ etc counts here, but LGTM anyway!
WebKit Commit Bot
Comment 6 2018-02-08 06:05:17 PST
Comment on attachment 333283 [details] Patch Clearing flags on attachment: 333283 Committed r228272: <https://trac.webkit.org/changeset/228272>
WebKit Commit Bot
Comment 7 2018-02-08 06:05:18 PST
All reviewed patches have been landed. Closing bug.
Michael Catanzaro
Comment 8 2018-03-02 08:26:10 PST
*** Bug 183289 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.