libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.21k stars 1.82k forks source link

glcore broken on master #9277

Closed asavah closed 5 years ago

asavah commented 5 years ago

Description

glcore is currently broken on master as of https://github.com/libretro/RetroArch/commit/2b6613c137a2de8379c7ce1571a21bbbb56c9160

I know master is wip and stuff is expected to get broken ) I open this issue just to let you know about this problem, please close the issue if this is expected.

Expected behavior

retroarch works with glcore

Actual behavior

retroarch just exits with 1, no crash, no backtrace, gl driver works, vulkan driver works glcore does not

log

[INFO] RetroArch 1.7.7 (Git 2b6613c137)
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 5 2400G with Radeon Vega Graphics
[INFO] Capabilities: MMX MMXEXT SSE1 SSE2 SSE3 SSSE3 SSE4 SSE4.2 AVX AES
[INFO] Built: Aug 11 2019
[INFO] Version: 1.7.7
[INFO] Git: 2b6613c137
[INFO] =================================================
[INFO] Environ SET_PIXEL_FORMAT: RGB565.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 30000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [GLX]: GLX_OML_sync_control and GLX_MESA_swap_control supported, using better swap control method...
[INFO] [GLCore]: Found GL context: x
[INFO] [GLCore]: Detecting screen resolution 3840x2160.
[INFO] [GLX]: Window manager is Openbox.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [GLX]: Using Xinerama on screen #0.
[INFO] [GLX]: X = 0, Y = 0, W = 3840, H = 2160.
[INFO] [GLX]: Using true fullscreen.

exits with 1

Steps to reproduce the bug

  1. Move away ~./config/retroarch to start from scratch with defaults
  2. Run retroarch.
  3. Select glcore as video driver
  4. Save config and exit retroarch
  5. Try running retroarch again.

Bisect Results

759591d5a60ee91291d9068569816f6d717f451f last good a88b357817f95960701caf88c4a3aefb97f54786 first bad #9250

~~Edit: I'll try to narrow this down later. I didn't do a full/proper bisect, however https://github.com/libretro/RetroArch/commit/881ef63b630eec5bc4eaea2c387f32750389aa10 works fine here , I tried building a few commits between 82168c0 and current tip and none worked.~~ working log from 881ef63

[INFO] RetroArch 1.7.7 (Git 881ef63b63)
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 5 2400G with Radeon Vega Graphics
[INFO] Capabilities: MMX MMXEXT SSE1 SSE2 SSE3 SSSE3 SSE4 SSE4.2 AVX AES
[INFO] Built: Aug 11 2019
[INFO] Version: 1.7.7
[INFO] Git: 881ef63b63
[INFO] =================================================
[INFO] Environ SET_PIXEL_FORMAT: RGB565.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 30000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [GLX]: GLX_OML_sync_control and GLX_MESA_swap_control supported, using better swap control method...
[INFO] [GLCore]: Found GL context: x
[INFO] [GLCore]: Detecting screen resolution 3840x2160.
[INFO] [GLX]: Window manager is Openbox.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [GLX]: Using Xinerama on screen #0.
[INFO] [GLX]: X = 0, Y = 0, W = 3840, H = 2160.
[INFO] [GLX]: Using true fullscreen.
[INFO] [GLX]: Found swap function: glXSwapIntervalMESA.
[INFO] [GLX]: glXSwapInterval(0)
[INFO] [GLCore]: Vendor: X.Org, Renderer: AMD RAVEN (DRM 3.32.0, 5.2.8-k1, LLVM 9.0.0).
[INFO] [GLCore]: Version: 4.5 (Core Profile) Mesa 19.1.4.
[INFO] [GLCore]: Using resolution 3840x2160
[INFO] [udev]: Plugged pad: Microsoft X-Box One S pad (1118:746) on port #0.
[INFO] [udev]: Pad #0 (/dev/input/event18) supports force feedback.
[INFO] [udev]: Pad #0 (/dev/input/event18) supports 16 force feedback effects.
[INFO] [Autoconf]: 1 profiles found.
[INFO] [Autoconf]: no profiles found for Microsoft X-Box One S pad (1118/746).
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [GLCore]: Loading stock shader.
[INFO] [slang]: Building pass #0 (N/A)
[INFO] [slang]: Reflection
[INFO] [slang]:   Textures:
[INFO] [slang]:      Source (#0)
[INFO] [slang]:
[INFO] [slang]:   Uniforms (Vertex: yes, Fragment: no):
[INFO] [slang]:   Push Constants (Vertex: no, Fragment: no):
[INFO] [slang]:      MVP (Offset: 0)
[INFO] [slang]:
[INFO] [slang]:   Parameters:
[INFO] [GLCore]: Not using frame history.
[INFO] [GLCore]: Not using framebuffer feedback.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Found display server: x11
[INFO] Found shader "/usr/share/libretro/shaders/stock.slang"
[INFO] [PulseAudio]: Requested 24576 bytes buffer, got 29024.
[INFO] [Menu]: Found menu display driver: "glcore".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Menu]: Found menu display driver: "glcore".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [LED]: LED driver = 'null' 0x55c04f3c0820
[INFO] [MIDI]: Initializing ...
[INFO] [MIDI]: Input disabled.
[INFO] [MIDI]: Output disabled.
[INFO] [MIDI]: Initialized "alsa" driver.
[WARN] Input device ID 5 is unknown to this libretro implementation. Using RETRO_DEVICE_JOYPAD.
[INFO] SRAM will not be saved.
[INFO] Loading history file: [/home/kodi/.config/retroarch/content_history.lpl].
[INFO] Loading history file: [/home/kodi/.config/retroarch/content_music_history.lpl].
[INFO] Loading history file: [/home/kodi/.config/retroarch/content_video_history.lpl].
[INFO] Loading history file: [/home/kodi/.config/retroarch/content_image_history.lpl].
[INFO] Loading favorites file: [/home/kodi/.config/retroarch/content_favorites.lpl].
[INFO] [GLCore]: VSync => off
[INFO] [GLX]: glXSwapInterval(0)
[INFO] [GLCore]: VSync => on
[INFO] [GLX]: glXSwapInterval(0)
[INFO] [config] Saved new config to "/home/kodi/.config/retroarch/retroarch.cfg".
[INFO] Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] Unloading game..
[INFO] [PulseAudio]: Pausing.
[INFO] Unloading core..
[INFO] Unloading core symbols..
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [XINERAMA]: Saved monitor #0.
[INFO] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.
[INFO] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.

