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 773871 - Calendar segfaults on exit
Calendar segfaults on exit
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: General
3.22.x
Other Linux
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
: 773153 776388 776620 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-11-03 02:19 UTC by Mohammed Sadiq
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application: cleanup finalize method (1.45 KB, patch)
2016-11-22 10:59 UTC, Mohammed Sadiq
committed Details | Review
application: don't remove providers from screen when finalizing (1.48 KB, patch)
2017-02-09 13:08 UTC, Georges Basile Stavracas Neto
none Details | Review
application: don't remove providers from screen when finalizing (1.52 KB, patch)
2017-02-09 13:09 UTC, Georges Basile Stavracas Neto
committed Details | Review

Description Mohammed Sadiq 2016-11-03 02:19:48 UTC
GNOME calendar segfaults on exit.

Thread 1 "gnome-calendar" received signal SIGSEGV, Segmentation fault.
gtk_widget_get_scale_factor (widget=<optimized out>) at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkwidget.c:10877
warning: Source file is more recent than executable.
10877	
(gdb) bt full
  • #0 gtk_widget_get_scale_factor
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkwidget.c line 10877
  • #1 gtk_css_widget_node_get_style_provider
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkcsswidgetnode.c line 250
  • #2 gtk_css_node_get_style_provider_or_null
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkcssnode.c line 121
  • #3 gtk_css_node_invalidate_style_provider
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkcssnode.c line 1316
  • #4 g_closure_invoke
    at /home/sadiq/jhbuild/checkout/glib/gobject/gclosure.c line 804
  • #5 signal_emit_unlocked_R
    at /home/sadiq/jhbuild/checkout/glib/gobject/gsignal.c line 3635
  • #6 g_signal_emit_valist
    at /home/sadiq/jhbuild/checkout/glib/gobject/gsignal.c line 3391
  • #7 g_signal_emit
    at /home/sadiq/jhbuild/checkout/glib/gobject/gsignal.c line 3447
  • #8 _gtk_style_provider_private_changed
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkstyleproviderprivate.c line 113
  • #9 _gtk_style_cascade_remove_provider
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkstylecascade.c line 400
  • #10 gtk_style_context_remove_provider_for_screen
    at /home/sadiq/jhbuild/checkout/gtk+-3/gtk/gtkstylecontext.c line 741
  • #11 gcal_application_finalize
    at /home/sadiq/jhbuild/checkout/gnome-calendar/src/gcal-application.c line 212
  • #12 g_object_unref
    at /home/sadiq/jhbuild/checkout/glib/gobject/gobject.c line 3185
  • #13 main
    at /home/sadiq/jhbuild/checkout/gnome-calendar/src/main.c line 44

Comment 1 Mohammed Sadiq 2016-11-22 10:59:15 UTC
Created attachment 340508 [details] [review]
application: cleanup finalize method

Calendar now segfaults due to faling function
gtk_style_context_remove_provider_for_screen in application finalize method.

As application finalize method is called only when the application closes,
there isn't any hard requirement to cleanup every trailings. Operating
System shall take care of that.

So removing the failing functions so as to not segfault on exit anymore.
Comment 2 Alexandre Franke 2016-12-06 21:03:55 UTC
*** Bug 773153 has been marked as a duplicate of this bug. ***
Comment 3 Christian Stadelmann 2016-12-22 13:48:48 UTC
*** Bug 776388 has been marked as a duplicate of this bug. ***
Comment 4 Christian Stadelmann 2016-12-22 13:49:39 UTC
Bug #776388 has some more details on this, including valgrind data. Issue still present in 3.22.2.
Comment 5 Mohammed Sadiq 2016-12-30 16:40:55 UTC
*** Bug 776620 has been marked as a duplicate of this bug. ***
Comment 6 Christian Stadelmann 2017-02-02 22:22:51 UTC
Still present with the latest version from master / flatpak.
Comment 7 Georges Basile Stavracas Neto 2017-02-09 13:08:45 UTC
Created attachment 345311 [details] [review]
application: don't remove providers from screen when finalizing

When finalizing the application, it is possible that the main window
had already been destroyed and the Gtk+ CSS machinery to stop working.
We currently try to remove the CSS providers from screen when finalizing,
which (i) has no effect, and (ii) causes a segfault.

Fix that by simply destroying the CSS providers, and not trying to
remove them on finalize.
Comment 8 Georges Basile Stavracas Neto 2017-02-09 13:09:51 UTC
Created attachment 345312 [details] [review]
application: don't remove providers from screen when finalizing

When finalizing the application, it is possible that the main window
had already been destroyed and the Gtk+ CSS machinery to stop working.
We currently try to remove the CSS providers from screen when finalizing,
which (i) has no effect, and (ii) causes a segfault.

Fix that by simply destroying the CSS providers, and not trying to
remove them on finalize.
Comment 9 Georges Basile Stavracas Neto 2017-02-09 13:12:02 UTC
Attachment 345312 [details] pushed as 0ce04c0 - application: don't remove providers from screen when finalizing
Comment 10 Ernestas Kulik 2017-02-09 13:14:46 UTC
Mohammed’s patch was functionally equivalent. :(
Comment 11 Georges Basile Stavracas Neto 2017-02-09 13:22:05 UTC
Sorry for missing your patch, Sadiq. Yours one is the standing commit now.

Attachment 340508 [details] pushed as 1449233 - application: cleanup finalize method