.Xmodmap file makes xorg temporarily reach high cpu usage (90%-100%) after resume or when coming back from tty to X session

Bug #998310 reported by avlas
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Xfce4 Settings
Fix Released
Unknown
xfce4-settings (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

Each time when I resume my laptop, my computer nearly freezes for about 5 minutes and Xorg is using 90-100% cpu. This issue disappears and then everything is back to normal.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: xorg 1:7.6+12ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.38-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Fri May 11 22:57:03 2012
EcryptfsInUse: Yes
InstallationMedia: Kubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427)
ProcEnviron:
 LANGUAGE=ca_ES
 TERM=xterm
 LANG=ca_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: xorg
UpgradeStatus: Upgraded to precise on 2012-03-25 (47 days ago)

Revision history for this message
avlas (avlas) wrote :
Revision history for this message
avlas (avlas) wrote :

I attach part of kern.log that may be useful

bugbot (bugbot)
tags: added: kubuntu
Revision history for this message
avlas (avlas) wrote :

This happens to me since I upgraded from oneiric, any clue of how to get rid of this annoying bug?

Revision history for this message
Bryce Harrington (bryce) wrote :

Generally high X CPU bugs are not due to X itself but rather due to a client program. See http://wiki.ubuntu.com/X/Troubleshooting/HighCPU and try filing a more specific bug report.

Changed in xorg (Ubuntu):
status: New → Invalid
Revision history for this message
avlas (avlas) wrote :

Thanks for the info...

Playing a bit with it, I realized that the issue is actually related to using a .Xmodmap file. When I remove it from $HOME the issue is gone but it comes back as soon as I create a new .Xmodmap (which is important for me to get catalan characters in a us keyboard).

summary: - xorg temporarily reaches high cpu usage (90%-100%) after resume
+ .Xmodmap file makes xorg temporarily reach high cpu usage (90%-100%)
+ after resume or when coming back from tty to X session
Revision history for this message
avlas (avlas) wrote :

I modify the title of this bug as well as the status as result of the new evidence...

Changed in xorg (Ubuntu):
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg (Ubuntu):
status: New → Confirmed
Revision history for this message
Steffen (fragone) wrote :

I have a related problem on a freshly installed Xubuntu 12.10.
When I type the following commands, everything but the mouse pointer freezes for several minutes.

xmodmap -pke > .Xmodmap
xmodmap ~/.Xmodmap

Revision history for this message
Sebastian Blask (blask) wrote :

Having a .Xmodmap file in my home directory under Xubuntu 12.10 causes 1 or my CPU cores to use 100% on startup for every login. xfsettingsd uses quite some CPU as well. When I suspend it, X stops using all the CPU and resuming it makes X using all the CPU again. After a few minutes all is back to normal. During this time, None of the keys is usable.

Revision history for this message
kmic (kmic2006) wrote :

I had the same problem on my Xubuntu 12.04 too, but only for new created accounts, not for my existing one. After some hours of trial and error I've got the one file, which made the difference: It was ~/.cache/sessions/xfce4-session-MYCOMPUTERNAME:0 . So simply saving the desktop session once solved the issue for me.

The hole problem and the solution/workaround is easily to reproduce, at least on my machine with Xubuntu 12.04:
1. Create a new user account with an completly empty home-directory.
2. Copy the .Xmodmap file to that home-directory.
3. Log in. There will be a lot of files automatically created, the .Xmodmap file will be read in and Xorg will run at 100%.
4. Ignore what Xorg is doing and go (under XFCE) to Main menu -> Settings -> Settings -> Session and Startup -> Session -> Save session.
5. Wait until the session is saved, log out, log in and everything is fine. The .Xmodmap is read in, but no Xorg running at 100%.

Notes:
- Maybe you have on an existing account also to disable the xfce4-settings-helper in Main menu -> Settings -> Settings -> Session and Startup -> Application Autostart, but I'm not sure about that.
- When I manually read in the .Xmodmap with the command "xmodmap ~/.Xmodmap", there will still be 100% CPU for about one minute, both in the existing and in the new account. But because I do not need to read it in manually, this is, at least for me, no problem.
- Debian seems to have the same bug, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687112 .

Revision history for this message
penalvch (penalvch) wrote :

avlas, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please confirm this issue exists with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ . If the issue remains, could you please run the following command from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

If reproducible, could you please provide the information following https://wiki.ubuntu.com/DebuggingKernelSuspend ?

If reproducible, could you also please test the latest upstream kernel available (not the daily folder) following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.3.13-rc6

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