Version/Commit

You can find this information under Information/System Information

Environment information

RobLoach commented 5 years ago

It's working here... What do you do to reproduce? Screenshot at 2019-08-10 18-43-14

asavah commented 5 years ago

Didn't do anything special. Built master, tried running retroarch. It just exited. Moved ~./config/retroarch folder away. Run retroarch with defaults, selected glcore and ozone drivers, saved config, exited retroarch. It wouldn't start again.

asavah commented 5 years ago

Meh I was wrong, it's not ozone, but glcore, I'll change the issue accordingly, should have done more tests before reporting, sorry. Will change the issue accordingly.

ghost commented 5 years ago

same here. RA just exits when using glcore

asavah commented 5 years ago

Updated the issue with some additional info and bissect.

hizzlekizzle commented 5 years ago

I believe it's only broken in linux and it's this commit that did it: a88b357817f95960701caf88c4a3aefb97f54786 @bparker06 ^^

Ryunam commented 5 years ago

I can confirm that this is not happening on Windows 10 x64. I am using glcore and I’ve tested the snes9x, Nestopia and Beetle PSX cores without getting any crashes.

LazyBumHorse commented 5 years ago

Are you building a debug build? I believe the logic is broken if x->g_debug is true in x_ctx.c

edit: Hm... no, it looks like that could only break if OpenGL 3.0 non-Core + debug would be used

asavah commented 5 years ago

@LazyBumHorse Nope, not a debug build. I can build and test anything if needed tho.

LazyBumHorse commented 5 years ago

Hm... I can't reproduce the issue with Nvidia drivers, maybe there's something up with Mesa?

I tried replacing {4, 6} with {6, 6} here https://github.com/libretro/RetroArch/blob/8647bbc36f9b5adf299f00132a2faacd49427c66/gfx/drivers_context/x_ctx.c#L874 and added logging around the following glx_create_context_attribs call, this gave me the following log:

[INFO] [DEBUG] trying version 6.6
[WARN] [GLX]: Version 3.2 not supported, trying a lower version.
[INFO] [DEBUG] failed
[INFO] [DEBUG] trying version 4.5
[INFO] [DEBUG] succeeded

The WARN in-between stems from the x_gl_version_error_handler (and that prints the originally requested version 3.2 instead of the actual tried one, so don't get confused). It looks like this: https://github.com/libretro/RetroArch/blob/8647bbc36f9b5adf299f00132a2faacd49427c66/gfx/drivers_context/x_ctx.c#L179-L190 And maybe this error handler is this issue, maybe it reaches the exit(1); on Mesa drivers. @asavah This is something you could confirm.

If this is the cause, we might need to patch this line https://github.com/libretro/RetroArch/blob/8647bbc36f9b5adf299f00132a2faacd49427c66/gfx/drivers_context/x_ctx.c#L866 or the error handler itself.

LazyBumHorse commented 5 years ago

old_handler = XSetErrorHandler(x_nul_handler); is probably what was intended in the first place because the comment above says "silently ignore failures when requesting GL versions that are too high"

Though it'd be nice to fix the error handler anyways.

ghost commented 5 years ago

The way it's written is as intended... the newer error handler will print a warning and keep going if the error message was due to the requested version, otherwise it will exit. nul_handler should actually be exiting all the time though if I had to guess.

LazyBumHorse commented 5 years ago

x_nul_handler simply does nothing. I also don't see why the error handler is needed if we can just check the return value of glx_create_context_attribs - which the code is already doing.

LazyBumHorse commented 5 years ago

Maybe this will do? https://github.com/libretro/RetroArch/pull/9279

ghost commented 5 years ago

The point of the error handler was to print a message when a version failed. I don't quite understand what is trying to be solved here... if someone thinks the exit call is being reached, that should be confirmed first. I don't think we should just take code out on a hunch. I'd rather the warning message be kept in there as it can help with debugging problems.

LazyBumHorse commented 5 years ago

I did leave the messages in and before your PR, there was no error handler, especially none that would exit. Therefore, the only effective change of my PR is removing the exit.

ghost commented 5 years ago

I didn't add the nul handler though... doesn't that effectively mean the warning and the exit is being removed? Sorry if I don't understand.

LazyBumHorse commented 5 years ago

Hm... maybe I'm the one that does not understand.

By "warning" you mean the RARCH_LOG in the error handler, right? I moved that here https://github.com/libretro/RetroArch/pull/9279/files#diff-47a5a2cb0befff4022ace7037dfca292R914

ghost commented 5 years ago

Yes... ok so you moved the check inside to where it must assume the error handler won't exit (otherwise we wouldn't see any message unless it was still printed in the handler)... I still don't know why the exit is a problem and I think that should be figured out before just removing it... we could instead enhance the handler to give more descriptive messages instead... there is an X11 function to fill a string with a friendly error message that could be used.

LazyBumHorse commented 5 years ago

That'd be an option as well, though I don't know how much this would improve the messages. I mean what causes context creation to fail if it's not an unsupported version?

Building our own messages by error codes seems like a bad idea, since I believe this issue already proves that this particular error code is driver dependent.

But if there are some automatic ways to get error messages and not only codes as you say, we could use those - maybe in addition to some generic logs.

The exit needs to go in any case though, the code already has error handling: https://github.com/libretro/RetroArch/blob/8647bbc36f9b5adf299f00132a2faacd49427c66/gfx/drivers_context/x_ctx.c#L942-L946 So just let it do it's thing.

ghost commented 5 years ago

I mean what causes context creation to fail if it's not an unsupported version?

Invalid attrib flags for one, but it's not just about that... hitting the error handler under any circumstance is normally a cause for immediately exiting the program, which is why I think the exit() call should really be there all the time, except for the loop that checks different versions where we want to ignore failures related to the version itself.

It could be that the error they are getting (if they are even getting one, we don't know without a backtrace) is different than the exact code we check for for version mismatches, since their log does not have the version warning message in it. So either RA is exiting for them for an unrelated reason, or it's hitting the error handler for a different reason we didn't expect and that should be IMO investigated instead of ignored.

asavah commented 5 years ago

I could provide a backtrace if I knew how to force ra to give me one. ra does not crash , just exits with 1. I can have a debug build in no time and I have gdb handy, let me know what you need me to do anything.

asavah commented 5 years ago

backtrace with brekpoint set at x_gl_version_error_handler

0  x_gl_version_error_handler (dpy=0x5555566fbc00, event=0x7fffffffcef0) at gfx/drivers_context/x_ctx.c:183
#1  0x00007ffff7c95587 in ?? () from /usr/lib/libX11.so.6
#2  0x00007ffff70dbc3b in ?? () from /usr/lib/libGL.so.1
#3  0x00007ffff70d7fcf in ?? () from /usr/lib/libGL.so.1
#4  0x00005555557be8ab in gfx_ctx_x_set_video_mode (data=0x55555669f8e0, video_info=<optimized out>, width=<optimized out>, height=<optimized out>, fullscreen=<optimized out>) at gfx/drivers_context/x_ctx.c:902
#5  0x00005555555e4b01 in video_context_driver_set_video_mode (mode_info=0x7fffffffd814) at retroarch.c:18799
#6  0x00005555557ea3d5 in gl_core_init (video=0x7fffffffd910, input=0x555555e84450 <current_input>, input_data=0x555555e84448 <current_input_data>) at gfx/drivers/gl_core.c:993
#7  0x00005555555f0144 in video_driver_init_internal (video_is_threaded=<synthetic pointer>) at retroarch.c:16884
#8  drivers_init (flags=1023) at retroarch.c:19609
#9  0x00005555555f497a in retroarch_main_init (argc=4, argv=argv@entry=0x7fffffffe498) at retroarch.c:21653
#10 0x00005555556085fb in content_load (info=info@entry=0x7fffffffe370) at tasks/task_content.c:655
#11 0x0000555555609828 in task_load_content_callback (content_info=0x7fffffffe370, loading_from_cli=<optimized out>, loading_from_menu=true) at tasks/task_content.c:2070
#12 0x00005555555fa4c6 in rarch_main (argc=4, argv=0x7fffffffe498, data=0x0) at retroarch.c:5188
#13 0x00007ffff5370d5b in __libc_start_main (main=0x5555555d3cf0 <main>, argc=4, argv=0x7fffffffe498, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe488) at ../csu/libc-start.c:308
#14 0x00005555555d418a in _start () at ../sysdeps/x86_64/start.S:120
(gdb) bt full
#0  x_gl_version_error_handler (dpy=0x5555566fbc00, event=0x7fffffffcef0) at gfx/drivers_context/x_ctx.c:183
No locals.
#1  0x00007ffff7c95587 in ?? () from /usr/lib/libX11.so.6
No symbol table info available.
#2  0x00007ffff70dbc3b in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#3  0x00007ffff70d7fcf in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#4  0x00005555557be8ab in gfx_ctx_x_set_video_mode (data=0x55555669f8e0, video_info=<optimized out>, width=<optimized out>, height=<optimized out>, fullscreen=<optimized out>) at gfx/drivers_context/x_ctx.c:902
        i = <optimized out>
        gl_versions = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {3, 1}, {3, 0}}
        gles_versions = {{2, 0}, {1, 1}, {1, 0}}
        version_rows = <optimized out>
        gl_version_rows = 11
        gles_version_rows = 3
        versions = 0x0
        attribs = {8337, 4, 8338, 6, 37158, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
        aptr = <optimized out>
        event = {type = 19, xany = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306}, xkey = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0,
            state = 0, keycode = 0, same_screen = 0}, xbutton = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, state = 0, button = 0, same_screen = 0}, xmotion = {type = 19,
            serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, state = 0, is_hint = 0 '\000', same_screen = 0}, xcrossing = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00,
            window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, mode = 0, detail = 0, same_screen = 0, focus = 32770, state = 32768}, xfocus = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, mode = 4194306,
            detail = 0}, xexpose = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, x = 4194306, y = 0, width = 0, height = 0, count = 0}, xgraphicsexpose = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, drawable = 4194306, x = 4194306,
            y = 0, width = 0, height = 0, count = 0, major_code = 0, minor_code = 0}, xnoexpose = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, drawable = 4194306, major_code = 4194306, minor_code = 0}, xvisibility = {type = 19, serial = 75, send_event = 0,
            display = 0x5555566fbc00, window = 4194306, state = 4194306}, xcreatewindow = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, parent = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, override_redirect = 0}, xdestroywindow = {
            type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, event = 4194306, window = 4194306}, xunmap = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, event = 4194306, window = 4194306, from_configure = 0}, xmap = {type = 19, serial = 75, send_event = 0,
            display = 0x5555566fbc00, event = 4194306, window = 4194306, override_redirect = 0}, xmaprequest = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, parent = 4194306, window = 4194306}, xreparent = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00,
            event = 4194306, window = 4194306, parent = 0, x = 0, y = 0, override_redirect = 0}, xconfigure = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, event = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, above = 0,
            override_redirect = 0}, xgravity = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, event = 4194306, window = 4194306, x = 0, y = 0}, xresizerequest = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, width = 4194306, height = 0},
          xconfigurerequest = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, parent = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, above = 0, detail = 0, value_mask = 140746078289920}, xcirculate = {type = 19, serial = 75, send_event = 0,
            display = 0x5555566fbc00, event = 4194306, window = 4194306, place = 0}, xcirculaterequest = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, parent = 4194306, window = 4194306, place = 0}, xproperty = {type = 19, serial = 75, send_event = 0,
            display = 0x5555566fbc00, window = 4194306, atom = 4194306, time = 0, state = 0}, xselectionclear = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, selection = 4194306, time = 0}, xselectionrequest = {type = 19, serial = 75, send_event = 0,
            display = 0x5555566fbc00, owner = 4194306, requestor = 4194306, selection = 0, target = 0, property = 0, time = 0}, xselection = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, requestor = 4194306, selection = 4194306, target = 0, property = 0, time = 0},
          xcolormap = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, colormap = 4194306, new = 0, state = 0}, xclient = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, message_type = 4194306, format = 0, data = {
              b = '\000' <repeats 19 times>, s = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, l = {0, 0, 0, 0, 140746078289920}}}, xmapping = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306, request = 4194306, first_keycode = 0, count = 0}, xerror = {type = 19,
            display = 0x4b, resourceid = 42949672960, serial = 93825010744320, error_code = 2 '\002', request_code = 0 '\000', minor_code = 64 '@'}, xkeymap = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, window = 4194306,
            key_vector = "\002\000@", '\000' <repeats 28 times>}, xgeneric = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, extension = 4194306, evtype = 0}, xcookie = {type = 19, serial = 75, send_event = 0, display = 0x5555566fbc00, extension = 4194306, evtype = 0,
            cookie = 4194306, data = 0x0}, pad = {19, 75, 42949672960, 93825010744320, 4194306, 4194306, 0, 0, 0, 0, 0, 140746078289920, 140737488388096, -1, -1, 0, 25769803776, 4294967297, 124, 0, 0, 141162690117632, 4294967296, 1}}
        true_full = <optimized out>
        windowed_full = <optimized out>
        val = 0
        x_off = 0
        y_off = 0
        vi = 0x5555568d42e0
        swa = {background_pixmap = 0, background_pixel = 0, border_pixmap = 0, border_pixel = 0, bit_gravity = 0, win_gravity = 0, backing_store = 0, backing_planes = 0, backing_pixel = 0, save_under = 0, event_mask = 131135, do_not_propagate_mask = 0, override_redirect = 0, colormap = 4194305,
          cursor = 0}
        wm_name = <optimized out>
        old_handler = 0x7ffff7c95460
        x = 0x55555669f8e0
        net_wm_icon = <optimized out>
        cardinal = <optimized out>
        settings = <optimized out>
        opacity = 4294967295
#5  0x00005555555e4b01 in video_context_driver_set_video_mode (mode_info=0x7fffffffd814) at retroarch.c:18799
        video_info = {input_menu_swap_ok_cancel_buttons = true, input_driver_nonblock_state = false, shared_context = true, black_frame_insertion = false, hard_sync = false, fps_show = false, statistics_show = false, framecount_show = false, scale_integer = false, post_filter_record = false,
          windowed_fullscreen = false, fullscreen = true, font_enable = true, use_rgba = false, libretro_running = false, xmb_shadows_enable = true, battery_level_enable = false, timedate_enable = true, runloop_is_slowmotion = false, runloop_is_idle = false, runloop_is_paused = false,
          is_perfcnt_enable = false, menu_is_alive = false, msg_bgcolor_enable = false, custom_vp_x = 0, custom_vp_y = 0, crt_switch_center_adjust = 0, hard_sync_frames = 0, aspect_ratio_idx = 22, max_swapchain_images = 3, monitor_index = 0, crt_switch_resolution = 0,
          crt_switch_resolution_super = 2560, width = 0, height = 0, xmb_theme = 0, xmb_color_theme = 4, menu_shader_pipeline = 2, materialui_color_theme = 0, ozone_color_theme = 1, custom_vp_width = 960, custom_vp_height = 720, custom_vp_full_width = 0, custom_vp_full_height = 0,
          menu_wallpaper_opacity = 0.300000012, menu_framebuffer_opacity = 0.899999976, menu_header_opacity = 1, menu_footer_opacity = 1, refresh_rate = 59.9400597, font_msg_pos_x = 0.0500000007, font_msg_pos_y = 0.0500000007, font_msg_color_r = 1, font_msg_color_g = 1, font_msg_color_b = 0,
          xmb_alpha_factor = 75,
          fps_text = "\000\000\000\000\016\000 \000\000\000\000\000The X.Org FoundaX.Org Foundation", ':' <repeats 16 times>, "\000\000\377\377\377\377\377\377\000\377\377\377\377\377\377\377P\003\000\000\000\000\000\000\061", '\000' <repeats 23 times>, "Y\000HOME\000%s%s\000rb\000\000\000\000\000", stat_text = '\000' <repeats 12 times>, "      \000        ", '\000' <repeats 81 times>, "Y\000HOME\000%s%s\000rb", '\000' <repeats 18 times>, "      \000        ", '\000' <repeats 49 times>...,
          chat_text = "\000\000\000\000\006\211<\365\377\177\000\000\000\000\000\000\000\000\000\000\070\000\000\000\000\000\000\000\340\"P\365\377\177\000\000\220jjVUU\000\000\240\333\350UUU\000\000\000\017\000\000\000\000\000\000p\b\000\000\000\000\000\000\t\246<\365\377\177\000\000\360RfVUU\000\000\070\207<\365\377\177\000\000 \305\314UUU\000\000\350\326\377\377\377\177\000\000\000\017\000\000\000\000\000\000\360RfVUU\000\000\340\"P\365\377\177\000\000\021\331;\365\377\177\000\000 \305\314UUU\000\000\020\331\377\377\377\177\000\000 \305\314UUU\000\000A\361cUUU\000\000\030\330\377\377\377\177\000\000\030\000\000\000\060\000\000\000\300\327\377\377\377\177\000\000\000\327\377\377\377"..., frame_count = 1, frame_time = 0, frame_rate = 0, osd_stat_params = {x = 0, y = 0, scale = 3.18124201e+13, drop_mod = 0, drop_x = 1432243977, drop_y = 21845, drop_alpha = -nan(0x7fd820),
            color = 32767, full_screen = 197, text_align = (TEXT_ALIGN_RIGHT | unknown: 21844)}, cb_update_window_title = 0x5555557bb9b0 <x11_update_title>, cb_swap_buffers = 0x5555557bda10 <gfx_ctx_x_swap_buffers>, cb_get_metrics = 0x5555557bb310 <x11_get_metrics>,
          cb_set_resize = 0x5555557bdb40 <gfx_ctx_x_set_resize>, context_data = 0x55555669f8e0, userdata = 0x0}
#6  0x00005555557ea3d5 in gl_core_init (video=0x7fffffffd910, input=0x555555e84450 <current_input>, input_data=0x555555e84448 <current_input_data>) at gfx/drivers/gl_core.c:993
        mode = {width = 3840, height = 2160, fullscreen = true}
        inp = {input = 0x55555669f8e0, input_data = 0x555555ab4b52}
        full_x = 3840
        full_y = 2160
        settings = 0x7ffff0490010
        interval = 0
        win_width = <optimized out>
        win_height = <optimized out>
        temp_width = 0
        temp_height = 0
        vendor = 0x0
--Type <RET> for more, q to quit, c to continue without paging--c
        renderer = 0x0
        version = 0x0
        error_string = 0x0
        gl = 0x5555566a6a90
        ctx_driver = 0x555555e77ac0 <gfx_ctx_x>
        hwr = 0x555555e8dba0 <hw_render>
#7  0x00005555555f0144 in video_driver_init_internal (video_is_threaded=<synthetic pointer>) at retroarch.c:16884
        video = {fullscreen = true, vsync = false, force_aspect = true, font_enable = true, width = 0, height = 0, swap_interval = 1, smooth = true, is_threaded = false, rgb32 = false, input_scale = 2, parent = 0}
        scale = <optimized out>
        width = 0
        height = 0
        custom_vp = 0x7ffff04ca8c8
        geom = 0x555555e8d900 <video_driver_av_info>
        max_dim = <optimized out>
        tmp = 0x555555e819e0 <input_x>
        system = 0x0
        settings = 0x7ffff0490010
        video = <optimized out>
        max_dim = <optimized out>
        scale = <optimized out>
        width = <optimized out>
        height = <optimized out>
        custom_vp = <optimized out>
        tmp = <optimized out>
        system = <optimized out>
        dummy_pixels = {0 <repeats 32 times>}
        settings = <optimized out>
        geom = <optimized out>
        default_aspect = <optimized out>
        base_width = <optimized out>
#8  drivers_init (flags=1023) at retroarch.c:19609
        hwr = 0x555555e8dba0 <hw_render>
        video_is_threaded = false
        settings = 0x7ffff0490010
#9  0x00005555555f497a in retroarch_main_init (argc=4, argv=argv@entry=0x7fffffffe498) at retroarch.c:21653
        global = 0x555555e9b6c0 <g_extern>
#10 0x00005555556085fb in content_load (info=info@entry=0x7fffffffe370) at tasks/task_content.c:655
        i = 0
        rarch_argc = 0
        rarch_argv = {0x0 <repeats 32 times>}
        argv_copy = {0x0 <repeats 32 times>}
        rarch_argv_ptr = 0x7fffffffe498
        rarch_argc_ptr = 0x7fffffffe370
        wrap_args = 0x55555669f4c0
        core_info = {supports_no_game = false, database_match_archive_member = false, firmware_count = 0, path = 0x0, config_data = 0x0, display_name = 0x0, display_version = 0x0, core_name = 0x0, system_manufacturer = 0x0, systemname = 0x0, system_id = 0x0, supported_extensions = 0x0, authors = 0x0, permissions = 0x0, licenses = 0x0, categories = 0x0, databases = 0x0, notes = 0x0, required_hw_api = 0x0, categories_list = 0x0, databases_list = 0x0, note_list = 0x0, supported_extensions_list = 0x0, authors_list = 0x0, permissions_list = 0x0, licenses_list = 0x0, required_hw_api_list = 0x0, firmware = 0x0, userdata = 0x0}
        core_info_list = 0x0
        ident_info = {ident = 0x0}
#11 0x0000555555609828 in task_load_content_callback (content_info=0x7fffffffe370, loading_from_cli=<optimized out>, loading_from_menu=true) at tasks/task_content.c:2070
        content_ctx = {subsystem = {data = 0x0, size = 0}, name_ips = 0x0, name_bps = 0x0, name_ups = 0x0, valid_extensions = 0x0, directory_cache = 0x0, directory_system = 0x0, is_ips_pref = false, is_bps_pref = false, is_ups_pref = false, block_extract = false, need_fullpath = false, set_supports_no_game_enable = false, patch_is_blocked = false, bios_is_missing = false, check_firmware_before_loading = false, temporary_content = 0x0}
        ret = false
        global = 0x555555e9b6c0 <g_extern>
        settings = 0x7ffff0490010
        sys_info = 0x555555e9a0a0 <runloop_system>
#12 0x00005555555fa4c6 in rarch_main (argc=4, argv=0x7fffffffe498, data=0x0) at retroarch.c:5188
        info = {argc = 4, argv = 0x7fffffffe498, args = 0x0, environ_get = 0x5555555d6380 <frontend_unix_get_env>}
#13 0x00007ffff5370d5b in __libc_start_main (main=0x5555555d3cf0 <main>, argc=4, argv=0x7fffffffe498, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe488) at ../csu/libc-start.c:308
        self = <optimized out>
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 6154140435703276342, 93824992756064, 140737488348304, 0, 0, 14270249609601846, 14257533630817078}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7fffffffe4c0, 0x7ffff7ffe130}, data = {prev = 0x0, cleanup = 0x0, canceltype = -6976}}}
        not_first_call = <optimized out>
#14 0x00005555555d418a in _start () at ../sysdeps/x86_64/start.S:120
ghost commented 5 years ago

In this case the backtrace is ambiguous because it only shows that the handler was entered at all, we still don't know that the exit was caused by it.

What you can do is restart gdb, and this time, before calling run, do:

catch syscall exit
catch syscall exit_group

Then you can call run. This will cause a "catchpoint" (basically a breakpoint) on any exit() call and you can run bt full from there to see exactly which line called exit().

What I'd also like to ask if you could do is that IF the backtrace shows the exit call came from the error handler, to go back up the stack to the error handler (use the "up" command until the error handler function appears), and print out the error codes and other info so we can see the reason it's failing:

print *dpy
print *event
LazyBumHorse commented 5 years ago

I don't get what you two are trying to do...

You already saw a completely different error message in the responses to #9279, therefore it was hitting the exit before and it's not hitting it anymore.

LazyBumHorse commented 5 years ago

@bparker06 I improved the error messages using XGetErrorText, this should do everything you wanted.

asavah commented 5 years ago

@bparker06 Don't if it's still usefull or not here is the backtrace as requested

Thread 1 "retroarch" hit Catchpoint 2 (call to syscall exit_group), __GI__exit (status=status@entry=1) at ../sysdeps/unix/sysv/linux/_exit.c:31
31      ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.
(gdb) bt
#0  __GI__exit (status=status@entry=1) at ../sysdeps/unix/sysv/linux/_exit.c:31
#1  0x00007ffff53b37b2 in __run_exit_handlers (status=1, listp=<optimized out>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:132
#2  0x00007ffff53b384a in __GI_exit (status=<optimized out>) at exit.c:139
#3  0x0000555555876ae0 in x_gl_version_error_handler (dpy=0x555556a3fc00, event=0x7fffffffd300) at gfx/drivers_context/x_ctx.c:189
#4  0x00007ffff7c95587 in ?? () from /usr/lib/libX11.so.6
#5  0x00007ffff70dbc3b in ?? () from /usr/lib/libGL.so.1
#6  0x00007ffff70d7fcf in ?? () from /usr/lib/libGL.so.1
#7  0x00005555558781a3 in gfx_ctx_x_set_video_mode (data=0x5555569e38e0, video_info=0x7fffffffd7a0, width=3840, height=2160, fullscreen=true) at gfx/drivers_context/x_ctx.c:902
#8  0x00005555555d5db3 in video_context_driver_set_video_mode (mode_info=0x7fffffffdd0c) at retroarch.c:18799
#9  0x00005555558c9fd6 in gl_core_init (video=0x7fffffffdd80, input=0x5555561f0490 <current_input>, input_data=0x5555561f0498 <current_input_data>) at gfx/drivers/gl_core.c:993
#10 0x00005555555d1f63 in video_driver_init_internal (video_is_threaded=0x7fffffffde1f) at retroarch.c:16884
#11 0x00005555555d7447 in drivers_init (flags=1023) at retroarch.c:19609
#12 0x00005555555dab0e in retroarch_main_init (argc=4, argv=0x7fffffffe498) at retroarch.c:21653
#13 0x00005555555f6b20 in content_load (info=0x7fffffffe360) at tasks/task_content.c:655
#14 0x00005555555f9531 in task_load_content_callback (content_info=0x7fffffffe360, loading_from_menu=true, loading_from_cli=true) at tasks/task_content.c:2070
#15 0x00005555555f975a in task_push_load_content_from_cli (core_path=0x0, fullpath=0x0, content_info=0x7fffffffe360, type=CORE_TYPE_PLAIN, cb=0x0, user_data=0x0) at tasks/task_content.c:2151
#16 0x00005555555ba02c in rarch_main (argc=4, argv=0x7fffffffe498, data=0x0) at retroarch.c:5188
#17 0x00005555555ba0c2 in main (argc=4, argv=0x7fffffffe498) at retroarch.c:5241
(gdb) bt full
#0  __GI__exit (status=status@entry=1) at ../sysdeps/unix/sysv/linux/_exit.c:31
        resultvar = 18446744073709551578
#1  0x00007ffff53b37b2 in __run_exit_handlers (status=1, listp=<optimized out>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:132
No locals.
#2  0x00007ffff53b384a in __GI_exit (status=<optimized out>) at exit.c:139
No locals.
#3  0x0000555555876ae0 in x_gl_version_error_handler (dpy=0x555556a3fc00, event=0x7fffffffd300) at gfx/drivers_context/x_ctx.c:189
No locals.
#4  0x00007ffff7c95587 in ?? () from /usr/lib/libX11.so.6
No symbol table info available.
#5  0x00007ffff70dbc3b in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#6  0x00007ffff70d7fcf in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#7  0x00005555558781a3 in gfx_ctx_x_set_video_mode (data=0x5555569e38e0, video_info=0x7fffffffd7a0, width=3840, height=2160, fullscreen=true) at gfx/drivers_context/x_ctx.c:902
        i = 0
        gl_versions = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {3, 1}, {3, 0}}
        gles_versions = {{2, 0}, {1, 1}, {1, 0}}
        version_rows = 11
        gl_version_rows = 11
        gles_version_rows = 3
        versions = 0x7fffffffd500
        attribs = {8337, 4, 8338, 6, 37158, 1, 8340, 1, 0, 0, 0, 0, 0, 0, 0, 0}
        aptr = 0x7fffffffd4e0
        event = {type = 19, xany = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306}, xkey = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0,
            state = 0, keycode = 0, same_screen = 0}, xbutton = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, state = 0, button = 0, same_screen = 0}, xmotion = {type = 19,
            serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, state = 0, is_hint = 0 '\000', same_screen = 0}, xcrossing = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00,
            window = 4194306, root = 4194306, subwindow = 0, time = 0, x = 0, y = 0, x_root = 0, y_root = 0, mode = 0, detail = 0, same_screen = 0, focus = 32770, state = 32768}, xfocus = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, mode = 4194306,
            detail = 0}, xexpose = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, x = 4194306, y = 0, width = 0, height = 0, count = 0}, xgraphicsexpose = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, drawable = 4194306, x = 4194306,
            y = 0, width = 0, height = 0, count = 0, major_code = 0, minor_code = 0}, xnoexpose = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, drawable = 4194306, major_code = 4194306, minor_code = 0}, xvisibility = {type = 19, serial = 75, send_event = 0,
            display = 0x555556a3fc00, window = 4194306, state = 4194306}, xcreatewindow = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, parent = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, override_redirect = 0}, xdestroywindow = {
            type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, event = 4194306, window = 4194306}, xunmap = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, event = 4194306, window = 4194306, from_configure = 0}, xmap = {type = 19, serial = 75, send_event = 0,
            display = 0x555556a3fc00, event = 4194306, window = 4194306, override_redirect = 0}, xmaprequest = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, parent = 4194306, window = 4194306}, xreparent = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00,
            event = 4194306, window = 4194306, parent = 0, x = 0, y = 0, override_redirect = 0}, xconfigure = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, event = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, above = 0,
            override_redirect = 0}, xgravity = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, event = 4194306, window = 4194306, x = 0, y = 0}, xresizerequest = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, width = 4194306, height = 0},
          xconfigurerequest = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, parent = 4194306, window = 4194306, x = 0, y = 0, width = 0, height = 0, border_width = 0, above = 0, detail = 0, value_mask = 140746078289920}, xcirculate = {type = 19, serial = 75, send_event = 0,
            display = 0x555556a3fc00, event = 4194306, window = 4194306, place = 0}, xcirculaterequest = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, parent = 4194306, window = 4194306, place = 0}, xproperty = {type = 19, serial = 75, send_event = 0,
            display = 0x555556a3fc00, window = 4194306, atom = 4194306, time = 0, state = 0}, xselectionclear = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, selection = 4194306, time = 0}, xselectionrequest = {type = 19, serial = 75, send_event = 0,
            display = 0x555556a3fc00, owner = 4194306, requestor = 4194306, selection = 0, target = 0, property = 0, time = 0}, xselection = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, requestor = 4194306, selection = 4194306, target = 0, property = 0, time = 0},
          xcolormap = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, colormap = 4194306, new = 0, state = 0}, xclient = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, message_type = 4194306, format = 0, data = {
              b = '\000' <repeats 19 times>, s = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, l = {0, 0, 0, 0, 140746078289920}}}, xmapping = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306, request = 4194306, first_keycode = 0, count = 0}, xerror = {type = 19,
            display = 0x4b, resourceid = 42949672960, serial = 93825014168576, error_code = 2 '\002', request_code = 0 '\000', minor_code = 64 '@'}, xkeymap = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, window = 4194306,
            key_vector = "\002\000@", '\000' <repeats 28 times>}, xgeneric = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, extension = 4194306, evtype = 0}, xcookie = {type = 19, serial = 75, send_event = 0, display = 0x555556a3fc00, extension = 4194306, evtype = 0,
            cookie = 4194306, data = 0x0}, pad = {19, 75, 42949672960, 93825014168576, 4194306, 4194306, 0, 0, 0, 0, 0, 140746078289920, 140737488388096, -1, -1, 0, 25769803776, 4294967297, 124, 0, 0, 141162690117632, 4294967296, 1}}
        true_full = true
        windowed_full = false
        val = 0
        x_off = 0
        y_off = 0
        vi = 0x555556c18580
        swa = {background_pixmap = 0, background_pixel = 0, border_pixmap = 0, border_pixel = 0, bit_gravity = 0, win_gravity = 0, backing_store = 0, backing_planes = 0, backing_pixel = 0, save_under = 0, event_mask = 131135, do_not_propagate_mask = 0, override_redirect = 0, colormap = 4194305,
          cursor = 0}
        wm_name = 0x555556dd0b70 "\200\222\334VUU"
        old_handler = 0x7ffff7c95460
        x = 0x5555569e38e0
        net_wm_icon = 345
        cardinal = 6
        settings = 0x7ffff0490010
        opacity = 4294967295
#8  0x00005555555d5db3 in video_context_driver_set_video_mode (mode_info=0x7fffffffdd0c) at retroarch.c:18799
        video_info = {input_menu_swap_ok_cancel_buttons = true, input_driver_nonblock_state = false, shared_context = true, black_frame_insertion = false, hard_sync = false, fps_show = false, statistics_show = false, framecount_show = false, scale_integer = false, post_filter_record = false,
          windowed_fullscreen = false, fullscreen = true, font_enable = true, use_rgba = false, libretro_running = false, xmb_shadows_enable = true, battery_level_enable = false, timedate_enable = true, runloop_is_slowmotion = false, runloop_is_idle = false, runloop_is_paused = false,
          is_perfcnt_enable = false, menu_is_alive = false, msg_bgcolor_enable = false, custom_vp_x = 0, custom_vp_y = 0, crt_switch_center_adjust = 0, hard_sync_frames = 0, aspect_ratio_idx = 22, max_swapchain_images = 3, monitor_index = 0, crt_switch_resolution = 0,
          crt_switch_resolution_super = 2560, width = 0, height = 0, xmb_theme = 0, xmb_color_theme = 4, menu_shader_pipeline = 2, materialui_color_theme = 0, ozone_color_theme = 1, custom_vp_width = 960, custom_vp_height = 720, custom_vp_full_width = 0, custom_vp_full_height = 0,
          menu_wallpaper_opacity = 0.300000012, menu_framebuffer_opacity = 0.899999976, menu_header_opacity = 1, menu_footer_opacity = 1, refresh_rate = 59.9400597, font_msg_pos_x = 0.0500000007, font_msg_pos_y = 0.0500000007, font_msg_color_r = 1, font_msg_color_g = 1, font_msg_color_b = 0,
          xmb_alpha_factor = 75, fps_text = "\000\000\377\377\000\000\000\000\000\377\377\377I_vide\000\000synV ", '\000' <repeats 19 times>, "Y\000HOME\000%s%s\000rb", '\000' <repeats 18 times>, "      \000        ", '\000' <repeats 36 times>,
          stat_text = '\000' <repeats 44 times>, "Y\000HOME\000%s%s\000rb", '\000' <repeats 18 times>, "      \000        ", '\000' <repeats 49 times>, "\002\000\000\000\000\000\000\000\006\000\000\000\000\000\000\200", '\000' <repeats 48 times>...,
          chat_text = "2160@\005\000\000\000\000\000\000\030\000\000\000\000\000\000\000\360\222\232VUU\000\000\340\342R\365\377\177\000\000\021\231>\365\377\177", '\000' <repeats 18 times>, "\060\333\377\377\377\177\000\000\223\347dUUU\000\000\220\344\377\377\377\177\000\000X\333\377\377\377\177\000\000@\035\366UUU\000\000/\345\315UUU\000\000\000\000\000\000\000\000\000\000\360\222\232VUU\000\000 \334\377\377\377\177\000\000\237\352dUUU\000\000\000\000\000\000\000\000\000\000@\035\366UUU\000\000\f\335\377\377\377\177\000\000\030\000\000\000\060\000\000\000\060\334\377\377\377\177\000\000p\333\377\377\377\177", '\000' <repeats 11 times>, "\017\000\000\000\000\000\000"..., frame_count = 93824992763738, frame_time = -nan(0x7fdc20), frame_rate = 0, osd_stat_params = {x = 8.69835567e+13, y = 0, scale = -nan(0x7fdc20), drop_mod = 0, drop_x = 1453209824, drop_y = 21845,
            drop_alpha = -nan(0x7fdc20), color = 32767, full_screen = false, text_align = (TEXT_ALIGN_RIGHT | unknown: 21844)}, cb_update_window_title = 0x5555558748a5 <x11_update_title>, cb_swap_buffers = 0x555555876f76 <gfx_ctx_x_swap_buffers>,
          cb_get_metrics = 0x555555874043 <x11_get_metrics>, cb_set_resize = 0x555555877163 <gfx_ctx_x_set_resize>, context_data = 0x5555569e38e0, userdata = 0x0}
#9  0x00005555558c9fd6 in gl_core_init (video=0x7fffffffdd80, input=0x5555561f0490 <current_input>, input_data=0x5555561f0498 <current_input_data>) at gfx/drivers/gl_core.c:993
        mode = {width = 3840, height = 2160, fullscreen = true}
        inp = {input = 0x7fffffffdd10, input_data = 0x1555b355f}
        full_x = 3840
        full_y = 2160
        settings = 0x7ffff0490010
        interval = 0
--Type <RET> for more, q to quit, c to continue without paging--c
        win_width = 3840
        win_height = 2160
        temp_width = 0
        temp_height = 0
        vendor = 0x0
        renderer = 0x0
        version = 0x0
        error_string = 0x0
        gl = 0x5555569eaa90
        ctx_driver = 0x5555561b2ac0 <gfx_ctx_x>
        hwr = 0x5555561e6d00 <hw_render>
#10 0x00005555555d1f63 in video_driver_init_internal (video_is_threaded=0x7fffffffde1f) at retroarch.c:16884
        video = {fullscreen = true, vsync = false, force_aspect = true, font_enable = true, width = 0, height = 0, swap_interval = 1, smooth = true, is_threaded = false, rgb32 = false, input_scale = 2, parent = 0}
        max_dim = 320
        scale = 2
        width = 0
        height = 0
        custom_vp = 0x7ffff04ca8c8
        tmp = 0x5555561c08e0 <input_x>
        system = 0x0
        dummy_pixels = {0 <repeats 32 times>}
        settings = 0x7ffff0490010
        geom = 0x5555561e6fa0 <video_driver_av_info>
#11 0x00005555555d7447 in drivers_init (flags=1023) at retroarch.c:19609
        hwr = 0x5555561e6d00 <hw_render>
        video_is_threaded = false
        settings = 0x7ffff0490010
#12 0x00005555555dab0e in retroarch_main_init (argc=4, argv=0x7fffffffe498) at retroarch.c:21653
        init_failed = false
        global = 0x5555561c31a0 <g_extern>
#13 0x00005555555f6b20 in content_load (info=0x7fffffffe360) at tasks/task_content.c:655
        i = 0
        rarch_argc = 0
        rarch_argv = {0x0 <repeats 32 times>}
        argv_copy = {0x0 <repeats 32 times>}
        rarch_argv_ptr = 0x7fffffffe498
        rarch_argc_ptr = 0x7fffffffe360
        wrap_args = 0x5555569e34c0
        core_info = {supports_no_game = false, database_match_archive_member = false, firmware_count = 0, path = 0x0, config_data = 0x0, display_name = 0x0, display_version = 0x0, core_name = 0x0, system_manufacturer = 0x0, systemname = 0x0, system_id = 0x0, supported_extensions = 0x0, authors = 0x0, permissions = 0x0, licenses = 0x0, categories = 0x0, databases = 0x0, notes = 0x0, required_hw_api = 0x0, categories_list = 0x0, databases_list = 0x0, note_list = 0x0, supported_extensions_list = 0x0, authors_list = 0x0, permissions_list = 0x0, licenses_list = 0x0, required_hw_api_list = 0x0, firmware = 0x0, userdata = 0x0}
        core_info_list = 0x0
        ident_info = {ident = 0x0}
#14 0x00005555555f9531 in task_load_content_callback (content_info=0x7fffffffe360, loading_from_menu=true, loading_from_cli=true) at tasks/task_content.c:2070
        content_ctx = {subsystem = {data = 0x0, size = 0}, name_ips = 0x0, name_bps = 0x0, name_ups = 0x0, valid_extensions = 0x0, directory_cache = 0x0, directory_system = 0x0, is_ips_pref = false, is_bps_pref = false, is_ups_pref = false, block_extract = false, need_fullpath = false, set_supports_no_game_enable = false, patch_is_blocked = false, bios_is_missing = false, check_firmware_before_loading = false, temporary_content = 0x7ffff552c9e0 <main_arena>}
        ret = false
        error_string = 0x0
        global = 0x5555561c31a0 <g_extern>
        settings = 0x7ffff0490010
        sys_info = 0x5555561d9460 <runloop_system>
#15 0x00005555555f975a in task_push_load_content_from_cli (core_path=0x0, fullpath=0x0, content_info=0x7fffffffe360, type=CORE_TYPE_PLAIN, cb=0x0, user_data=0x0) at tasks/task_content.c:2151
No locals.
#16 0x00005555555ba02c in rarch_main (argc=4, argv=0x7fffffffe498, data=0x0) at retroarch.c:5188
        info = {argc = 4, argv = 0x7fffffffe498, args = 0x0, environ_get = 0x5555555b21e7 <frontend_unix_get_env>}
#17 0x00005555555ba0c2 in main (argc=4, argv=0x7fffffffe498) at retroarch.c:5241
No locals.

----------------------------------------------------
#3  0x0000555555876ae0 in x_gl_version_error_handler (dpy=0x555556a3fc00, event=0x7fffffffd300) at gfx/drivers_context/x_ctx.c:189
189     gfx/drivers_context/x_ctx.c: No such file or directory.
(gdb) print *dpy
$1 = <incomplete type>
(gdb) print *event
$2 = {type = 0, display = 0x555556a3fc00, resourceid = 1728, serial = 76, error_code = 167 '\247', request_code = 152 '\230', minor_code = 34 '"'}
ghost commented 5 years ago

@asavah Thanks, so this confirms the error handler itself called exit(). Can you now run up in gdb until it gets back to #3 0x0000555555876ae0 in x_gl_version_error_handler and then run the print commands I gave above?

Also can you post the complete output of glxinfo please? And what kind of monitor are you using? Do you perhaps have HDR enabled or any other special settings we might want to know about?

asavah commented 5 years ago

You have print outputs above, just below --------------------------- line.

full glxinfo https://pastebin.com/kaHP9wje

Nothing unusual, just a simple setup tailored for both Kodi and RetroArch. Xorg 1.20.5, mesa 19.1.4, openbox 3.6.1 The display is a samsung U28H750 connected via DP. No HDR, no funky stuff

ghost commented 5 years ago

Have you tried the regular gl video driver instead of glcore? In theory the same error should happen for it as well. Otherwise I'm not sure what is different about the glcore driver that would cause it.

asavah commented 5 years ago

Yes, gl works fine, vulkan works fine.

ghost commented 5 years ago

The error you are getting is [WARN] [GLX]: message: GLXBadFBConfig, request code: 152, minor code: 34, and if I look at the list of GLXFBConfigs from your glxinfo output, I do see a bunch of 10-bit (HDR) outputs possible, I wonder if your X11 server happens to be using one and maybe that's causing the problem? Can you pastebin your /var/log/Xorg.0.log file? This should tell us what's actually being used.

asavah commented 5 years ago

Xorg,log https://pastebin.com/2Fi8NTvP xrandr --verbose https://pastebin.com/5uVqAXv4

asavah commented 5 years ago

It's mesa bug, see https://github.com/libretro/RetroArch/pull/9279#issuecomment-520261619 for details.

negativeExponent commented 5 years ago

im getting this problem as well using beetle psx hw even on opengl driver