keymap: hash table collisions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
udev |
Fix Released
|
Undecided
|
Martin Pitt | ||
udev (Ubuntu) |
Fix Released
|
Medium
|
Martin Pitt |
Bug Description
Binary package hint: udev
<mezcalero> [22:31:27] pitti: i just ran udev through llvm-clang-analyzer
<mezcalero> [22:32:22] pitti: as it turns out the keymap in the kernel is not bijective
<mezcalero> [22:32:36] pitti: i.e. more than one name are mapped to the same key
<mezcalero> [22:33:08] example: HANGEUL and HANGUEL
<mezcalero> [22:33:26] pitti: now, the perfect hashtable that is generated from that is actually not that perfect due to that
<mezcalero> [22:33:31] and weird things might happen
<mezcalero> [22:33:40] pitti: this probably should be fixed in some way
<mezcalero> [22:33:52] pitti: probably by preprocessing input.h in some and filtering out duplicates
<mezcalero> [22:34:01] and sticking to the first names defined there in case of an ambiguity
<mezcalero> [22:34:11] pitti: just wanted to ping you about that...
<mezcalero> [22:34:57] pitti: http://
<mezcalero> [22:37:31] pitti: the fix is probably as easy as simply filtering KEY_HANGUEL, KEY_COFFEE, KEY_MIN_INTERESTING from the table
<mezcalero> [22:37:53] pitti: because they seem to be irrelevant as real keys
1.
In file included from extras/
2.
extras/
3.
[KEY_HANGUEL] = "KEY_HANGUEL",
4.
^~~~~~~~~~~~~
5.
extras/
6.
[KEY_HANGEUL] = "KEY_HANGEUL",
7.
^~~~~~~~~~~~~
8.
extras/
9.
[
10.
^
11.
extras/
12.
[KEY_COFFEE] = "KEY_COFFEE",
13.
^~~~~~~~~~~~
14.
extras/
15.
[
16.
^
17.
extras/
18.
[KEY_MUTE] = "KEY_MUTE",
19.
^~~~~~~~~~
Related branches
Changed in udev (Ubuntu): | |
assignee: | nobody → Martin Pitt (pitti) |
importance: | Undecided → Medium |
status: | New → In Progress |
OK, instead of filtering particular keys, I fixed the awk invocation to ignore aliases:
- $(AM_V_GEN)$(AWK) '/^#define.*KEY_/ { if ($$2 != "KEY_MAX" && $$2 != "KEY_CNT") { print $$2 } }' < $< > $@ ]]+[0-9] / { if ($$2 != "KEY_MAX") { print $$2 } }' < $< > $@
+ $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[[:space:
This changes keys.txt as folllows:
--- keys.txt.old 2009-09-09 10:39:37.000000000 +0200 INTERESTING
+++ keys.txt 2009-09-09 11:03:01.000000000 +0200
@@ -120,7 +120,6 @@
KEY_SCALE
KEY_KPCOMMA
KEY_HANGEUL
-KEY_HANGUEL
KEY_HANJA
KEY_YEN
KEY_LEFTMETA
@@ -151,7 +150,6 @@
KEY_WWW
KEY_MSDOS
KEY_COFFEE
-KEY_SCREENLOCK
KEY_DIRECTION
KEY_CYCLEWINDOWS
KEY_MAIL
@@ -376,4 +374,3 @@
KEY_NUMERIC_9
KEY_NUMERIC_STAR
KEY_NUMERIC_POUND
-KEY_MIN_
Thanks for finding this!