GNOME Bugzilla – Bug 786096
shell: Segfault when opening some panels via search
Last modified: 2017-08-16 21:13:18 UTC
1. Search for 'printer' -> Open 'Printers' 2. Search for 'wacom' -> open 'Wacom Tablet' 3. Search for 'keyboard' -> open 'Keyboard' 4. Search for 'mouse' -> open 'Mouse & Touchpad' asan output: ASAN:DEADLYSIGNAL ================================================================= ==24214==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fde4196fdf4 bp 0x7fff68a4d070 sp 0x7fff68a4cf70 T0) #0 0x7fde4196fdf3 in g_type_check_instance_cast /home/sadiq/jhbuild/checkout/glib/gobject/gtype.c:4052 #1 0x55821b796b01 in gcm_prefs_connect_cb /home/sadiq/jhbuild/checkout/gnome-control-center/panels/color/cc-color-panel.c:2024 #2 0x7fde41c1f38b in g_task_return_now /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1145 #3 0x7fde41c20041 in g_task_return /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1203 #4 0x7fde41c208a4 in g_task_return_error /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1777 #5 0x7fde41c20aaa in g_task_return_new_error /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1811 #6 0x7fde4b86d620 in cd_client_connect_cb ../../../../../../Main/Software/src/github/colord/lib/colord/cd-client.c:358 #7 0x7fde41c1f38b in g_task_return_now /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1145 #8 0x7fde41c20041 in g_task_return /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1203 #9 0x7fde41c208a4 in g_task_return_error /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1777 #10 0x7fde41c646e8 in get_connection_cb /home/sadiq/jhbuild/checkout/glib/gio/gdbusproxy.c:1827 #11 0x7fde41c1f38b in g_task_return_now /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1145 #12 0x7fde41c20041 in g_task_return /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1203 #13 0x7fde41c208a4 in g_task_return_error /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1777 #14 0x7fde41c52b49 in bus_get_async_initable_cb /home/sadiq/jhbuild/checkout/glib/gio/gdbusconnection.c:7297 #15 0x7fde41c1f38b in g_task_return_now /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1145 #16 0x7fde41c1f3c5 in complete_in_idle_cb /home/sadiq/jhbuild/checkout/glib/gio/gtask.c:1159 #17 0x7fde4166a95c in g_idle_dispatch /home/sadiq/jhbuild/checkout/glib/glib/gmain.c:5504 #18 0x7fde4166b6a7 in g_main_dispatch /home/sadiq/jhbuild/checkout/glib/glib/gmain.c:3148 #19 0x7fde4166def1 in g_main_context_dispatch /home/sadiq/jhbuild/checkout/glib/glib/gmain.c:3813 #20 0x7fde4166e056 in g_main_context_iterate /home/sadiq/jhbuild/checkout/glib/glib/gmain.c:3886 #21 0x7fde4166e0d4 in g_main_context_iteration /home/sadiq/jhbuild/checkout/glib/glib/gmain.c:3947 #22 0x7fde41c37820 in g_application_run /home/sadiq/jhbuild/checkout/glib/gio/gapplication.c:2401 #23 0x55821b74cdef in main /home/sadiq/jhbuild/checkout/gnome-control-center/shell/main.c:57 #24 0x7fde403702b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) #25 0x55821b74cbe9 in _start (/media/sadiq/Temp/jhbuild/install/bin/gnome-control-center+0x410be9) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/sadiq/jhbuild/checkout/glib/gobject/gtype.c:4052 in g_type_check_instance_cast ==24214==ABORTING
This is a crash in the Color panel. Reassigning.
Created attachment 357761 [details] [review] color: Avoid casting before checking for errors When the asynchronous operation is finished in the Color panel, the user may potentially have already changed to another panel, making the CcColorPanel reference invalid. In the callback, the first thing that is done is casting (and type-checking) the CcColorPanel pointer, causing a segmentation fault. Fix that by only casting anything after checking the result of the asynchronous call.
Attachment 357761 [details] pushed as 024bb97 - color: Avoid casting before checking for errors