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 786096 - shell: Segfault when opening some panels via search
shell: Segfault when opening some panels via search
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Color
git master
Other Linux
: Normal critical
: ---
Assigned To: Richard Hughes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-10 08:50 UTC by Mohammed Sadiq
Modified: 2017-08-16 21:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
color: Avoid casting before checking for errors (2.10 KB, patch)
2017-08-16 21:12 UTC, Georges Basile Stavracas Neto
committed Details | Review

Description Mohammed Sadiq 2017-08-10 08:50:54 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
Comment 1 Georges Basile Stavracas Neto 2017-08-16 21:06:59 UTC
This is a crash in the Color panel. Reassigning.
Comment 2 Georges Basile Stavracas Neto 2017-08-16 21:12:35 UTC
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.
Comment 3 Georges Basile Stavracas Neto 2017-08-16 21:13:14 UTC
Attachment 357761 [details] pushed as 024bb97 - color: Avoid casting before checking for errors