After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679151 - Consumes 100% CPU (NumLock)
Consumes 100% CPU (NumLock)
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: keyboard
3.4.x
Other Linux
: Normal major
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
: 682664 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-29 16:42 UTC by أحمد المحمودي (Ahmed El-Mahmoudy)
Modified: 2012-11-07 08:57 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
backtrace for gnome-settings-daemon when it happends (12.13 KB, text/plain)
2012-07-22 18:42 UTC, Mikhail
  Details
backtrace for gnome-settings-daemon when it happends (7.82 KB, text/plain)
2012-08-09 14:45 UTC, Mikhail
  Details
/usr/libexec/gsd-test-keyboard >& /tmp/gsd-test-keyboard.log (258.55 KB, application/zip)
2012-10-16 15:19 UTC, Maxim Britov
  Details
keyboard: Prevent potential infinite loop (4.07 KB, patch)
2012-10-24 08:48 UTC, Andrew Potter
none Details | Review
keyboard: Prevent potential infinite loop (3.23 KB, patch)
2012-10-24 20:59 UTC, Andrew Potter
none Details | Review
keyboard: Prevent potential infinite loop (1.78 KB, patch)
2012-11-06 18:15 UTC, Bastien Nocera
committed Details | Review

Description أحمد المحمودي (Ahmed El-Mahmoudy) 2012-06-29 16:42:05 UTC
This bug has been in Ubuntu since 11.10 release.

Here is a link to the report on Launchpad: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/969359

I don't know how to reproduce this bug, but after varying amounts of normal usage of my laptop, I notice gnome-settings-daemon is consuming 100% CPU.

When this happens, I also notice that response to some keys (such as volume up/down/mute keys, or the power switch) is sluggish, for example, if I press the volume up key, the volume would increase after a minute or so.

Some found a workaround by removing the /usr/lib/gnome-settings-daemon-3.0/keyboard.gnome-settings-plugin to some other filename, but that would result in keyboard layout couldn't be changed/switched
Comment 1 Sebastien Bacher 2012-06-29 19:06:26 UTC
Thanks Ahmed for report that issue upstream

Some precisions:

- The reports about that issue started with GNOME 3.4 (i.e Ubuntu 12.04), not sure the "since 11.10" statement is true

- the issue seems quite common and affecting all distros (bkor asked about it on IRC and he's using mageia, it has been reported on fedora 17: https://bugzilla.redhat.com/show_bug.cgi?id=811902, the ubuntu bug counts 88 affected users)

- the issue is still there in GNOME 3.4.2

- the issue seems to happen often after vnc or vm use, some people saw it after docking a laptop as well, there is not only one pattern to the bug though
Comment 2 Sebastien Bacher 2012-06-29 19:09:52 UTC
detail which is mising from the description, when that happens the num lock key keeps changing state and dconf uses lot of CPU, it seems like there is a fight over the key status and g-s-d keys writing the gsettings the new status
Comment 3 Sebastien Bacher 2012-06-29 19:11:15 UTC
backtrace from bkor on mageia:
https://launchpadlibrarian.net/107610762/a

"Breakpoint 1, g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_WARNING, format=0x7fe25c9d29ad "%s", args1=0x7fe24fffeac8) at gmessages.c:661
661	{
(gdb) thread apply all bt

Thread 4 (Thread 0x7fe25d5e6700 (LWP 7386))

  • #0 g_source_list_add
    at gmain.c line 825
  • #1 g_source_attach_unlocked
    at gmain.c line 872
  • #2 g_source_attach
    at gmain.c line 919
  • #3 schedule_callbacks
    at gdbusconnection.c line 3767
  • #4 distribute_signals
    at gdbusconnection.c line 3809
  • #5 on_worker_message_received
    at gdbusconnection.c line 2307
  • #6 _g_dbus_worker_emit_message_received
    at gdbusprivate.c line 492
  • #7 _g_dbus_worker_emit_message_received
    at gdbusprivate.c line 2230
  • #8 _g_dbus_worker_queue_or_deliver_received_message
    at gdbusprivate.c line 520
  • #9 _g_dbus_worker_do_read_cb
    at gdbusprivate.c line 804
  • #10 g_simple_async_result_complete
    at gsimpleasyncresult.c line 767
  • #11 complete_in_idle_cb
    at gsimpleasyncresult.c line 779
  • #12 g_main_dispatch
    at gmain.c line 2539
  • #13 g_main_context_dispatch
    at gmain.c line 3075
  • #14 g_main_context_iterate
    at gmain.c line 3146
  • #15 g_main_context_iterate
    at gmain.c line 3083
  • #16 g_main_loop_run
    at gmain.c line 3340
  • #17 gdbus_shared_thread_func
    at gdbusprivate.c line 277
  • #18 g_thread_proxy
    at gthread.c line 801
  • #19 start_thread
    at pthread_create.c line 301
  • #20 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #21 ??

Thread 1 (Thread 0x7fe25f955880 (LWP 7382))

  • #0 __lll_unlock_wake
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 373
  • #1 _L_unlock_554
    from /lib64/libpthread.so.0
  • #2 __pthread_mutex_unlock_usercnt
    at pthread_mutex_unlock.c line 52
  • #3 g_mutex_unlock
    at gthread-posix.c line 227
  • #4 dconf_settings_backend_scan_outstanding
    at dconfsettingsbackend.c line 433
  • #5 dconf_settings_backend_read
    at dconfsettingsbackend.c line 450
  • #6 g_settings_backend_read
    at gsettingsbackend.c line 733
  • #7 g_settings_read_from_backend
    at gsettings.c line 1028
  • #8 g_settings_get_value
    at gsettings.c line 1068
  • #9 g_settings_get_int
    at gsettings.c line 1603
  • #10 apply_settings
    at gsd-keyboard-manager.c line 217
  • #11 g_cclosure_marshal_VOID__STRINGv
  • #12 _g_closure_invoke_va
    at gclosure.c line 840
  • #13 g_signal_emit_valist
    at gsignal.c line 3207
  • #14 g_signal_emit
    at gsignal.c line 3352
  • #15 g_settings_real_change_event
    at gsettings.c line 282
  • #16 ffi_call_unix64
    at ../src/x86/unix64.S line 75
  • #17 ffi_call
    at ../src/x86/ffi64.c line 486
  • #18 g_cclosure_marshal_generic_va
    at gclosure.c line 1550
  • #19 _g_closure_invoke_va
    at gclosure.c line 840
  • #20 g_signal_emit_valist
    at gsignal.c line 3207
  • #21 g_signal_emit
    at gsignal.c line 3352
  • #22 settings_backend_changed
    at gsettings.c line 336
  • #23 g_settings_backend_invoke_closure
    at gsettingsbackend.c line 271
  • #24 g_main_dispatch
    at gmain.c line 2539
  • #25 g_main_context_dispatch
    at gmain.c line 3075
  • #26 g_main_context_iterate
    at gmain.c line 3146
  • #27 g_main_context_iterate
    at gmain.c line 3083
  • #28 g_main_loop_run
    at gmain.c line 3340
  • #29 gtk_main
    at gtkmain.c line 1161
  • #30 main

Comment 4 Jens Georg 2012-07-02 08:19:56 UTC
FWIW, The one time it happened for me, I toggled (on-off-on) "save numlock status" and it has never happened since.
Comment 5 ben 2012-07-11 07:17:18 UTC
Jens Georg; please can you explain this process a bit more for ignorant users like myself? Where is this value? How do you 'toggle' it? Host or guest?
Comment 6 Jens Georg 2012-07-11 08:04:57 UTC
Host, using dconf-editor.
Comment 7 Tobias Mueller 2012-07-15 18:36:15 UTC
the value from org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state is probably what Jens refers to.

Didn't help me though.
Comment 8 Mikhail 2012-07-22 18:42:03 UTC
Created attachment 219442 [details]
backtrace for gnome-settings-daemon when it happends
Comment 9 Paolo M 2012-07-31 07:02:49 UTC
To answer to comment 1, I'm having this same problem on Ubuntu 11.04 right now, had it for a long time and finally decided to investigate. It always happens after resuming from suspend but not every time I do it. CPU usage usually goes back to 0 after a few minutes. I never use number lock (I'm on a laptop), I do use two keyboard layouts (US and IT).

$ dpkg-query -s gnome-settings-daemon

Package: gnome-settings-daemon
Status: install ok installed
Priority: optional
Section: gnome
Installed-Size: 1352
Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
Architecture: amd64
Version: 2.32.1-0ubuntu13.1
Replaces: capplets-data (<< 1:2.21.5), gnome-control-center (<< 1:2.21.5)
Depends: libappindicator1 (>= 0.2.91), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.4), libcairo2 (>= 1.2.4), libcanberra-gtk0 (>= 0.2), libcanberra0 (>= 0.2), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.88), libdbusmenu-glib3 (>= 0.4.2), libfontconfig1 (>= 2.8.0), libfreetype6 (>= 2.2.1), libgconf2-4 (>= 2.31.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.24.0), libgnome-desktop-2-17 (>= 1:2.29.92), libgnomekbd4 (>= 2.31.5), libgtk2.0-0 (>= 2.18.0), libice6 (>= 1:1.0.0), libnotify1 (>= 0.5.0), libnotify1-gtk2.10, libpango1.0-0 (>= 1.14.0), libpolkit-gobject-1-0 (>= 0.94), libpulse-mainloop-glib0, libpulse0 (>= 0.9.16), libsm6, libstartup-notification0 (>= 0.10), libx11-6, libxext6, libxi6 (>= 2:1.2.0), libxklavier16 (>= 5.0), gconf2 (>= 2.28.1-2), libgnome2-common
Recommends: pulseaudio
Suggests: x11-xserver-utils, gnome-screensaver, metacity | x-window-manager
Breaks: gnome-screensaver (<< 2.28.0), gnome-session (<< 2.24)
Conflicts: banshee (<< 0.13.2+dfsg-7), gnome-control-center (<< 1:2.21.5), rhythmbox (<< 0.11.5), totem (<< 2.22.0)
Comment 10 Micah Carrick 2012-08-07 18:34:13 UTC
I can confirm it's happening to me in Fedora 17 x86_64 after starting a virtual machine in VirtualBox. High CPU usage from gnome-settings-daemon and num lock is toggling on and off rapidly.
Comment 11 Mikhail 2012-08-09 14:45:25 UTC
Created attachment 220793 [details]
backtrace for gnome-settings-daemon when it happends
Comment 12 Josselin Mouette 2012-08-09 15:53:09 UTC
I think this happened to me. This is completely weird when your numlock LED blinks in sync with the HDD LED.
Comment 13 F Wolff 2012-08-11 08:19:08 UTC
I just ran into this on Mageia 2 (gnome settings daemon 3.4.1). I'm connecting to the affected machine with synergy. Just in case this is useful, here is another report which looks similar, and contains strace output:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676521

I definitely also experienced this continuous IO around the file ~/.config/dconf/user
Comment 14 Sam Morris 2012-08-24 10:38:26 UTC
For anyone who thinks they are seeing this bug: you can confirm by running 'dconf watch /'; it should reveal that /org/gnome/settings-daemon/peripherals/keyboard/numlock-state is being toggled on and off repeatedly.

I have seen this occur many times over the years, even back in the GNOME 2 days. I have never managed to reproduce it on demand, however. It just happened to me again, after gnome-settings-daemon previously died, printing the following message as it did so:

(gnome-settings-daemon:21785): Gdk-WARNING **: The program 'gnome-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 228779 error_code 3 request_code 18 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

g-s-d was restarted, and some time later I noticed that it was consuming 100% of the CPU. Sadly when I attached to it with gdb and continued the process, it was no longer spinning... perhaps some of the fiddling around I did with gsettings caused it to break out of the loop. Hence no useful backtrace, sorry!
Comment 15 Bastien Nocera 2012-08-25 14:23:16 UTC
*** Bug 682664 has been marked as a duplicate of this bug. ***
Comment 16 Leonid Movshovich 2012-08-30 09:31:06 UTC
Just appeared for me after 2 weeks uptime. I've had such uptimes before but issue never happened. g-s-d version is 3.4.2-0ubuntu0.4
I've killed g-s-d. Then I had almost CPU 100%wa. So I've killed dconf-service and everything came back to normal. 
I've noticed something interesting in dmesg:
[1423779.039775] INFO: task dconf-service:4218 blocked for more than 120 seconds.
[1423779.039779] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[1423779.039783] dconf-service   D ffffffff81806200     0  4218      1 0x00000000
[1423779.039789]  ffff88009db07e48 0000000000000086 ffff88009db07de8 0000000300000001
[1423779.039794]  ffff88009db07fd8 ffff88009db07fd8 ffff88009db07fd8 0000000000013780
[1423779.039798]  ffff880118241700 ffff8800a066dc00 ffff88009db07e58 ffff88011473b000
[1423779.039803] Call Trace:
[1423779.039813]  [<ffffffff816579cf>] schedule+0x3f/0x60
[1423779.039819]  [<ffffffff812650d5>] jbd2_log_wait_commit+0xb5/0x130
[1423779.039824]  [<ffffffff8108aa50>] ? add_wait_queue+0x60/0x60
[1423779.039829]  [<ffffffff81211248>] ext4_sync_file+0x208/0x2d0
[1423779.039835]  [<ffffffff811a63a6>] do_fsync+0x56/0x80
[1423779.039839]  [<ffffffff811a66d0>] sys_fsync+0x10/0x20
[1423779.039843]  [<ffffffff81661ec2>] system_call_fastpath+0x16/0x1b
[1430870.310571] zeitgeist-datah invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[1430870.310576] zeitgeist-datah cpuset=/ mems_allowed=0
[1430870.310579] Pid: 2081, comm: zeitgeist-datah Not tainted 3.2.0-29-generic #46-Ubuntu
[1430870.310581] Call Trace:
[1430870.310589]  [<ffffffff810bf9ad>] ? cpuset_print_task_mems_allowed+0x9d/0xb0
[1430870.310592]  [<ffffffff8111a7e1>] dump_header+0x91/0xe0
[1430870.310595]  [<ffffffff8111ab65>] oom_kill_process+0x85/0xb0
[1430870.310597]  [<ffffffff8111af0a>] out_of_memory+0xfa/0x220
[1430870.310601]  [<ffffffff8112098f>] __alloc_pages_nodemask+0x80f/0x820
[1430870.310606]  [<ffffffff81157863>] alloc_pages_current+0xa3/0x110
[1430870.310610]  [<ffffffff811173af>] __page_cache_alloc+0x8f/0xa0
[1430870.310612]  [<ffffffff8111781e>] ? find_get_page+0x1e/0x90
[1430870.310615]  [<ffffffff811196c4>] filemap_fault+0x234/0x3e0
[1430870.310618]  [<ffffffff81139cb2>] __do_fault+0x72/0x550
[1430870.310621]  [<ffffffff8113d30a>] handle_pte_fault+0xfa/0x200
[1430870.310625]  [<ffffffff81318db7>] ? __strncpy_from_user+0x27/0x60
[1430870.310628]  [<ffffffff8113d7c8>] handle_mm_fault+0x1f8/0x350
[1430870.310632]  [<ffffffff8165d3e0>] do_page_fault+0x150/0x520
[1430870.310636]  [<ffffffff811be55c>] ? eventfd_read+0x3c/0x70
[1430870.310640]  [<ffffffff811877d1>] ? user_path_at+0x11/0x20
[1430870.310642]  [<ffffffff8165a035>] page_fault+0x25/0x30
[1430870.310644] Mem-Info:
[1430870.310645] Node 0 DMA per-cpu:
[1430870.310648] CPU    0: hi:    0, btch:   1 usd:   0
[1430870.310649] CPU    1: hi:    0, btch:   1 usd:   0
[1430870.310651] Node 0 DMA32 per-cpu:
[1430870.310653] CPU    0: hi:  186, btch:  31 usd:   4
[1430870.310654] CPU    1: hi:  186, btch:  31 usd:  30
[1430870.310655] Node 0 Normal per-cpu:
[1430870.310657] CPU    0: hi:  186, btch:  31 usd:   0
[1430870.310659] CPU    1: hi:  186, btch:  31 usd:  98
[1430870.310679] active_anon:678172 inactive_anon:168242 isolated_anon:85
[1430870.310680]  active_file:15 inactive_file:795 isolated_file:0
[1430870.310681]  unevictable:24 dirty:1 writeback:136 unstable:0
[1430870.310682]  free:21292 slab_reclaimable:7515 slab_unreclaimable:9343
[1430870.310682]  mapped:175 shmem:77 pagetables:10768 bounce:0
[1430870.310684] Node 0 DMA free:15860kB min:256kB low:320kB high:384kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15620kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:16kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[1430870.310692] lowmem_reserve[]: 0 3502 4006 4006
[1430870.310695] Node 0 DMA32 free:60860kB min:58856kB low:73568kB high:88284kB active_anon:2550032kB inactive_anon:510232kB active_file:0kB inactive_file:2920kB unevictable:80kB isolated(anon):124kB isolated(file):0kB present:3586276kB mlocked:80kB dirty:4kB writeback:336kB mapped:656kB shmem:268kB slab_reclaimable:16304kB slab_unreclaimable:17724kB kernel_stack:1384kB pagetables:29756kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:63 all_unreclaimable? yes
[1430870.310704] lowmem_reserve[]: 0 0 504 504
[1430870.310706] Node 0 Normal free:8448kB min:8468kB low:10584kB high:12700kB active_anon:162656kB inactive_anon:162736kB active_file:100kB inactive_file:260kB unevictable:16kB isolated(anon):216kB isolated(file):0kB present:516096kB mlocked:16kB dirty:0kB writeback:208kB mapped:44kB shmem:40kB slab_reclaimable:13756kB slab_unreclaimable:19632kB kernel_stack:1752kB pagetables:13316kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:1241 all_unreclaimable? yes
[1430870.310715] lowmem_reserve[]: 0 0 0 0
[1430870.310717] Node 0 DMA: 1*4kB 0*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB 1*1024kB 1*2048kB 3*4096kB = 15860kB
[1430870.310724] Node 0 DMA32: 761*4kB 1335*8kB 684*16kB 563*32kB 176*64kB 22*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 1*4096kB = 60860kB
[1430870.310732] Node 0 Normal: 1135*4kB 3*8kB 0*16kB 4*32kB 5*64kB 3*128kB 2*256kB 3*512kB 1*1024kB 0*2048kB 0*4096kB = 8468kB
[1430870.310739] 6867 total pagecache pages
[1430870.310740] 5972 pages in swap cache
[1430870.310741] Swap cache stats: add 1164401, delete 1158429, find 43694/54559
[1430870.310743] Free swap  = 0kB
[1430870.310744] Total swap = 4191228kB
[1430870.318762] 1048560 pages RAM
[1430870.318765] 37443 pages reserved
[1430870.318767] 553 pages shared
[1430870.318769] 988445 pages non-shared
[1430870.318771] [ pid ]   uid  tgid total_vm      rss cpu oom_adj oom_score_adj name
[1430870.318780] [  343]     0   343     4306       14   1       0             0 upstart-udev-br
[1430870.318785] [  400]     0   400     5430        1   0     -17         -1000 udevd
[1430870.318789] [  740]     0   740     3795        9   1       0             0 upstart-socket-
[1430870.318794] [  863]     0   863    12487       29   1     -17         -1000 sshd
[1430870.318798] [  881]   102   881     6330      273   0       0             0 dbus-daemon
[1430870.318802] [  894]     0   894    19759        1   0       0             0 modem-manager
[1430870.318806] [  908]     0   908     5295        0   1       0             0 bluetoothd
[1430870.318811] [  914]     0   914    60306      680   1       0             0 NetworkManager
[1430870.318814] [  918]     0   918    51054       15   0       0             0 polkitd
[1430870.318819] [  921]   107   921     8219      179   1       0             0 avahi-daemon
[1430870.318823] [  923]   107   923     8043        4   0       0             0 avahi-daemon
[1430870.318827] [  931]   103   931   122938        0   0       0             0 colord
[1430870.318831] [ 1002]     0  1002     5304        1   1       0             0 getty
[1430870.318835] [ 1006]     0  1006     5304        1   1       0             0 getty
[1430870.318839] [ 1021]     0  1021     5304        1   1       0             0 getty
[1430870.318842] [ 1024]     0  1024     5304        1   1       0             0 getty
[1430870.318846] [ 1026]     0  1026     5304        1   1       0             0 getty
[1430870.318850] [ 1067]   105  1067    51095       74   1       0             0 whoopsie
[1430870.318854] [ 1077]     0  1077     1113        0   0       0             0 acpid
[1430870.318858] [ 1079]     0  1079    67664        0   0       0             0 lightdm
[1430870.318862] [ 1081]     0  1081     4225        3   1       0             0 atd
[1430870.318866] [ 1104]     0  1104     3993       23   1       0             0 irqbalance
[1430870.318870] [ 1111]     0  1111    73310     3104   1       0             0 Xorg
[1430870.318874] [ 1309]     0  1309    30381       35   1       0             0 accounts-daemon
[1430870.318878] [ 1327]     0  1327   261314        0   1       0             0 console-kit-dae
[1430870.318882] [ 1519]     0  1519    54972        0   1       0             0 upowerd
[1430870.318886] [ 1715]     0  1715    39191        0   1       0             0 lightdm
[1430870.318890] [ 1751]   111  1751    42216        8   0       0             0 rtkit-daemon
[1430870.318894] [ 1804]  1000  1804   131212        0   1       0             0 gnome-keyring-d
[1430870.318898] [ 1815]  1000  1815   102214       63   1       0             0 gnome-session
[1430870.318902] [ 1850]  1000  1850     3121        7   1       0             0 ssh-agent
[1430870.318906] [ 1853]  1000  1853     6637        0   0       0             0 dbus-launch
[1430870.318910] [ 1854]  1000  1854     7564      737   1       0             0 dbus-daemon
[1430870.318914] [ 1867]  1000  1867  1725653   773285   1       0             0 gnome-settings-
[1430870.318918] [ 1872]  1000  1872    13435        0   0       0             0 gvfsd
[1430870.318922] [ 1874]  1000  1874    86826        0   0       0             0 gvfs-fuse-daemo
[1430870.318926] [ 1884]  1000  1884   428390     3988   0       0             0 compiz
[1430870.318930] [ 1888]  1000  1888    14831       28   1       0             0 gconfd-2
[1430870.318934] [ 1897]  1000  1897    91020        0   0       0             0 pulseaudio
[1430870.318938] [ 1900]  1000  1900    23985        0   0       0             0 gconf-helper
[1430870.318942] [ 1902]  1000  1902    11878        0   0       0             0 gvfsd-metadata
[1430870.318946] [ 1903]  1000  1903   155040      459   1       0             0 nm-applet
[1430870.318950] [ 1905]  1000  1905   287001      380   1       0             0 nautilus
[1430870.318954] [ 1908]  1000  1908   123582       85   0       0             0 bluetooth-apple
[1430870.318959] [ 1909]  1000  1909   122313       90   1       0             0 polkit-gnome-au
[1430870.318963] [ 1913]  1000  1913   117286       58   1       0             0 gnome-fallback-
[1430870.318967] [ 1916]  1000  1916   148147      374   1       0             0 gnome-terminal
[1430870.318971] [ 1921]  1000  1921   100178     8502   1       0             0 skype
[1430870.318975] [ 1925]  1000  1925    17914      116   1       0             0 gvfs-gdu-volume
[1430870.318979] [ 1926]  1000  1926   470453    23040   1       0             0 opera
[1430870.318982] [ 1930]     0  1930    48342      145   1       0             0 udisks-daemon
[1430870.318986] [ 1931]     0  1931    11378        0   1       0             0 udisks-daemon
[1430870.318990] [ 1935]  1000  1935    15391        0   0       0             0 gvfs-gphoto2-vo
[1430870.318994] [ 1944]  1000  1944    35825        0   0       0             0 gvfs-afc-volume
[1430870.318998] [ 1947]  1000  1947     3695        0   0       0             0 gnome-pty-helpe
[1430870.319002] [ 1959]  1000  1959    53422        1   1       0             0 emacs
[1430870.319006] [ 1966]  1000  1966    14571        0   0       0             0 gvfsd-trash
[1430870.319010] [ 1967]  1000  1967    86438      214   0       0             0 gdu-notificatio
[1430870.319014] [ 1972]  1000  1972    13443        0   0       0             0 gvfsd-burn
[1430870.319018] [ 2011]  1000  2011   110874       47   1       0             0 telepathy-indic
[1430870.319022] [ 2021]  1000  2021    60918       17   1       0             0 mission-control
[1430870.319026] [ 2081]  1000  2081   104413       22   1       0             0 zeitgeist-datah
[1430870.319030] [ 2082]  1000  2082    82155      152   1       0             0 gnome-screensav
[1430870.319034] [ 2088]  1000  2088    87129       63   0       0             0 zeitgeist-daemo
[1430870.319039] [ 2090]  1000  2090   123456      342   1       0             0 bamfdaemon
[1430870.319043] [ 2117]  1000  2117    61824        0   1       0             0 zeitgeist-fts
[1430870.319047] [ 2125]  1000  2125     3153        0   1       0             0 cat
[1430870.319051] [ 2168]  1000  2168   106960      236   1       0             0 notify-osd
[1430870.319055] [ 2170]  1000  2170   171762     7983   1       0             0 unity-panel-ser
[1430870.319059] [ 2172]  1000  2172   110700     1077   1       0             0 hud-service
[1430870.319063] [ 2180]  1000  2180     1098        0   0       0             0 sh
[1430870.319067] [ 2181]  1000  2181   106600      180   1       0             0 gtk-window-deco
[1430870.319071] [ 2203]  1000  2203   134493        0   0       0             0 indicator-sessi
[1430870.319075] [ 2241]  1000  2241    11961        0   0       0             0 geoclue-master
[1430870.319079] [ 2243]  1000  2243    40668        1   1       0             0 ubuntu-geoip-pr
[1430870.319083] [ 2258]  1000  2258   132741        0   0       0             0 indicator-sound
[1430870.319087] [ 2263]  1000  2263   109428      103   0       0             0 indicator-print
[1430870.319091] [ 2264]  1000  2264   146350      240   1       0             0 indicator-messa
[1430870.319095] [ 2265]  1000  2265   158052        0   0       0             0 indicator-datet
[1430870.319099] [ 2268]  1000  2268   108605     1290   1       0             0 indicator-appli
[1430870.319103] [ 2312]  1000  2312   104949      437   1       0             0 update-notifier
[1430870.319107] [ 2345]  1000  2345   223623       44   1       0             0 unity-applicati
[1430870.319111] [ 2347]  1000  2347   235999      112   1       0             0 unity-files-dae
[1430870.319115] [ 2349]  1000  2349   119371       43   1       0             0 unity-music-dae
[1430870.319119] [ 2351]  1000  2351   129072        0   1       0             0 unity-lens-vide
[1430870.319123] [ 2395]  1000  2395   146910        0   1       0             0 unity-musicstor
[1430870.319127] [ 2406]  1000  2406   139521      554   1       0             0 unity-scope-vid
[1430870.319131] [ 2519]  1000  2519    72362      105   0       0             0 deja-dup-monito
[1430870.319136] [ 2645]  1000  2645     9071        0   0       0             0 bash
[1430870.319139] [ 2747]  1000  2747     8448        0   0       0             0 bash
[1430870.319144] [ 2847]  1000  2847     8448        1   0       0             0 bash
[1430870.319147] [ 3063]  1000  3063     9080        1   1       0             0 aspell
[1430870.319151] [ 3141]  1000  3141    15380        0   0       0             0 sudo
[1430870.319155] [ 3142]     0  3142     7320        8   0       0             0 minicom
[1430870.319159] [ 4218]  1000  4218    70028     6351   1       0             0 dconf-service
[1430870.319164] [23088]  1000 23088    91325       75   0       0             0 gvfsd-smb-brows
[1430870.319168] [23094]  1000 23094    91207        0   0       0             0 gvfsd-smb
[1430870.319172] [23100]  1000 23100    70446        7   0       0             0 gvfsd-network
[1430870.319176] [23105]  1000 23105    15534        9   0       0             0 gvfsd-dnssd
[1430870.319180] [23760]  1000 23760     8446        0   0       0             0 bash
[1430870.319184] [ 1615]  1000  1615    15380        0   0       0             0 sudo
[1430870.319188] [ 1700]     0  1700     7320        8   0       0             0 minicom
[1430870.319192] [28560]     0 28560     5304        1   1       0             0 getty
[1430870.319196] [28724]     0 28724     4776       22   1       0             0 cron
[1430870.319200] [31096]     0 31096     6637        0   0       0             0 dbus-launch
[1430870.319204] [31102]     0 31102     5985        1   0       0             0 dbus-daemon
[1430870.319208] [31105]     0 31105    14813       27   1       0             0 gconfd-2
[1430870.319212] [ 8227]     0  8227    23828        0   1       0             0 system-service-
[1430870.319216] [ 3822]  1000  3822   231065        0   1       0             0 gvfsd-http
[1430870.319220] [15413]  1000 15413   318622     4040   1       0             0 claws-mail
[1430870.319224] [15658]   101 15658    81413       96   1       0             0 rsyslogd
[1430870.319228] [27592]  1000 27592    68449        0   1       0             0 at-spi-bus-laun
[1430870.319232] [29414]     0 29414     5429        0   0     -17         -1000 udevd
[1430870.319236] [25918]     0 25918     5429        0   1     -17         -1000 udevd
[1430870.319240] [24119]  1000 24119     8450        1   1       0             0 bash
[1430870.319243] [13740]     0 13740     3740        0   0       0             0 xinetd
[1430870.319247] [16516]     0 16516    26084      111   1       0             0 cupsd
[1430870.319251] [25771]     7 25771    13032        0   1       0             0 dbus
[1430870.319255] [26788]  1000 26788    91164        0   0       0             0 gvfsd-smb
[1430870.319259] [26795]  1000 26795    91164        0   0       0             0 gvfsd-smb
[1430870.319263] [26804]  1000 26804    91164        0   0       0             0 gvfsd-smb
[1430870.319267] [26810]  1000 26810    91164        0   0       0             0 gvfsd-smb
[1430870.319271] [26900]  1000 26900    91164        0   0       0             0 gvfsd-smb
[1430870.319275] [27277]  1000 27277     1075        0   1       0             0 emacsclient
[1430870.319279] [19763]  1000 19763   115749      108   1       0             0 apport-gtk
[1430870.319284] [19847] 65534 19847     8563       18   1       0             0 dnsmasq
[1430870.319288] Out of memory: Kill process 1867 (gnome-settings-) score 753 or sacrifice child
[1430870.319292] Killed process 1867 (gnome-settings-) total-vm:6902612kB, anon-rss:3093140kB, file-rss:0kB


Seems that I'm out of mem which very unusual as I have 2.5 Gb free RAM under usual load.
Comment 17 johannesrosina 2012-09-14 08:15:25 UTC
A temporary fix from launchpad:

$ sudo apt-get install dconf-tools
$ dconf-editor
$ Go to org.gnome.settings-daemon.peripherals.keyboard
$ uncheck "remember-numlock-state" checkbox

https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/969359/comments/107

Many people are seeing this, and it is still not confirmed?
Comment 18 Tobias Mueller 2012-09-14 09:25:29 UTC
Well, as I've said, it doesn't help me to regain my CPU.
But yeah, I am setting to NEW as many people are affected and it hence is an issue that needs to be fixed.
Comment 19 Paolo M 2012-09-14 09:34:22 UTC
I made a double upgrade from ubuntu 11.04 to 12.04 a few weeks ago and never
had this problem again. I never applied the proposed workarounds.

These are the versions I'm running with:

$ dpkg -l gnome-settings-daemon
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version                 Description
+++-=======================-=======================-==============================================================
ii  gnome-settings-daemon   3.4.2-0ubuntu0.4        daemon handling the GNOME
session settings

$ uname -a
Linux [...] 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux

I don't know if this is important but I don't have the standard desktop. I was
using gnome classic on 11.04. The Unity packages weren't installed because I
had to downgrade compiz (it didn't work well with my graphic driver) and that
removed all of Unity. The update process to 11.10 couldn't find unity-desktop
and didn't install it again. Same for the update to 12.04. That left me with
the classic desktop with the gtk3 libraries. I configured it a little to look
like what I had and I'm fine with it.
Comment 20 Bastien Nocera 2012-09-17 11:32:31 UTC
If you can still experience the problem (and have a way of reproducing it), load up gnome-settings-daemon from master and run /usr/libexec/gsd-test-keyboard (or wherever you install gnome-settings-daemon). This should print messages each time a setting is changed, or a keyboard plugged in. Let us know what output you get.
Comment 21 André Klapper 2012-09-21 18:09:11 UTC
Better debug info needed for fixing => bumping Gnome target to 3.8 (which doesn't mean that a fix couldn't get backported to 3.6)
Comment 22 Tobias Mueller 2012-09-22 09:01:42 UTC
FWIW: I just killed the running g-s-d which seemed to be dysfunctional, i.e. my icons were ugly and pressing media keys on the keyboard didn't have any visible effect, i.e. volume wasn't changed. So the running g-s-d process wasn't all too detached to my session (or so). Anyway, I killed it and started it from a shell running in my desktop session as opposed to have someone starting it for me (I could see a new g-s-d process once I opened system-settings). Having spawned it manually, my media keys worked.

I suspended, resumed and I hit the numlock key just after resume when the screensaver was shown. It then went nuts.

I am running g-s-d from F17 and I tried not very committedly to build g-s-d from git, but well, that failed obviously.

Anyway, the log of the F17 g-s-d --debug is not very interesting I suppose:

(gnome-settings-daemon:479): power-plugin-DEBUG: Received gnome session status change
(gnome-settings-daemon:479): power-plugin-DEBUG: X not idle
(gnome-settings-daemon:479): PackageKit-DEBUG: notify::connected
(gnome-settings-daemon:479): updates-plugin-DEBUG: not when session active
(gnome-settings-daemon:479): PackageKit-DEBUG: notify::connected
(gnome-settings-daemon:479): updates-plugin-DEBUG: setting online 1
(gnome-settings-daemon:479): updates-plugin-DEBUG: defering action for 300 seconds
(gnome-settings-daemon:479): updates-plugin-DEBUG: not before timeout, thresh=86400, now=33118
(gnome-settings-daemon:479): updates-plugin-DEBUG: not before timeout, thresh=86400, now=33118

** (gnome-settings-daemon:479): WARNING **: Timeout was reached

** (gnome-settings-daemon:479): WARNING **: Timeout was reached

** (gnome-settings-daemon:479): WARNING **: Timeout was reached

** (gnome-settings-daemon:479): WARNING **: Timeout was reached


FWIW: gsettings set org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state false
does indeed "fix" it, but it takes a while. I am under the impression that g-s-d generated loads of traffic on the dbus or dconf or whereever and that it takes 15 minutes or so to work it off.
Comment 23 Bastien Nocera 2012-09-22 15:11:13 UTC
(In reply to comment #22)
> I am running g-s-d from F17 and I tried not very committedly to build g-s-d
> from git, but well, that failed obviously.

Why obviously?

> Anyway, the log of the F17 g-s-d --debug is not very interesting I suppose:

No, because it lacks the additional debugging that's in master and 3.5.92.
Comment 24 Reuben 2012-10-12 02:16:13 UTC
Same issue. Gentoo system.

Usually is a g-s-d process with 2 g-s-d sub-processes, one of which consumes 100% CPU and has a dconf process which shows up first in the iotop list, and seems determined to grind a hole in my hard drive.

Killing the g-s-d sub-process does nothing as it automatically re-spawns. Killing the parent g-s-d process still leaves dconf grinding away.

Numlock goes insane.

g-s-d version 3.4.2
Comment 25 André Klapper 2012-10-12 08:09:24 UTC
"me too" comments for 3.4 don't help. 
Please run 3.6 and provide debug info (see comment 23).
Comment 26 Maxim Britov 2012-10-16 15:19:23 UTC
Created attachment 226559 [details]
/usr/libexec/gsd-test-keyboard >& /tmp/gsd-test-keyboard.log

How I reproduce here:
1. run vino-server
2. Enable(!) numlock
3. lock desktop
4. connect by vnc
5. unlock desktop
Comment 27 Maxim Britov 2012-10-19 22:13:15 UTC
Hight load CPU in gnome-settings-daemon
and $ ps aux|fgrep dconf
maxim     2773  0.4 76.4 4341520 3100540 ?     Dl   окт.17  15:00 /usr/libexec/dconf-service

gnome-base/gnome-settings-daemon-3.6.1
gnome-base/dconf-0.14.0
Comment 28 André Klapper 2012-10-19 23:02:00 UTC
(In reply to comment #26)
> Created an attachment (id=226559) [details]
> /usr/libexec/gsd-test-keyboard >& /tmp/gsd-test-keyboard.log

Hmm, that log is a loop of 8 lines that are repeated all over again, nothing else. :(
Comment 29 Andrew Potter 2012-10-22 23:49:08 UTC
You probably shouldn't call apply_numlock() in settings_changed(). If someone wants to turn on their numlock state immediately, they should push the numlock key, not call gsetting set.

I think the problem lies somewhere between XkbLockModifiers() being an async function call and being unable to tell the difference between yourself, another process, and the user in xkb_events_filter(). It'd be nice if we could figure out exactly what's going on, but the use case for having the numlock state react to GSetting changes doesn't seem worth it. There's just too much potential to get stuck reacting to your own changes.
Comment 30 Andrew Potter 2012-10-24 08:48:19 UTC
Created attachment 227125 [details] [review]
keyboard: Prevent potential infinite loop

Here's a patch that should at least ensure we aren't doing this to ourselves. It compiles find, but jhbuild/dconf-service aren't playing nice on my system so I can't test it much myself.
Comment 31 Andrew Potter 2012-10-24 20:59:04 UTC
Created attachment 227197 [details] [review]
keyboard: Prevent potential infinite loop

I backported the above patch to the 3.4 branch and was able to test it. My testcase was to call "gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on ; gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state off" repeatedly via the commandline. Without the patch, I was able to trigger an infinite loop. With the patch it is avoided.

If you apply the other patch, be sure to remove the verbose g_debug statement, as there is no longer a need to verify the condition.
Comment 32 Bastien Nocera 2012-11-06 18:15:15 UTC
Created attachment 228300 [details] [review]
keyboard: Prevent potential infinite loop

XKB would notify us in the same way if the lockedMods
changed because of a programmatic, or a physical/human change.

This causes us changing the Num-Lock state generating another
event on top of the one we just processed, and might cause
infinite loops and 100% CPU usage.

Instead, we now only apply the settings:
- on startup
- when remember-num-lock is changed to true
Comment 33 Bastien Nocera 2012-11-06 18:19:37 UTC
(In reply to comment #31)
> I backported the above patch to the 3.4 branch and was able to test it. My
> testcase was to call "gsettings set
> org.gnome.settings-daemon.peripherals.keyboard numlock-state on ; gsettings set
> org.gnome.settings-daemon.peripherals.keyboard numlock-state off" repeatedly
> via the commandline. Without the patch, I was able to trigger an infinite loop.
> With the patch it is avoided.

Thanks a lot for the patch Andrew, but the limitations of XKB means that this probably wouldn't solve all the potential problems (I can imagine switching lock state using XTest creating problems as well).

The above patch should work-around the problem by completely avoiding changing the num-lock state beyond startup. Would be great if somebody could test it to make sure I didn't do anything stupid.

I'll backport to gnome-3-4 and gnome-3-6 if it works out.
Comment 34 Bastien Nocera 2012-11-07 08:57:37 UTC
Attachment 228300 [details] pushed as d5e7d85 - keyboard: Prevent potential infinite loop