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 656550 - gnome-settings-daemon crashed with SIGSEGV in gdk_display_get_event()
gnome-settings-daemon crashed with SIGSEGV in gdk_display_get_event()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.2.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
Carlos Garnacho
: 665353 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-08-15 09:04 UTC by Pedro Villavicencio
Modified: 2012-09-03 16:57 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
Patch to handle XIQueryDevice (1.38 KB, patch)
2012-01-17 10:19 UTC, Chow Loong Jin
none Details | Review

Description Pedro Villavicencio 2011-08-15 09:04:35 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/814473

"This comes up after a graphical lock-up. The event is just like a Suspend action and needs to press the power button to resume."

".

Thread 2 (Thread 1533)

  • #0 _int_malloc
    at malloc.c line 4304
  • #1 __libc_malloc
    at malloc.c line 3660
  • #2 __vasprintf_chk
    at vasprintf_chk.c line 50
  • #3 vasprintf
    at /usr/include/bits/stdio2.h line 199
  • #4 g_vasprintf
    at /build/buildd/glib2.0-2.29.10/./glib/gprintf.c line 314
  • #5 g_strdup_vprintf
    at /build/buildd/glib2.0-2.29.10/./glib/gstrfuncs.c line 253
  • #6 g_strdup_printf
    at /build/buildd/glib2.0-2.29.10/./glib/gstrfuncs.c line 279
  • #7 dconf_engine_make_match_rule
    at ../engine/dconf-engine.c line 505
  • #8 dconf_settings_backend_subscribe_context_func
    at dconfsettingsbackend.c line 582
  • #9 g_main_dispatch
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 2473
  • #10 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3046
  • #11 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3124
  • #12 g_main_loop_run
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3332
  • #13 dconf_context_thread
    at dconfcontext.c line 11
  • #14 g_thread_create_proxy
    at /build/buildd/glib2.0-2.29.10/./glib/gthread.c line 1954
  • #15 start_thread
    at pthread_create.c line 304
  • #16 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #17 ??

Thread 1 (Thread 1528)

  • #0 create_device
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkdevicemanager-xi2.c line 245
  • #1 add_device
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkdevicemanager-xi2.c line 310
  • #2 handle_hierarchy_changed
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkdevicemanager-xi2.c line 586
  • #3 gdk_x11_device_manager_xi2_translate_event
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkdevicemanager-xi2.c line 1043
  • #4 gdk_x11_device_manager_xi2_translate_event
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkdevicemanager-xi2.c line 1007
  • #5 _gdk_x11_event_translator_translate
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkeventtranslator.c line 53
  • #6 gdk_event_source_translate_event
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkeventsource.c line 242
  • #7 _gdk_x11_display_queue_events
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkeventsource.c line 334
  • #8 gdk_display_get_event
    at /build/buildd/gtk+3.0-3.1.8/./gdk/gdkdisplay.c line 311
  • #9 gdk_event_source_dispatch
    at /build/buildd/gtk+3.0-3.1.8/./gdk/x11/gdkeventsource.c line 356
  • #10 g_main_dispatch
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 2473
  • #11 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3046
  • #12 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3124
  • #13 g_main_loop_run
    at /build/buildd/glib2.0-2.29.10/./glib/gmain.c line 3332
  • #14 gtk_main
    at /build/buildd/gtk+3.0-3.1.8/./gtk/gtkmain.c line 1362
  • #15 main
    at main.c line 399

Comment 1 Bastien Nocera 2011-09-06 19:47:51 UTC
Likely fixed with newer versions of GTK+. Can you still reproduce with GTK+ 3.1.18?
Comment 2 Stefano Rivera 2011-09-28 15:47:31 UTC
I am still seeing it with 3.2.0
Comment 3 misc 2011-10-28 15:27:27 UTC
I also see it with a up to date fedora 16. however, it only happen on my macbook. I take my laoptop, open it, type my password and after a few moment, the mouse no longer work, and the gnome-setting -daemon has crashed. 

I was able to run gdb in screen to get it.

I suspect it to be linked to the following part of the dmesg :

[ 8574.563206] PM: resume of devices complete after 2349.720 msecs
[ 8574.563365] PM: Finishing wakeup.
[ 8574.563367] Restarting tasks ... done.
[ 8574.602268] video LNXVIDEO:00: Restoring backlight state
[ 8574.784108] usb 5-1: USB disconnect, device number 9
[ 8574.812740] sky2 0000:01:00.0: eth0: enabling interface
[ 8574.813102] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 8574.824164] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 8575.243039] usb 5-1: new full speed USB device number 10 using uhci_hcd
[ 8575.412853] usb 5-1: New USB device found, idVendor=05ac, idProduct=1000
[ 8575.412861] usb 5-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 8575.437283] input: HID 05ac:1000 as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input20
[ 8575.437682] generic-usb 0003:05AC:1000.000B: input,hidraw2: USB HID v1.11 Keyboard [HID 05ac:1000] on usb-0000:00:1d.3-1/input0
[ 8575.471388] input: HID 05ac:1000 as /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1/input/input21
[ 8575.471996] generic-usb 0003:05AC:1000.000C: input,hidraw3: USB HID v1.11 Mouse [HID 05ac:1000] on usb-0000:00:1d.3-1/input1
[ 8575.789084] usb 5-1: USB disconnect, device number 10
[ 8575.866846] gnome-settings-[4632]: segfault at 8 ip 49e78ddf sp bfb21540 error 4 in libgdk-3.so.0.200.1[49e3f000+76000]
[ 8576.014074] usb 5-1: new full speed USB device number 11 using uhci_hcd
[ 8576.201840] usb 5-1: New USB device found, idVendor=05ac, idProduct=8205
[ 8576.201844] usb 5-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0


it seems usb is disconnected briefly, and this trigger the stack trace.
I see this with gtk3-3.2.1-1.fc16.i686 and gnome-settings-daemon-3.2.1-1.fc16.i686. 

And since gdb prevent the crash, I didn't lose my touchpad. 

Here is the stacktrace :

Program received signal SIGSEGV, Segmentation fault.
add_device (device_manager=0x9152a28 [GdkX11DeviceManagerXI2], dev=0x0, emit_signal=1) at gdkdevicemanager-xi2.c:310
310       device = create_device (GDK_DEVICE_MANAGER (device_manager), display, dev);
(gdb) bt
  • #0 add_device
    at gdkdevicemanager-xi2.c line 310
  • #1 handle_hierarchy_changed
    at gdkdevicemanager-xi2.c line 590
  • #2 gdk_x11_device_manager_xi2_translate_event
    at gdkdevicemanager-xi2.c line 1050
  • #3 gdk_x11_device_manager_xi2_translate_event
    at gdkdevicemanager-xi2.c line 1011
  • #4 _gdk_x11_event_translator_translate
    at gdkeventtranslator.c line 53
  • #5 gdk_event_source_translate_event
    at gdkeventsource.c line 242
  • #6 _gdk_x11_display_queue_events
    at gdkeventsource.c line 334
  • #7 gdk_display_get_event
    at gdkdisplay.c line 311
  • #8 gdk_event_source_dispatch
    at gdkeventsource.c line 356
  • #9 g_main_dispatch
    at gmain.c line 2425
  • #10 g_main_context_dispatch
    at gmain.c line 2995
  • #11 g_main_context_iterate
    at gmain.c line 3073
  • #12 g_main_loop_run
    at gmain.c line 3281
  • #13 gtk_main
    at gtkmain.c line 1362
  • #14 main
    at main.c line 458

The stack trace seems to imply that libXI do not return a valid value in handle_hierarchy_changed, and that's the problem. 

According to gdb :

(gdb) l 589
584
585       for (i = 0; i < ev->num_info; i++)
586         {
587           if (ev->info[i].flags & XIDeviceEnabled)
588             {
589               info = XIQueryDevice (xdisplay, ev->info[i].deviceid, &ndevices);
590               add_device (device_manager, &info[0], TRUE);
591               XIFreeDeviceInfo (info);
592             }
593           else if (ev->info[i].flags & XIDeviceDisabled)
(gdb) p ndevices
$3 = -1
(gdb) 

XIQueryDevice did return a error and the library do not check this case.

After quickly looking at the source code, this could be a race condition, since there is just 3 errors case and none seems obvious to me.
Comment 4 Fabio Durán Verdugo 2011-12-02 04:32:36 UTC
*** Bug 665353 has been marked as a duplicate of this bug. ***
Comment 5 Fabio Durán Verdugo 2011-12-02 04:33:24 UTC
last dup at 3.2.x
Comment 6 Alex Mayorga Adame 2011-12-19 19:33:51 UTC
FWIW https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/906471 is this crash on gnome-settings-daemon 3.2.2-0ubuntu5 during an "Adobe Flash hogging CPU" situation.
Comment 7 Chow Loong Jin 2012-01-17 10:19:01 UTC
Created attachment 205432 [details] [review]
Patch to handle XIQueryDevice

Here's a patch that should fix the bug. I'm not able to reproduce this bug reliably, so I can't really test the patch though.
Comment 8 Matthias Clasen 2012-01-21 01:15:47 UTC
The patch is not against master - we already have a check there.
Comment 9 Cosimo Cecchi 2012-09-03 16:57:28 UTC
Commit 9b967ab8aff46b79494d75a3129fa8780545ecd1 should fix this and was not present in 3.2.0, and it looks like all the crashers in the Launchpad report are with 3.2.0.
I'm going to close this as FIXED, please reopen if you can still reproduce with a newer version of GTK.