affects: xorg (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
peer_gynt (andre--ubuntu) wrote :

I still see this on Mint 16, fresh install. Not sure if this is relevant to this ubuntu tracker, but wanted to mention it.

Revision history for this message
penalvch (penalvch) wrote :

peer_gynt, thank you for your comment. Unfortunately, reporting bugs about Mint wouldn't be terribly helpful here. However, if this would be reproducible in Ubuntu with your hardware, please feel free file a new report in Ubuntu (not Mint) by executing the following in a terminal:
ubuntu-bug xorg

Please ensure you have xdiagnose installed, and that you click the Yes button for attaching additional debugging information.

For more on this, please see the official Ubuntu documentation:
Ubuntu X.Org Team, Ubuntu Bug Control, and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report will delay your problem being addressed as quickly as possible.

Thank you for your understanding.

Revision history for this message
Krylov Ivan (krylov-r00t) wrote :

I couldn't reproduce this bug in Xubuntu 14.04. Also, there is no /usr/bin/xfce4-settings-helper which caused Xorg to eat 100% CPU.

Revision history for this message
icyrock.com (icyrock-com) wrote :

May be related to https://bugs.launchpad.net/ubuntu/+source/xfce4-settings/+bug/1395547, using Xubuntu 14.10. The behavior doesn't look completely the same, only similar.

Revision history for this message
Leichtbau mechanik (r-guemperlein) wrote :

I can confirm this bug for Xubuntu 16.04
Kmoc's workaround does not help.

Please tell me how I can assist with further information.

Revision history for this message
ITEAS (info-tux-pc) wrote :

I can confirm this bug for Kubuntu 16.04 too. Any workaround?

Revision history for this message
kayn (pulecp) wrote :

I can confirm this issue on Archlinux. My workaround is to remove ~/.Xmodmap because I don't need it. Make a copy before you remove it.

Revision history for this message
frank (tristram) wrote :

I can confirm this (1 minute high load) for manually creating and using a .Xmodmap file for my fedora 23 with Xfce 4.12.

simple commands

xmodmap -pke > .Xmodmap
xmodmap .Xmodmap

in home directory produce it

Revision history for this message
efa (efa) wrote :

confirmed on
Ubuntu 16.04.4
Kernel: 4.4.0-124-generic
xorg: X11R7.7+13ubuntu3 X.Org X Server 1.18.4

Revision history for this message
Marc Neiger (marc-i) wrote :

still here on
Mint 19.1 xfce
kernel 4.18.0-13-generic

Brad Figg (brad-figg)
tags: added: cscc
Revision history for this message
Marc Neiger (marc-i) wrote :

Still here on
Mint 19.2 xfce
Kernel Linux resh-lakish 5.0.0-25-generic

However the attached script seems to be a crude workaround/

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

I noticed this on Debian (buster). It appears to be caused by the keyboard being detected multiple times, resulting in xfsettingsd running xmodmap multiple times. To monitor, run:

  XFSETTINGSD_DEBUG=1 xfsettingsd --replace --no-daemon

After suspend/resume (or just unplug/plug the USB keyboard), xfsettingsd launches xmodmap multiple times:

xfce4-settings(keyboard-layout): spawning "xmodmap /home/user/.Xmodmap"
xfce4-settings(keyboard-layout): New keyboard detected; restoring XKB settings.
Warning: Only changing the first 3 of 10 buttons.
xfce4-settings(keyboard-layout): spawning "xmodmap /home/user/.Xmodmap"
xfce4-settings(keyboard-layout): New keyboard detected; restoring XKB settings.
Warning: Only changing the first 3 of 10 buttons.
xfce4-settings(keyboard-layout): spawning "xmodmap /home/user/.Xmodmap"
Warning: Only changing the first 3 of 10 buttons.
xfce4-settings(keyboard-layout): New keyboard detected; restoring XKB settings.
xfce4-settings(keyboard-layout): spawning "xmodmap /home/user/.Xmodmap"
xfce4-settings(keyboard-layout): New keyboard detected; restoring XKB settings.
xfce4-settings(keyboard-layout): spawning "xmodmap /home/user/.Xmodmap"
xfce4-settings(keyboard-layout): New keyboard detected; restoring XKB settings.

As a test, doing:

  for x in {1..10}; do bash -c 'xmodmap ~/.Xmodmap &'; done

Has similar results of high CPU in xorg and xmodmap.

affects: linux → xfce4-settings
affects: linux (Ubuntu) → xfce4-settings (Ubuntu)
Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

See https://forum.xfce.org/viewtopic.php?id=13926
and upstream issue https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/168

There is a partial fix which apparently fixes the desktop shortcuts being locked, but not the multiple calls to xmodmap: https://gitlab.xfce.org/atomsymbol/libxfce4ui/-/commit/85d8d390f9f2265613da4291992523937a7a2519

  XFCE desktop shortcuts are unusable for about 30-40 seconds
  after switching from tty to Xorg if there exists a .Xmodmap
  file in $HOME. Without a .Xmodmap file, the delay is about 10
  seconds. Similar behavior gets triggered when a keyboard is
  reconnected to an USB port. With this patch, desktop shortcuts
  are usable immediately (likely in less than 0.25 seconds after
  switching from tty to Xorg).

  An issue not fixed by this patch is that /usr/bin/xmodmap
  can be executed about 30 times after switching to Xorg.
  However, on the tested machine with a relatively small .Xmodmap
  this does not pose a performance issue which would be noticeable
  by the user.

Changed in xfce4-settings:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.