Repository navigation
Conversation
The hook read the first pointer of the native display as a wl_interface* and compared its name. An Xlib Display starts with ext_data, which SDL3's X11 backend sets, and a gbm_device starts with a function pointer, so the strcmp followed junk and segfaulted; try/catch can't catch a SIGSEGV. Compare the pointer with &wl_display_interface instead, as Mesa does. Fixes flightlessmango#2205
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On X11, an app that calls
eglGetDisplay()with its X11Display*can segfault in the hook. To spot awl_displayit read the display's first pointer as awl_interface*andstrcmp'd itsname, but an XlibDisplaystarts withext_data, which SDL3's X11 backend sets, so it followed junk (thetry/catchcan't catch a SIGSEGV). Agbm_devicecrashes the same way. It now compares that pointer with&wl_display_interface, which is how Mesa detects a Wayland display.Tested master vs this branch, 5 runs each, on NVIDIA 615.78 and Mesa 26.2.5 (llvmpipe): an SDL3 X11 window +
eglGetDisplay(display)segfaults every run on master and runs every time here, and a GBM device does the same on NVIDIA. Native WaylandeglGetDisplay(wl_display)is still detected with both drivers (MangoHud'swl_seat.get_keyboardshows up inWAYLAND_DEBUG).Fixes #2205