Skip to content
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

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

Open
byhemechi opened this issue Nov 9, 2017 · 4 comments
Open

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

byhemechi opened this issue Nov 9, 2017 · 4 comments

Comments

@byhemechi
Copy link

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
Copy link
Owner

Alcaro commented Nov 11, 2017

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

Alcaro commented Nov 12, 2017

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:

  • Replace that line with glxMakeCurrent(this->display, None, NULL); - it makes no difference for me, but maybe your GPU driver or distro acts differently?
  • Comment out the contents of video_opengl::end() and video_opengl::begin(); they're supposed to allow minir to run multiple cores at once, but I never implemented the rest of that feature
  • Check if GDK_SYNCHRONIZE is typoed, copy it from the error message
  • If none of the above helps, install debug symbols for libGLX so I can see what those anonymous functions are; gdk and glib are uninteresting, anything above _XError is just routing the error message to the right place, our goal is not reaching _XError at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants