Alcaro / minir

A libretro frontend focusing on a native look and a smooth out-of-the-box experience.
Other
50 stars 5 forks source link

The program 'minir' received an X Window System error #9

Open byhemechi opened 6 years ago

byhemechi commented 6 years ago

after building fro this repo, minir won't start. Here's the log:

Chosen zoom: 320x240 * 2

(minir:677): Gdk-ERROR **: The program 'minir' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 265 error_code 8 request_code 155 (GLX) minor_code 5)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[1]    677 trace trap (core dumped)  ./minir
Alcaro commented 6 years ago

Can't reproduce any X11 errors on Ubuntu 14.04 or 17.10 under the default config, with snes9x_libretro.so and Super Mario World.sfc as arguments. I can't fix this without a stack trace (and I'm not sure if that's enough, but worth a try).

To create that, open a terminal and type:

make clean
make CFLAGS=-g
GDK_SYNCHRONIZE=1 gdb --args ./minir <whatever other arguments you used, if any>
break gdk_x_error
run
backtrace

and copypaste whatever it prints.

byhemechi commented 6 years ago

Sorry for delay, This is X11, by the way, not xwayland.

(gdb) backtrace
#0  0x00007ffff4f5ecd2 in  () at /usr/lib/libglib-2.0.so.0
#1  0x00007ffff4f64421 in g_log_writer_default () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4f5ed72 in g_log_structured_array ()
    at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff4f5f15a in g_log_structured () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff66347a4 in  () at /usr/lib/libgdk-3.so.0
#5  0x00007ffff6642155 in  () at /usr/lib/libgdk-3.so.0
#6  0x00007ffff78d96ed in _XError () at /usr/lib/libX11.so.6
#7  0x00007ffff36900d2 in  () at /usr/lib/libGLX.so.0
#8  0x00007ffff369202c in  () at /usr/lib/libGLX.so.0
#9  0x000055555557b899 in (anonymous namespace)::video_opengl::end() (this=0x555555981cd0) at video-opengl.cpp:410
#10 0x000055555557c223 in (anonymous namespace)::video_opengl::construct2d(uintptr_t) (this=0x555555981cd0, windowhandle=39845914) at video-opengl.cpp:646
#11 0x000055555557ded8 in (anonymous namespace)::video_create_opengl_2d(uintptr_t) (windowhandle=39845914) at video-opengl.cpp:1199
#12 0x000055555558396c in (anonymous namespace)::try_set_interface_video(unsigned int, uintptr_t, unsigned int, unsigned int, videoformat, double) (id=0, windowhandle=39845914, videowidth=320, videoheight=240, videodepth=fmt_rgb565, videofps=60) at main.cpp:147
#13 0x0000555555583b6e in (anonymous namespace)::create_interface_video(uintptr_t, unsigned int, unsigned int, videoformat, double) (windowhandle=39845914, videowidth=320, videoheight=240, videodepth=fmt_rgb565, videofps=60)
byhemechi commented 6 years ago

looks like it's actually glib fucking up, not your program (Just a guess - I've no clue with this, this isn't my field at all.)

Alcaro commented 6 years ago

If I'm slower than you, you have nothing to apologize for. (e: as in "I'm not fast either", not "hurry up")

glib is the one reporting the error, but there's a good chance it's my fault. glib likes to make deep stack traces.

video-opengl.cpp:410 is glxMakeCurrent(this->display, this->glxsurface, NULL);, which says "BadMatch is generated if drawable was not created with the same X screen and visual as ctx. It is also generated if drawable is None and ctx is not NULL."

Try the following: