-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash when using bgfx and wayland #5693
Comments
This is an upstream BGFX issue; they lack Wayland support. The bug there for it is bkaradzic/bgfx#1007 |
@belegdol The upstream bug has been closed. Is this now working? |
I have since switched back to the nvidia binary driver so I will need some time to re-test. If I recall correctly, the crashes were still happening. Lines 27 to 38 in 6e66a83
I think that what is left is to write the wayland-specific code as was done for bgfx examples. Or am I wrong? |
Is anyone familiar with bgfx examples? I built bgfx upstream adding --with-wayland to the genie scripts, but the example window still ran under xwayland according to xeyes. |
I have a friend with a relevant setup. I'll see what we can work out this weekend. |
I got a new laptop with an AMD Renoir 4500U APU in it which means it defaults to running Gnome under Wayland. With opengl bgfx backend I get around 110 % speed with umk3, windowed or not. Switching to full screen does make the speed dip transiently but it recovers. With vulkan backend umk3 runs at around 500 % windowed and around 50 % full screen. Not sure if xwayland is to blame here, but I am putting the information out there in case anybody encounters similar problems. |
I have now managed to build bgfx examples with wayland enabled - the key was to use --with-sdl in addition to --with-wayland. The bad news is that the examples do not run:
|
This issue might become more important with nvidia finally supporting xwayland as of 470.xx drivers. This was the last (or one of the last) issues holding back the enablement of wayland on nvidia drivers by default. ETA: it looks like gdm will no longer disable wayland on nvidia moving forward: |
I checked with xeyes and using
actually does result in a wayland window being drawn as of SDL-2.0.16, albeit without a window decoration. This indicates that at least the SDL part is capable of wayland. |
Fedora's SDL2-2.0.22 has switched to wayland by default [1]. This puts me in an unfortunate situation as I have recently switched mame video output to use bgfx by default to follow upstream. With SDL2 using wayland by default, mame is unusable with default settings. While I have filed a bug against SDL2 [2], if its maintainer decides to keep the change, this might leave me no choice but to revert back to opengl video output as standard. What are the chances of bgfx' wayland support getting fixed up in the near future? |
I'm able to compile bgfx from mainline with wayland enabled on Fedora 36: First, install build dependencies:
Second, clone the repos: $ git clone https://github.com/bkaradzic/bx.git
$ git clone https://github.com/bkaradzic/bimg.git
$ git clone https://github.com/bkaradzic/bgfx.git Third, build the code: $ cd bgfx
$ sed -e "283d" -i examples/07-callback/callback.cpp
$ make EXTRA_GENIE_ARGS="--with-sdl --with-wayland" linux-debug64 -j12 The diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp
index 52cc283df..240e4e96c 100644
--- a/examples/07-callback/callback.cpp
+++ b/examples/07-callback/callback.cpp
@@ -280,7 +280,6 @@ public:
if (kNaturalAlignment >= _align)
{
void* ptr = ::realloc(_ptr, _size);
- bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file, _line, ptr, _ptr, _size);
if (NULL == _ptr)
{ It seems to compile for me? @bkaradzic seems to have Wayland support in here. However, I can't run the examples as it crashes trying to load Vulkan (I can't figure out how to force a particular render backend). |
you can force gl backend by running exampes with |
Maybe it's related to all the vendored copies of libraries in bgfx rather than using system copies? I'm not sure why this would fail so much like this... |
Where do you see use-after-free?! |
When I try to follow the steps without patching out the line in the callback example, gcc throws an error saying that |
I guess it can't tell that the value is just being passed to print it out.
void* ptr = ::realloc(*_ptr*, _size);
- bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file,
_line, ptr, *_ptr*, _size);
…On 03/05/2022 02:57, Neal Gompa (ニール・ゴンパ) wrote:
use-after-free error
Where do you see use-after-free?!
When I try to follow the steps without patching out the line in the
callback example, gcc throws an error saying that |_ptr| is being used
after it has already been freed.
—
Reply to this email directly, view it on GitHub
<#5693 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGVYYRUFBEDI3MQXDODDDLVICBX7ANCNFSM4I3RM3AQ>.
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
|
Fixed by #11451 |
Hello,
bgfx and wayland seem to be incompatible at the moment. I can run -videodriver x11 -video bgfx or -videodriver wayland -video gl, but trying to run -videodriver wayland -video bgfx crashes mame:
The text was updated successfully, but these errors were encountered: