Created attachment 7741 (gdb) bt; t a a bt f; info registers Starting Xfce4 with `GDK_SCALE=2 GDK_DPI_SCALE=1`, the workspace switcher flickers over the time in the menu. Removing the plugin, the panel crashes with the trace below. ``` #0 0x00007fd56f9bead0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007fd56f9bfd80 in __GI_abort () at abort.c:100 #2 0x00007fd5703655d5 in g_assertion_message (domain=domain@entry=0x7fd572d639ec "libxfce4panel", file=file@entry=0x7fd572d64f20 "/scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c", line=line@entry=919, func=func@entry=0x7fd572d66530 <__func__.58015> "xfce_panel_plugin_finalize", message=message@entry=0x792500 "assertion failed: (plugin->priv->menu_items == ((void *)0))") at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gtestutils.c:2532 #3 0x00007fd57036562a in g_assertion_message_expr (domain=domain@entry=0x7fd572d639ec "libxfce4panel", file=file@entry=0x7fd572d64f20 "/scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c", line=line@entry=919, func=func@entry=0x7fd572d66530 <__func__.58015> "xfce_panel_plugin_finalize", expr=expr@entry=0x7fd572d64ef8 "plugin->priv->menu_items == ((void *)0)") at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gtestutils.c:2555 #4 0x00007fd572d5ddcc in xfce_panel_plugin_finalize (object=0x95e320 [XfcePagerPlugin]) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c:919 #5 0x00007fd57061e242 in g_object_unref (_object=0x95e320) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gobject.c:3340 #6 0x00007fd570641190 in g_value_unset (value=value@entry=0x7ffff1bdf640) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gvalue.c:275 #7 0x00007fd57063416d in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffff1bdf7e8) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3421 #8 0x00007fd570634ae2 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #9 0x00007fd572d5ffa0 in xfce_panel_plugin_menu_remove (plugin=0x95e320 [XfcePagerPlugin]) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c:1062 #13 0x00007fd570634ae2 in <emit signal ??? on instance 0x8e5210 [GtkImageMenuItem]> (instance=instance@entry=0x8e5210, signal_id=<optimized out>, detail=detail@entry=0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #10 0x00007fd57061966d in g_closure_invoke (closure=0x845540, return_value=0x0, n_param_values=1, param_values=0x7ffff1bdfab0, invocation_hint=0x7ffff1bdfa50) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gclosure.c:804 #11 0x00007fd57062bbce in signal_emit_unlocked_R (node=node@entry=0x6c38f0, detail=detail@entry=0, instance=instance@entry=0x8e5210, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffff1bdfab0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3635 #12 0x00007fd570634125 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffff1bdfc48) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3391 #14 0x00007fd5719efe46 in gtk_widget_activate (widget=widget@entry=0x8e5210 [GtkImageMenuItem]) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7777 #15 0x00007fd5718c7cb6 in gtk_menu_shell_activate_item (menu_shell=0xb72860 [GtkMenu], menu_item=0x8e5210 [GtkImageMenuItem], force_deactivate=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmenushell.c:1375 #16 0x00007fd5718c7f22 in gtk_menu_shell_button_release (widget=0xb72860 [GtkMenu], event=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmenushell.c:791 #17 0x00007fd5718ac602 in _gtk_marshal_BOOLEAN__BOXEDv (closure=0x6b5f80, return_value=0x7ffff1bdff10, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x6b5fb0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmarshalers.c:129 #18 0x00007fd5706198a6 in _g_closure_invoke_va (closure=0x6b5f80, return_value=0x7ffff1bdff10, instance=0xb72860, args=0x7ffff1be0008, n_params=1, param_types=0x6b5fb0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gclosure.c:867 #19 0x00007fd570633df4 in g_signal_emit_valist (instance=0xb72860, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffff1be0008) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3300 #20 0x00007fd570634ae2 in g_signal_emit (instance=instance@entry=0xb72860, signal_id=<optimized out>, detail=detail@entry=0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #21 0x00007fd5719ed974 in gtk_widget_event_internal (widget=widget@entry=0xb72860 [GtkMenu], event=event@entry=0xc0a960) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7744 #22 0x00007fd5719ef9da in gtk_widget_event (widget=widget@entry=0xb72860 [GtkMenu], event=event@entry=0xc0a960) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7314 #23 0x00007fd5718a956e in propagate_event_up (topmost=<optimized out>, event=<optimized out>, widget=0xb72860 [GtkMenu]) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:2582 #24 0x00007fd5718a956e in propagate_event (widget=<optimized out>, event=0xc0a960, captured=<optimized out>, topmost=0x0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:2684 #25 0x00007fd5718ab648 in gtk_main_do_event (event=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:1915 #26 0x00007fd5713c2575 in _gdk_event_emit (event=event@entry=0xc0a960) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gdk/gdkevents.c:73 #27 0x00007fd5713f2a72 in gdk_event_source_dispatch (source=source@entry=0x6a2d60, callback=<optimized out>, user_data=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gdk/x11/gdkeventsource.c:367 #28 0x00007fd57033f897 in g_main_dispatch (context=0x6aaa50) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3177 #29 0x00007fd57033f897 in g_main_context_dispatch (context=context@entry=0x6aaa50) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3830 #30 0x00007fd57033faa8 in g_main_context_iterate (context=0x6aaa50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3903 #31 0x00007fd57033fdb2 in g_main_loop_run (loop=0x6fbae0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:4099 #32 0x00007fd5718aa795 in gtk_main () at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:1323 #33 0x000000000041475e in main (argc=<optimized out>, argv=<optimized out>) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/panel/main.c:375 ```
I think this is a duplicate of https://bugzilla.xfce.org/show_bug.cgi?id=14144 Thanks for the backtrace though
Closing as duplicate. *** This bug has been marked as a duplicate of bug 14144 ***
@Paul: Could you try the patch attached to the original bugreport? Thanks!
No idea, where to reply, but testing [1] from bug 14144, it still crashes, adding the workspace switcher and removing it to the horizontal top panel with everything scaled 2x on a 4K HiDPI Dell display. ``` libxfce4panel:ERROR:/scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c:922:xfce_panel_plugin_finalize: assertion failed: (plugin->priv->menu_items == ((void *)0)) ``` Here is the backtrace. ``` #0 0x00007f0ffe713ad0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007f0ffe714d80 in __GI_abort () at abort.c:100 #2 0x00007f0fff0ba5d5 in g_assertion_message (domain=domain@entry=0x7f1001ab8a6c "libxfce4panel", file=file@entry=0x7f1001ab9fa0 "/scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c", line=line@entry=922, func=func@entry=0x7f1001abb5b0 <__func__.61380> "xfce_panel_plugin_finalize", message=message@entry=0xa7ce40 "assertion failed: (plugin->priv->menu_items == ((void *)0))") at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gtestutils.c:2532 #3 0x00007f0fff0ba62a in g_assertion_message_expr (domain=domain@entry=0x7f1001ab8a6c "libxfce4panel", file=file@entry=0x7f1001ab9fa0 "/scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c", line=line@entry=922, func=func@entry=0x7f1001abb5b0 <__func__.61380> "xfce_panel_plugin_finalize", expr=expr@entry=0x7f1001ab9f78 "plugin->priv->menu_items == ((void *)0)") at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gtestutils.c:2555 #4 0x00007f1001ab2e27 in xfce_panel_plugin_finalize (object=0x958a00 [XfcePagerPlugin]) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c:922 #5 0x00007f0fff373242 in g_object_unref (_object=0x958a00) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gobject.c:3340 #6 0x00007f0fff396190 in g_value_unset (value=value@entry=0x7ffdb28a13a0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gvalue.c:275 #7 0x00007f0fff38916d in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffdb28a1548) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3421 #8 0x00007f0fff389ae2 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #9 0x00007f1001ab5010 in xfce_panel_plugin_menu_remove (plugin=0x958a00 [XfcePagerPlugin]) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/libxfce4panel/xfce-panel-plugin.c:1065 #13 0x00007f0fff389ae2 in <emit signal ??? on instance 0x8f33d0 [GtkImageMenuItem]> (instance=instance@entry=0x8f33d0, signal_id=<optimized out>, detail=detail@entry=0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #10 0x00007f0fff36e66d in g_closure_invoke (closure=0x7f8b00, return_value=0x0, n_param_values=1, param_values=0x7ffdb28a1810, invocation_hint=0x7ffdb28a17b0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gclosure.c:804 #11 0x00007f0fff380bce in signal_emit_unlocked_R (node=node@entry=0x6b6970, detail=detail@entry=0, instance=instance@entry=0x8f33d0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffdb28a1810) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3635 #12 0x00007f0fff389125 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffdb28a19a8) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3391 #14 0x00007f1000744e46 in gtk_widget_activate (widget=widget@entry=0x8f33d0 [GtkImageMenuItem]) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7777 #15 0x00007f100061ccb6 in gtk_menu_shell_activate_item (menu_shell=0xae22a0 [GtkMenu], menu_item=0x8f33d0 [GtkImageMenuItem], force_deactivate=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmenushell.c:1375 #16 0x00007f100061cf22 in gtk_menu_shell_button_release (widget=0xae22a0 [GtkMenu], event=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmenushell.c:791 #17 0x00007f1000601602 in _gtk_marshal_BOOLEAN__BOXEDv (closure=0x6a9b00, return_value=0x7ffdb28a1c70, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x6a9b30) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmarshalers.c:129 #18 0x00007f0fff36e8a6 in _g_closure_invoke_va (closure=0x6a9b00, return_value=0x7ffdb28a1c70, instance=0xae22a0, args=0x7ffdb28a1d68, n_params=1, param_types=0x6a9b30) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gclosure.c:867 #19 0x00007f0fff388df4 in g_signal_emit_valist (instance=0xae22a0, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffdb28a1d68) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3300 #20 0x00007f0fff389ae2 in g_signal_emit (instance=instance@entry=0xae22a0, signal_id=<optimized out>, detail=detail@entry=0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gsignal.c:3447 #21 0x00007f1000742974 in gtk_widget_event_internal (widget=widget@entry=0xae22a0 [GtkMenu], event=event@entry=0x8aa5c0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7744 #22 0x00007f10007449da in gtk_widget_event (widget=widget@entry=0xae22a0 [GtkMenu], event=event@entry=0x8aa5c0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkwidget.c:7314 #23 0x00007f10005fe56e in propagate_event_up (topmost=<optimized out>, event=<optimized out>, widget=0xae22a0 [GtkMenu]) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:2582 #24 0x00007f10005fe56e in propagate_event (widget=<optimized out>, event=0x8aa5c0, captured=<optimized out>, topmost=0x0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:2684 #25 0x00007f1000600648 in gtk_main_do_event (event=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:1915 #26 0x00007f1000117575 in _gdk_event_emit (event=event@entry=0x8aa5c0) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gdk/gdkevents.c:73 #27 0x00007f1000147a72 in gdk_event_source_dispatch (source=source@entry=0x69eac0, callback=<optimized out>, user_data=<optimized out>) at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gdk/x11/gdkeventsource.c:367 #28 0x00007f0fff094897 in g_main_dispatch (context=0x69ebb0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3177 #29 0x00007f0fff094897 in g_main_context_dispatch (context=context@entry=0x69ebb0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3830 #30 0x00007f0fff094aa8 in g_main_context_iterate (context=0x69ebb0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3903 #31 0x00007f0fff094db2 in g_main_loop_run (loop=0x6e7d00) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:4099 #32 0x00007f10005ff795 in gtk_main () at /dev/shm/bee-joey/gtk3/gtk3-3.22.30-0/source/gtk/gtkmain.c:1323 #33 0x00000000004147ae in main (argc=<optimized out>, argv=<optimized out>) at /scratch/local/bee-root/xfce4-panel/xfce4-panel-4.13.3-0/source/panel/main.c:375 ``` [1]: https://bugzilla.xfce.org/attachment.cgi?id=7755
Reopening: As the other bug seems to be actually resolved for the reporter with that patch I presume this is a different bug.
@Simon, the panel is crashing again on me when removing workspace switcher, at the same spot reported here (xfce-panel-plugin.c:922). I have no idea why it worked before and now is crashing again. I tried to build panel at that commit (d614f388b0202ae55377b1058d90381b226f4deb), still crashing. Sorry for the false negative =/
@Andre: Strange, I can't reproduce anymore, so here the issue is quite definitely fixed...
As commented in #xfce-dev, yes it is still crashing with current git master (805249296df27e1af44398e1c4f365442eb49616), at the same line. The point is: since this is a failing assertion, in order to it crash, panel should be configured with debug enabled.
@Simon, I'm far from gtk expert, but that part of code doesn't make much sense to me: if (plugin->priv->menu != NULL) { /* remove custom items before they get destroyed */ for (li = plugin->priv->menu_items; li != NULL; li = li->next) gtk_container_remove (GTK_CONTAINER (plugin->priv->menu), GTK_WIDGET (li->data)); /* attached menu is destroyed by GtkWidget */ panel_assert (plugin->priv->menu_items == NULL); } if menu_items is NULL, ok the for loop will be skipped and the assertion will be satisfied. On the other hand, if menu_items is not NULL the for loop will remove each menu item, but they are not remove from the list, at least not explicitly. Even if the items get removed, shouldn't we call g_slist_free (or g_slist_free_full in the for loop)?
Simon Steinbeiss referenced this bugreport in commit cf18bd1e7208fae82113d7af5351c76167f0a350 Prevent crash on removing certain plugins (Bug #14418) https://git.xfce.org/xfce/xfce4-panel/commit?id=cf18bd1e7208fae82113d7af5351c76167f0a350
I took another swing at this after being able to reproduce the bug (with enable-debug=yes). Removing the menuitem from the container doesn't really destroy it and g_slist_free only frees the memory of the list, but again, doesn't actually destroy the menuitem. So I resorted to g_object_unref which seems to do the trick. Cleaning up the GSList (as you suggested) is probably a good idea anyway, so I kept that part too. Please test and if you can confirm the fix too set the bugreport to fixed.
Thanks Simon for taking a look, now the panel doesn't crash yay! However some messages are emitted when workspace switcher is removed, not sure though it's related to your commit: (xfce4-panel:13877): GLib-GObject-CRITICAL **: 08:38:03.803: g_object_set_qdata: assertion 'G_IS_OBJECT (object)' failed (xfce4-panel:13877): GLib-GObject-WARNING **: 08:38:03.803: instance with invalid (NULL) class pointer (xfce4-panel:13877): GLib-GObject-CRITICAL **: 08:38:03.803: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed (xfce4-panel:13877): GLib-GObject-WARNING **: 08:38:03.803: instance with invalid (NULL) class pointer (xfce4-panel:13877): GLib-GObject-CRITICAL **: 08:38:03.803: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
Yes, I also noticed those warnings. Not sure if that's directly related, but I'll try to dig into it. Most importantly the crash is fixed...