compiz occasionally hangs with 100% cpu usage (inotify plugin infinite loop)

Bug #773564 reported by ServerAlex
176
This bug affects 35 people
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Medium
MC Return
compiz (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: compiz

Occasionally my whole desktop hangs, only the mouse cursor moves. Compiz is running at 100% cpu usage in this loop (forever!):
   0x00007f3a515866d0 <+224>: mov (%rax),%rax
=> 0x00007f3a515866d3 <+227>: cmp %edx,0x10(%rax)
   0x00007f3a515866d6 <+230>: jne 0x7f3a515866d0 <_ZN13InotifyScreen13processEventsEv+224>

0x00007f3a515866d3 in InotifyScreen::processEvents() () from /usr/lib/compiz/libinotify.so

I'm running natty amd64 with gnome2 (ubuntu classic) shell.

After having a look at the source code of this specific plugin I suspect that there is a bug in an iterator loop. I created a patch, but haven't had time to test it so far. Maybe this helps.

Workaround: start ccsm, find "File Watcher" plugin and disable it.

Tags: patch precise

Related branches

Revision history for this message
ServerAlex (serveralex) wrote :
Revision history for this message
ServerAlex (serveralex) wrote :

i can confirm that the hang issue completly disappeared after i created and installed the patched compiz-plugins package! so it's finally working now.

btw the bug exists in the recent git repos on freedesktop.org, too.

tags: added: patch
Revision history for this message
thoughton (thoughton) wrote :

I believe I have encountered this bug too - my system seemingly hung, but the mouse still responded.

I logged into a new shell using Alt-F2 and saw that the "compiz" process was running at around 100% CPU usage.

I didn't really know what to do next, so I took a chance and tried sending a "kill -9" message to the compiz process, and to my joy when I tabbed back to my desktop using Alt-F7 it had all come back to life again (and compiz seemed to have restarted too).

Incidentally, this is the first time the hang's happened to me, and it happened whilst I was using Shotwell and dragging a photo into a new event.

System info:
11.04 (natty)
Linux 2.6.38-8-generic
GNOME 2.32.1

Will the above patch be making it into an official package at any point?

Revision history for this message
Anders Synstad (anders-synstad) wrote :

I haven't been able to debug the problem yet, but I also have the quite annoying problem with "compiz" randomly locking on 100% usage. Same as thoughton.

Ubuntu 11.04 - Natty:
Linux springfield 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
All packages are latest and greatest from the official repo.

Revision history for this message
tom phillips (bumpstart21) wrote :

I had this issue when I went to a 1440x900 monitor at 9.10. upgraded to 10.10 and it persisted. I noted compiz hogs cpu when either Normal or Extra Visual Effects are selected. Can someone post where compiz-decorator logs messages to?

Revision history for this message
tom phillips (bumpstart21) wrote :

Ooops. Visual Effects = NONE does not start compiz.

Revision history for this message
ServerAlex (serveralex) wrote : Re: [Bug 773564] Re: compiz occasionally hangs with 100% cpu usage (inotify plugin infinite loop)

Sure? Check your task list if compiz is running

Am 25.05.2011 um 02:35 schrieb tom phillips <email address hidden>:

> Ooops. Visual Effects = NONE does not start compiz.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/773564
>
> Title:
> compiz occasionally hangs with 100% cpu usage (inotify plugin infinite
> loop)
>
> Status in “compiz” package in Ubuntu:
> New
>
> Bug description:
> Binary package hint: compiz
>
> Occasionally my whole desktop hangs, only the mouse cursor moves. Compiz is running at 100% cpu usage in this loop (forever!):
> 0x00007f3a515866d0 <+224>: mov (%rax),%rax
> => 0x00007f3a515866d3 <+227>: cmp %edx,0x10(%rax)
> 0x00007f3a515866d6 <+230>: jne 0x7f3a515866d0 <_ZN13InotifyScreen13processEventsEv+224>
>
> 0x00007f3a515866d3 in InotifyScreen::processEvents() () from
> /usr/lib/compiz/libinotify.so
>
> I'm running natty amd64 with gnome2 (ubuntu classic) shell.
>
> After having a look at the source code of this specific plugin I
> suspect that there is a bug in an iterator loop. I created a patch,
> but haven't had time to test it so far. Maybe this helps.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/773564/+subscribe

Revision history for this message
DemocritusJr (disponibel) wrote :

Using 32 bit Natty, compiz running at 100% or more. Had left computer on with two folders open. Electricsheep screensaver was frozen when I returned to screen. Could move mouse and screensaver went away. Waited fifteen minutes checking with top every few minutes. Compiz maintained cpu usage at 100. Killed compiz, which restarted automatically, and cpu dropped back down to single digits.

Revision history for this message
ServerAlex (serveralex) wrote :

As obviously nothing is happening here I submitted that bug to compiz crew directly.

http://bugs.opencompositing.org/show_bug.cgi?id=1344

Revision history for this message
Davor Poznič (poznic-davor) wrote :

ServerAlex "release" the patch 29th of April. Today it's 3rd of June and bug is still not fixed in git. Why not? It's really so hard to fix this bug, when the patch is out for about a mounth? :)

