[Python] How to diagnose GLXBadDrawable in Komorebi

Discussão em 'Python' iniciado por Stack, Julho 4, 2025.

  1. Stack

    Stack Membro Participativo

    TL;DR - When I run Komorebi with multiple monitors plugged in, I get an error GLXBadDrawable. I'm a total noob at every level of the stack involved here, so I'm struggling to figure out where to look for the root cause.

    Full context on this issue can be found in this Github issue, but for good measure I've reproduced the text of it here:

    Okay, I have driven myself to the mountains of madness investigating this issue, but here's what I've found:

    STEPS TO REPRODUCE:

    Build and install latest development branch (I have a Bash script that does some bookkeeping to account for the fact that I use pyenv, but that seems unlikely to be the culprit.)

    Get another display plugged in (in my case a cheap Westinghouse TV over HDMI). Here's the result of xrandr --query:


    eDP connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 344mm x 194mm
    1920x1080 60.00*+
    1680x1050 60.00
    1280x1024 60.00
    1440x900 60.00
    1280x800 60.00
    1280x720 60.00
    1024x768 60.00
    800x600 60.00
    640x480 60.00
    HDMI-A-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 760mm x 450mm
    1360x768 60.02 +
    1920x1080 60.00* 50.00 59.94 24.00 23.98
    1280x720 60.00 50.00 59.94
    1024x768 75.03 70.07 60.00
    800x600 72.19 75.00 60.32
    720x576 50.00
    720x480 60.00 59.94
    640x480 75.00 72.81 60.00 59.94
    720x400 70.08
    DisplayPort-0 disconnected (normal left inverted right x axis y axis)



    then run komorebi

    EXPECTED BEHAVIOR:

    Komorebi starts, displays wallpaper, on both screens, etc

    ACTUAL BEHAVIOR:

    [WARNING]: Backend doesn't support single context mode
    [ERROR]: got an invalid wallpaper. Setting to default: foggy_sunny_mountain

    (komorebi:46051): Clutter-WARNING **: 09:20:14.894: Failed to set the markup of the actor 'ClutterText': Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &
    [ERROR]: got an invalid wallpaper. Setting to default: foggy_sunny_mountain

    (komorebi:46051): Clutter-WARNING **: 09:20:15.254: Failed to set the markup of the actor 'ClutterText': Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &

    (komorebi:46051): Gdk-ERROR **: 09:20:15.796: The program 'komorebi' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'GLXBadDrawable'.
    (Details: serial 902 error_code 160 request_code 152 (GLX) minor_code 29)
    (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.)
    Trace/breakpoint trap (core dumped



    NOTE: Single context mode note doesn't seem relevant, based on my testing.

    I don't have a debug build of X11 at hand, so unfortunately I can't follow the errors instructions. However, I built an .so that can be used to probe around the calls. Here's the output of running komorebi with LD_PRELOAD="./debug_hook.so":


    The error was 'GLXBadDrawable'.
    (Details: serial 902 error_code 160 request_code 152 (GLX) minor_code 29)
    (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.)
    Trace/breakpoint trap (core dumped11 Error Handler Initialized (PID: 43721)
    [10532.365740] GLX_HOOK: Constructor called (PID: 43721)
    [10532.368356] GLX_HOOK: X11 Error Handler Initialized (PID: 43721)
    [10532.368383] GLX_HOOK: Constructor called (PID: 43721)
    [10532.443264] DISPLAY_OPENED: :default: (ptr=0x6542a838f120)
    [10532.443264] ERROR_HANDLER: Installed custom handler (original=0x76a2ba104890)
    [10532.468585] DISPLAY_OPENED: :1 (ptr=0x6542a846df60)
    [10532.468585] ERROR_HANDLER: Installed custom handler (original=0x76a2b76bece0)
    [10533.872128] X11_ERROR: GLXBadDrawable (code=160, serial=650, request=152, minor=29)
    [10533.872128] GLX_SPECIFIC: glXGetDrawableAttributes operation failed
    [10533.872128] GLX_ANALYSIS: BadDrawable error in glXGetDrawableAttributes
    [10533.872128] Display: :1, Screens: 1, Default: 0
    [10533.872128] Current GLX context: 0x6542a85f59d0
    [10533.872128] Current GLX drawable: 0x360001d
    [10533.872300] X11_ERROR: BadWindow (code=3, serial=651, request=3, minor=0)



    Currently trying to figure out how to obtain more information about this error, e.g., by listing the displays known to X11 at the time of the error, but that's proving a little troublesome.

    Finally, it appears that I have only one X display available, ie:


    ✘ phillipdavis@acorn  /tmp/.X11-unix  ls
    X1

    Continue reading...

Compartilhe esta Página