revery-ui/revery

esy run crashes on master

glennsl opened this issue ยท 8 comments

  • Operating System: Manjaro/Arch Linux
  • Revery Version: master
  • OCaml version: 4.08.1
  • Native, Bytecode, or JS build: whatever esy build does

Running esy run results in a crash, with the following terminal output:

Build complete     
Hello from example app
[1, 2, 3]
Window: Starting window creation...
Window: Using vsync: true
Window: Creating window Welcome to Revery! width: 800 height: 480
Window: Window created - id: 2
Window: Setting window context
X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  259
  Current serial number in output stream:  259

Seems to be SDL2-related as rolling back to the commit just before the SDL2-migration works.

I've just tried to run master on Archlinux and it worked fine for me

@tcoopman Interesting. What GPU and video driver do you use? And do you use Xorg or Wayland?

I use Xorg with a Geforce GTX 1660 (very new) and the nvidia driver (linux419-nvidia-430xx, version 430.40). Also, I'm technically on Manjaro, not Arch proper, which lags a bit behind on packages. 4.19.69-1-MANJARO to be exact.

I'm using Xorg with a intel graphics card (i915 driver)

I'm up to date with archlinux (5.2.14)

Thanks for the report @glennsl !

So it looks like it's failing somewhere in here: https://github.com/revery-ui/reason-sdl2/blob/4d1b4435b00d925003421c94cdbdbb829299ec32/src/sdl2_wrapper.cpp#L212 - must be that SDL_GL_CreateContext call.

I wonder if it is related to this issue:
https://www.reddit.com/r/oculus_linux/comments/3fosqr/sdl2_fix_found_for_the_common_glxbaddrawable/

We could try porting over this patch to esy-sdl2 test to see if it works.

We could also try reproducing on reason-sdl2 by running esy x test_sdl2 - to narrow the scope & to rule out any issues caused by some of the extra logic Revery is doing. Would be interesting to see if that works, or also has the same GLXBadDrawable error. If it does reproduce there... would be a great way to test that patch!

We could also try reproducing on reason-sdl2 by running esy x test_sdl2

By "we" you mean me, right? ;) I can confirm it fails there too:

โ–ถ esy x test_sdl2
File "dune", line 1, characters 17-31:
1 | (ignored_subdirs (node_modules))
                     ^^^^^^^^^^^^^^
Warning: ignored_subdirs is deprecated in 1.6. Use dirs to specify visible
directories or data_only_dirs for ignoring only dune files.
File "dune", line 1, characters 17-31:
1 | (ignored_subdirs (node_modules))
                     ^^^^^^^^^^^^^^
Warning: ignored_subdirs is deprecated in 1.6. Use dirs to specify visible
directories or data_only_dirs for ignoring only dune files.
X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  259
  Current serial number in output stream:  259

By "we" you mean me, right? ;) I can confirm it fails there too:

Haha, it was the 'royal' "we", I guess... Thanks for checking!

I tried porting over the GLXWindow fix here: revery-ui/esy-sdl2#4 and got it building - but with that patch, it actually crashes with a GLXBadDrawable X error on my arch machine...

I also realized there were a couple of issues with the way we were creating the Window: revery-ui/reason-sdl2#12

It's unlikely that these issues would cause that GLXBadDrawable error, though.

@glennsl - ya, bummer ๐Ÿ˜ฆ

It'd be helpful to narrow down if this is an issue with the way we are using SDL2 in Revery/reason-SDL2, an issue with SDL2 itself, or an issue with these specific drivers (sounds like they are new).

One way we could start to narrow that down is, if you're up for it - have you build SDL2 from source:
https://www.libsdl.org/download-2.0.php , just independent of esy/reason.

And run the example apps (./configure, make, make install -> run some examples in the test folder):

  • If we do get the same error - we know it isn't an issue with reason-sdl2/Revery, and we can start tracking in the SDL2 discussion board or mailing list.
  • If we don't get the same error - we know then that the problem isn't with SDL2 or the drivers - and there is something different/wrong we're doing in our bindings ๐Ÿค”

Would at least be a useful data point so we can figure out which layer to dive into next!

@glennsl - thank you for all the time you spent with me troubleshooting!

We were able to confirm that this commit: revery-ui/reason-sdl2@9e93f9d fixed the issue (which is now in master) ๐ŸŽ‰