Revision history for this message
Davor Poznič (poznic-davor) wrote :

Hi folks! There is workaround this bug. You can start ccsm(install it, if you don't have it). Type "inotify" in filter field. Choose "File Watcher" disable this plugin(uncheck Enable File Watcher). This disable the inotify plugin, which causes 100% cpu usage.

description: updated
Revision history for this message
DemocritusJr (disponibel) wrote :

RE: Comment #11

Mine was already disabled, so this isn't a work-around for me.

Revision history for this message
DemocritusJr (disponibel) wrote :

For me this problem seems to be more related to the high cpu use after suspend bugs : 771238 and 776314.

Revision history for this message
Woonjas (woonjas) wrote :

Back on Maverick I experienced similar hangs related to vmware player, but back then I could ssh in and just kill the player to fix the problem.

I since switched to virtualbox and the hangs no longer occurred until I upgrated to Natty, and it does not appear to be linked to any particular program.
I've seen it happen with just a VirtualBox vm running, a Windows app in Wine, Pidgin, Lotus Notes etc.

Next time it happens I'll check for cpu usage instead of just restarting gdm

Revision history for this message
Woonjas (woonjas) wrote :

It also does not appear to be linked to inotify (was already disabled) or screensaver/suspend.

Revision history for this message
fejes (anthony-fejes) wrote :

I notice this problem on my AMD64/Ubuntu11.11 computer, and it's invariably connected to closing a window. Not sure if that helps, but I'm happy to help debug this as I can.. I've had the issue for months, now, and none of the changes have altered this behaviour. (I can recreate this bug reasonably reliably, and so I've simply had to turn off compiz.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in compiz (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Teague (bteague) wrote :

On the Oneiric release candidate, I can reproduce this consistently with vim and gvim - just start vim from the terminal, then close it and compiz hangs. (The fact that vim, a terminal program, was affecting my window/compositing manager was particularly confusing.) Disabling File Watcher solves it.

Revision history for this message
Pesmontis (pesmontis) wrote :

After upgrading to Ubuntu 11:10 Oneiric Ocelot, I'm seeing compiz @ 100% CPU load after login.
I'm using Unity 2D. 'File Watcher' is disabled.

Sending 'kill -9' to the compiz PiD drops the CPU load, but compiz doesn't seem to restart (I have no more window decorations and the Unity bar is gone). I can't set the focus to the terminal used to kill compiz, I have no responding cursor in this window.

Revision history for this message
bolucpap (boluc) wrote :

I have the same issue as pesmontis although it does not always happen after login. Amarok seems to trigger it but, after a certain time. But the symptoms are the same, compiz process at high CPU%, killing it (-9 works, -15 doesn't) releases cpu but unity panel is gone. Terminal window does not receive focus. Sometimes the CPU load of Amarok and Compiz will be 50-50%, and once killing the Amarok process resulted in compiz dying as well.

Revision history for this message
Davor Poznič (poznic-davor) wrote :

@Pesmontis: you can restart unity from tty1. Press Ctrl+Alt+F1 and login with your username and password. Then type commmand "SCREEN=:0 unity --replace". Now Press Ctrl+Alt+F7 or Ctrl+Alt+F8(I don't know which one is for graphic mode) and unity will be restarted and ready to use.

Revision history for this message
Pesmontis (pesmontis) wrote :

Running compiz --reset makes the CPU load drop back to normal on my PC.
Resetting shows a lot of warnings about missing lenses / directories, and I have to <CNTRL><C> to get my terminal cursor back. Window decorations are gone.

Revision history for this message
neil king (neil-neilking) wrote :

If you are using the trailfocus saturation option, keep both saturation values at 100. Anything other that that keeps one of my cpu cores at 100% on Ubuntu 11.10 (Oneiric)

Revision history for this message
Pesmontis (pesmontis) wrote :
Download full text (5.5 KiB)

Davor, Neil, thanks for your responses, I'm still looking for the best way to deal with this inconveneance.

Atm. I'm starting a terminal and I run the command "unity --reset".
This command does not finish normally, I have to press <CTRL><C> to get a command prompt.
Now, the CPU load drops to normal values, but at this point I have no more window decorations, and
the terminal window is no longer responding to keyboard input.

Now in order to get correct window display I'm proceeding as follows:
In the terminal window, I select some output text with the mouse, right-click and select the menu option <Close Window>.
Then I click <Dash - Home>, I press <Alt><F2>, and I run the command "metacity --replace".
After that everything is fine.

I also tried running "unity --reset" in a bash script, but that did not work (!).
The essential step seems to be sending <CTRL><C> to the proper process (which obviously is not bash).
I tee'd the output from "unity --reset":

Checking if settings need to be migrated ...no
Checking if internal files need to be migrated ...no

Screen geometry changed:
   0x0x1600x1200

Starting unity-window-decorator
DEBUG 2011-10-19 09:16:02 glib <unknown>:0 Setting to primary screen rect: x=0 y=0 w=1600 h=1200
WARN 2011-10-19 09:16:10 glib <unknown>:0 Unable to fetch children: Method "Children" with signature "" on interface "org.ayatana.bamf.view" doesn't exist

WARN 2011-10-19 09:17:06 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method InfoRequest proxy /com/canonical/unity/lens/music does not exist
WARN 2011-10-19 09:17:06 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method SetActive proxy /com/canonical/unity/lens/music does not exist
WARN 2011-10-19 09:17:06 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method InfoRequest proxy /com/canonical/unity/lens/files does not exist
WARN 2011-10-19 09:17:06 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method SetActive proxy /com/canonical/unity/lens/files does not exist
WARN 2011-10-19 09:17:12 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method InfoRequest proxy /com/canonical/unity/lens/commands does not exist
WARN 2011-10-19 09:17:12 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method SetActive proxy /com/canonical/unity/lens/commands does not exist
WARN 2011-10-19 09:17:12 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method InfoRequest proxy /com/canonical/unity/lens/applications does not exist
WARN 2011-10-19 09:17:12 unity.glib.dbusproxy GLibDBusProxy.cpp:255 Cannot call method SetActive proxy /com/canonical/unity/lens/applications does not exist
WARN 2011-10-19 09:17:27 unity.iconloader IconLoader.cpp:509 Unable to load contents of file:///usr/share/icons/unity-icon-theme/places/svg/category-installed.svg: Error opening file: No such file or directory
WARN 2011-10-19 09:17:27 unity.iconloader IconLoader.cpp:509 Unable to load contents of file:///usr/share/icons/unity-icon-theme/places/svg/category-available.svg: Error opening file: No such file or directory
WARNING: Unity currently default profile, so switching to metacity while resetting the values
Checking if settings need to be migrated ...no
...

Read more...

Revision history for this message
Pesmontis (pesmontis) wrote :

The trouble described above is specific for an Ubuntu upgrade from 11.04 to 11.10.
My Ubuntu base version was 10.04 LTS.

After a complete reinstall of 11.10 everything is OK.

Revision history for this message
Håvard (havard-n-jakobsen) wrote :

I've done an install of oneric from scratch and have the same problems, so it's not specific to upgrade.

Revision history for this message
cannibaltinea (cannibaltinea) wrote :

Bump...problem persists in fresh install of Oneric 64Bit.

Revision history for this message
Col Hathi (colhathi) wrote :

I'm no expert but i had some of the same .xsession-errors entries as in post #24 including:

WARN 2011-10-19 09:17:27 unity.iconloader IconLoader.cpp:509 Unable to load contents of file:///usr/share/icons/unity-icon-theme/places/svg/category-installed.svg: Error opening file: No such file or directory
WARN 2011-10-19 09:17:27 unity.iconloader IconLoader.cpp:509 Unable to load contents of file:///usr/share/icons/unity-icon-theme/places/svg/category-available.svg: Error opening file: No such file or directory

When i did in a terminal:

ls /usr/share/icons/unity-icon-theme/places/svg/

it showed that there where "group-installed" and "group-available" instead of "category-installed" and "category-available". So i made an assumption that there had been a change in the code between 11.04 and 11,10 in the naming these and simply created simlinks ie:

sudo ln -s /usr/share/icons/unity-icon-theme/places/svg/group-installed.svg /usr/share/icons/unity-icon-theme/places/svg/category-installed.svg
sudo ln -s /usr/share/icons/unity-icon-theme/places/svg/group-available.svg /usr/share/icons/unity-icon-theme/places/svg/category-available.svg

When i did that many more .desktop items appeared in my /usr/share/applications file that need to be in place before that application icon will appear in the unity launch bar.

PLEASE NOTE: I DO NOT KNOW IF I HAVE CREATED ANY OTHER PROBLEMS DOING THIS but my upgrade of unity seemed to work better after this.

I also have the dbus errors in .xsession-errors log in post #24 but i think that may be related to ubuntu one polkits or something like that - haven't figured that out yet.

As far as the high cpu load - i couldn't stop my upgrade from freezing until i stopped the nautilus file manager from controlling the desktop. That means you can't use nautilus to place icons on the desktop but unity has its own method of doing that.

Its difficult to speculate what the specific problems are without looking at the .xsession-error log entries which is very handy for graphical issues.

Revision history for this message
Jan (jankanis) wrote :

I had the same problem, Amd64 ubuntu 11.10 installed from scratch.

compiz --replace fixes it, but compiz still takes some 25% of cpu.

Revision history for this message
Jurjen de Vries (ubuntu-raceman) wrote :

I have this problem since last week, 64Bit Ubuntu 11.10. I don't know where it came from, but Ubuntu worked without this problem for more then one year.
compiz --replace etc is not working for me. Everytime I used my mouse or keyboard within compiz , the load of the compiz process is 100%
After the bug happened and nothing of the suggestions helped I updated Ubuntu to 12.04 LTS by command line, but after that the problem still exists.

Later this week I expect to receive a SSD drive, after that I am going to install 12.04 from scratch on that new drive, and made a copy of my files on the current HDD. If I can help with further investigation of the problem before I receive my SSD, please let me know.

Revision history for this message
Jurjen de Vries (ubuntu-raceman) wrote :

Update: I tryed gnome3 and had the same 100% CPU problem, my conclusion was that it was not a compiz problem for me.
After searching I found a topic about NVIDIA 295.40 driver that was released 11 april 2012 was the problem.

tags: added: precise
Revision history for this message
Kieran Grant (kieran-grant) wrote :

I have detected this problem too on Ubuntu 12.04 AMD64.

Here is some information that hopefully someone will find useful.
dpkg-query -S /usr/bin/compiz: compiz-core
dpkg-query -s compiz-core:

Package: compiz-core
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 1196
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Source: compiz
Version: 1:0.9.7.8-0ubuntu1.4

...etc...

Using "perf top -azG" I see that compiz is stuck at the following loop:
libinotify.so: InotifyScreen::processEvents()
with annoate at:
(%usage/thread) (offset from image base address??) (actual disassembly)
25.00: 54A0: mov (%rax), rax
00.00: 54A3: cmp %edx, 0x10(%rax)
75.00: 54A6: jne 54A0 <InotifyScreen::processEvents()+0xf0>

I caused compiz to core with kill -SIGABRT ..., and incidentaly, the same bug was triggered when I tried to respond to apport, which then crashed because of me killing compiz (again) and starting metacity up, after coping the original compiz crash file for later anaylsis.

Incase you can't get the info from my coredump from different versions of compiz, here is some info:

gdb /usr/bin/compiz compiz_core (which I had to extract from the 'apport' freindly crash file)

A dissassembly around the looping code:

   0x00007f379d78949c <+236>: nopl 0x0(%rax)
   0x00007f379d7894a0 <+240>: mov (%rax),%rax
   0x00007f379d7894a3 <+243>: cmp %edx,0x10(%rax)
=> 0x00007f379d7894a6 <+246>: jne 0x7f379d7894a0 <_ZN13InotifyScreen13processEventsEv+240>
   0x00007f379d7894a8 <+248>: mov 0xc(%r14),%eax
   0x00007f379d7894ac <+252>: mov 0x10(%rdi),%rdx
   0x00007f379d7894b0 <+256>: lea 0x10(%r14),%rsi

Registers:
rax 0x1ee1180 32379264
rbx 0x1eec510 32425232
rcx 0x7f37b0e6e9bd 139877167851965
rdx 0x3 3
rsi 0x7fff535766e0 140734591624928
rdi 0x1ec09f0 32246256
rbp 0x80 0x80
rsp 0x7fff535766c0 0x7fff535766c0
r8 0x20 32
r9 0x2920 10528
r10 0x0 0
r11 0x0 0
r12 0x1eec530 32425264
r13 0x0 0
r14 0x7fff535766e0 140734591624928
r15 0x1bdbaa8 29211304
rip 0x7f379d7894a6 0x7f379d7894a6 <InotifyScreen::processEvents()+246>
eflags 0x293 [ CF AF SF IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0

Hopefuly someone can find this useful.

Revision history for this message
Kieran Grant (kieran-grant) wrote :

Woops, will include the full 'apport' crash file too.

no longer affects: compiz
Changed in compiz:
status: New → Confirmed
Changed in compiz (Ubuntu):
importance: Undecided → Low
Changed in compiz:
importance: Undecided → Medium
Revision history for this message
iMac (imac-netstatz) wrote :

12.10, compiz hits 100%, log in from another desktop and execute a SIGABRT and compiz crashes hard, attached dump

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The dump in comment #34 appears to be unrelated to this bug. Please log it elsewhere.

MC Return (mc-return)
Changed in compiz:
assignee: nobody → MC Return (mc-return)
status: Confirmed → In Progress
Revision history for this message
MC Return (mc-return) wrote :

@ServerAlex: Thanks a lot for your patch ! :) I made a MP and hope it will land soonish.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:compiz at revision None, scheduled for release in compiz, milestone 0.9.9.2

Changed in compiz:
status: In Progress → Fix Committed
Revision history for this message
MC Return (mc-return) wrote :
Revision history for this message
Beem Boy (beemb0y) wrote :

Hello

I think I'm hitting this bug on Ubuntu 12.04 LTS. How can I apply the patch to compiz to ensure I don't hit this condition?

Thanks!

Stephen M. Webb (bregma)
Changed in compiz:
status: Fix Committed → Fix Released
Changed in compiz (Ubuntu):
status: Confirmed → 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.