Missing boundary-checks in XkbApplyMappingChange?
Daniel Stone
daniel at fooishbar.org
Sat Nov 17 06:51:30 PST 2007
On Sat, Nov 17, 2007 at 02:39:14PM +0100, Magnus Vigerlöf wrote:
> We (linuxwacom) got hit by a strange crash recently. As we want to be able to
> map some of the buttons on the tablet to key-presses/-releases for simple
> shortcuts we register a few keys with InitKeyClassDeviceStruct.
>
> The driver has until now registered at most 32 keys (8-40) to be able to
> report these, but with Xorg7.3 (and master) we've seen a crash by simply
> running one of the following commands (and only when a wacom InputDevice is
> configured):
> $ xmodmap -e 'keysym Alt_L = Meta_L Alt_L'
> $ xmodmap -e "keysym BackSpace = Delete"
>
> The stacktrace that is printed is always the following:
>
> Backtrace:
> 2: /home/wigge/.Xorg/bin/Xorg(XkbApplyMappingChange+0x1b9) [0x818da69]
> [...]
>
> By changing the number of registered keys to 512 I got rid of the crash, but I
> feel this is not the correct way of doing it.. I suspect a missing boundary
> check in XkbApplyMappingChange here. Is it so, or are we not using the
> interface in the correct way?
Hi,
The short answer is that you should pretty much always have 255 keys in
your keymap. I know it sounds unnecessary, but it also hopelessly
complicates things. I'm hoping to simplify the server post-1.5 by just
always having 255 keys. In the meantime, it may work, but as you can
see, it's not incredibly well tested.
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20071117/2ad1ca26/attachment.pgp>
More information about the xorg
mailing list