legionus / kbd

Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git
https://kbd-project.org
Other
84 stars 41 forks source link

Unknown keysym 'endash' in fr-bepo #75

Closed Artefact2 closed 1 day ago

Artefact2 commented 2 years ago

I am running Arch Linux with kbd 2.4.0.

Trying to load fr-bepo.map with loadkeys prints the following error message.

unknown keysym 'endash'
lk_add_key called with bad keycode -1

The key map still gets applied, but because the return code is 1, this makes some parts of the early boot process (everything that depends on systemd-vconsole-setup.service) fail.

The symbol is in the map file as a U+xxxx sequence, and it seems that they all fail to load.

legionus commented 2 years ago

@Artefact2 endash is not used in any keymap in kbd. I just tried to load the fr-bepo.map and didn't get any errors.

Please attach the fr-bepo.map you are using. It looks like this keymap has been modified or some other add-on is trying to load along with this keymap.

Artefact2 commented 2 years ago

Hi @legionus and thanks for the reply.

My fr-bepo.map is the same as yours, I get the same error regardless:

Silmeria ~/Downloads % wget "https://raw.githubusercontent.com/legionus/kbd/c6c694147e1c04a1e2e7cc61ea0e5e6ec9fbce6b/data/keymaps/i386/bepo/fr-bepo.map"
2022-04-11 13:41:11 (27.0 MB/s) - ‘fr-bepo.map’ saved [7774/7774]
Silmeria ~/Downloads % sudo loadkeys ./fr-bepo.map 
unknown keysym 'endash'
lk_add_key called with bad keycode -1
legionus commented 2 years ago

Try to search the endash in the your /usr/share/kbd (I hope I found the correct source package in archlinux).

Artefact2 commented 2 years ago

Trying to investigate the issue further. The issue happens while trying to parse U+2013 (endash), the first UNUMBER listed in the fr-bepo map. It gets converted to endash in convert_code() but then fails to convert back when calling ksymtocode(). Because the direction is TO_8BIT, the cp1250 charset (that contains endash) is not scanned.

(gdb) break ksyms.c:370
Breakpoint 1 at 0x555555571004: file ksyms.c, line 370.
(gdb) run /usr/share/kbd/keymaps/i386/bepo/fr-bepo.map.gz 
Starting program: /home/romain/Downloads/kbd/trunk/src/kbd/src/loadkeys /usr/share/kbd/keymaps/i386/bepo/fr-bepo.map.gz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Detaching after vfork from child process 178622]

Breakpoint 1, ksymtocode (ctx=ctx@entry=0x55555558cbd0, s=0x55555557a210 "endash", direction=direction@entry=0x0) at ksyms.c:370
370             ERR(ctx, _("unknown keysym '%s'"), s);
(gdb) bt
#0  ksymtocode (ctx=ctx@entry=0x55555558cbd0, s=0x55555557a210 "endash", direction=direction@entry=0x0) at ksyms.c:370
#1  0x0000555555571115 in convert_code (ctx=ctx@entry=0x55555558cbd0, code=0xd013, direction=0x0, direction@entry=0xffffffff) at ksyms.c:409
#2  0x000055555556dc30 in yyparse (scanner=0x55555558d110, ctx=ctx@entry=0x55555558cbd0) at /home/romain/Downloads/kbd/trunk/src/kbd/src/libkeymap/parser.y:398
#3  0x000055555556e0ee in lk_parse_keymap (ctx=ctx@entry=0x55555558cbd0, fp=fp@entry=0x55555558e5a0) at /home/romain/Downloads/kbd/trunk/src/kbd/src/libkeymap/parser.y:420
#4  0x0000555555567e1c in main (argc=<optimized out>, argv=0x7fffffffea98) at loadkeys.c:281
(gdb) 
legionus commented 1 day ago

Let me know if this is still relevant.