#994037 x11-xkb-utils: xkbcomp fails with "X Error of failed request: BadValue" for XkbSetMap on specific config

Package:
x11-xkb-utils
Source:
x11-xkb-utils
Description:
X11 XKB utilities
Submitter:
Vincent Lefevre
Date:
2021-09-10 16:27:06 UTC
Severity:
important
#994037#5
Date:
2021-09-10 12:31:38 UTC
From:
To:
On one of my machines:

cventin:~> cat .xkb/keymap/custom
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+gb+inet(evdev)+local"       };
        xkb_geometry  { include "pc(pc105)"     };
};

cventin:~> cat .xkb/symbols/local
xkb_symbols "local" {
    key <RALT> {
        type = "TWO_LEVEL",
        symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
    };
};

cventin:~> xkbcomp -w 0 -I$HOME/.xkb -R$HOME/.xkb keymap/custom $DISPLAY
Internal error:   Could not resolve keysym XF86BrightnessAuto
Internal error:   Could not resolve keysym XF86DisplayOff
[...]
Internal error:   Could not resolve keysym XF86KbdLcdMenu4
Internal error:   Could not resolve keysym XF86KbdLcdMenu5
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  135 (XKEYBOARD)
  Minor opcode of failed request:  9 (XkbSetMap)
  Value in failed request:  0x166c0002
  Serial number of failed request:  120
  Current serial number in output stream:  126

The internal errors are unrelated. The real issue is the BadValue.
If I change TWO_LEVEL to ONE_LEVEL, the error disappears (but I
don't get the second level).

There is no such issue with xkb-data 2.29-2.

Note: it is TWO_LEVEL that yields the error, not Multi_key (if I replace
Multi_key by a second ISO_Level3_Shift, I still get the error).

#994037#10
Date:
2021-09-10 16:24:37 UTC
From:
To:
Control: reassign -1 x11-xkb-utils 7.7+5
Control: retitle -1 x11-xkb-utils: xkbcomp fails with "X Error of failed request: BadValue" for XkbSetMap on specific config
So, this seems to be more a bug of xkbcomp. In particular, the
error message is very cryptic, and I couldn't find any clue on
the web (except from users who obtained a similar error several
years ago, but this was eventually fixed in xkbcomp, like
<https://bugs.freedesktop.org/show_bug.cgi?id=45188>).

My problem is reproducible with:

zira:~> cat .xkb/keymap/custom
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete" };
        xkb_compat    { include "complete" };
        xkb_symbols   { include "pc+gb+level3(ralt_switch)+local" };
        xkb_geometry  { include "pc(pc105)" };
};

zira:~> cat .xkb/symbols/local
xkb_symbols "local" {
    key <RALT> {
        type = "TWO_LEVEL",
        symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
    };
};

zira:~> xkbcomp -I$HOME/.xkb -R$HOME/.xkb keymap/custom $DISPLAY
[unrelated warnings]
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  135 (XKEYBOARD)
  Minor opcode of failed request:  9 (XkbSetMap)
  Value in failed request:  0x166c0002
  Serial number of failed request:  120
  Current serial number in output stream:  126