xmodmap freezes system with high CPU load for more than one minute
Submitted by nachoparker
Assigned to Xorg Project Team
Description
Created attachment 126163 my modmap
Issuing 'xmodmap mymodmap' causes the x system to freeze for minutes on a high CPU load, or rather, become unresponsive to keyboard or mouse input.
This issue has been reported elsewhere for years, for instance in
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/998310
- https://bugs.launchpad.net/ubuntu/+source/openbox/+bug/1391679
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550533
- http://www.archivum.info/ubuntu-bugs@lists.ubuntu.com/2014-11/10065/(Bug-1391679)-Re-xmodmap-freezes-openbox-in-lubuntu-14.10.html
I use openbox Openbox 3.6.1 in Arch Linux. Right now I use xserver 1.18.4-1, but this has been happening to me for years ( and the people on the links above ).
Steps to reproduce
- xmodmap mymodmap
Find mymodmap attached to this bug report.
Some observations:
-
The bigger mymodmap file is ( the more lines ) the longer it takes for the system to come back to responsiveness.
-
I anaylised the Xorg process using perf, and it seems to me that the culprits are ResourceClientBits, GrabMatchesSecond,DeletePassiveGrabFromList and so on, as you can see on this output:
14,63% Xorg Xorg [.] ResourceClientBits
11,83% Xorg Xorg [.] GrabMatchesSecond
5,17% Xorg Xorg [.] DeletePassiveGrabFromList
5,08% Xorg Xorg [.] AddPassiveGrabToList
2,44% Xorg Xorg [.] 0x000000000004fb70
1,80% Xorg [kernel.vmlinux] [k] do_select
1,49% Xorg [kernel.vmlinux] [k] unix_poll
1,33% Xorg Xorg [.] 0x000000000004fb85
1,31% Xorg Xorg [.] 0x000000000004fbd1
1,21% Xorg Xorg [.] 0x000000000004fbde
1,14% Xorg Xorg [.] 0x000000000004fbc0
- My system tops at around 23% CPU on all 6 CPUs while irresponsive.
Attachment 126163, "my modmap":
mymodmap