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 410133 - gnome-panel crashed with SIGSEGV in wnck_window_get_actions()
gnome-panel crashed with SIGSEGV in wnck_window_get_actions()
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: tasklist
2.18.x
Other Linux
: Normal critical
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-20 19:49 UTC by Sebastien Bacher
Modified: 2007-04-29 13:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Sebastien Bacher 2007-02-20 19:49:03 UTC
That bug has been opened on https://launchpad.net/bugs/86542

"Binary package hint: gnome-panel

I right clicked on a group of epiphany windows and choose 'close all'
...
libwnck18 2.17.91-0ubuntu1
..."

Debug backtrace for the crash:

(gdb) bt full
  • #0 wnck_window_get_actions
    at window.c line 1530
  • #1 update_menu_state
    at window-action-menu.c line 255
  • #2 g_idle_dispatch
    at gmain.c line 3928
  • #3 IA__g_main_context_dispatch
    at gmain.c line 2045
  • #4 g_main_context_iterate
    at gmain.c line 2677
  • #5 IA__g_main_loop_run
    at gmain.c line 2881
  • #6 IA__gtk_main
    at gtkmain.c line 1171
  • #7 main

From gdb and the crash file:

(gdb) p *window
$2 = {parent_instance = {g_type_instance = {g_class = 0x2c}, ref_count = 140769800, qdata = 0x8855bb0}, priv = 0x40}
Comment 1 Elijah Newren 2007-04-09 23:47:02 UTC
Looks like a critical warning crasher, given the line numbers.  Thus I suspect this doesn't really affect 2.18.x (unless someone is using a development version of libgnome or whatever handles the critical warning stuff).

Anyway, does this patch seem to help? :

Index: libwnck/window-action-menu.c
===================================================================
--- libwnck/window-action-menu.c        (revision 1201)
+++ libwnck/window-action-menu.c        (working copy)
@@ -251,7 +251,13 @@
   WnckScreen        *screen;
 
   amd->idle_handler = 0;
-  
+
+  /* The window may have been freed before the idle handler fires; if so, quit
+   * early.
+   */
+  if (!WNCK_IS_WINDOW (amd->window))
+    return FALSE;
+
   actions = wnck_window_get_actions (amd->window);
   screen  = wnck_window_get_screen  (amd->window);
   
Comment 2 Sebastien Bacher 2007-04-10 08:15:56 UTC
The Ubuntu versions don't use critical warning crashers to not annoy users too much, the corresponding line is "  g_return_val_if_fail (WNCK_IS_WINDOW (window), 0);" in wnck_window_get_actions (), the window->priv=0x40 value doesn't look correct though, might be a corruption somewhere. I'll ask the submitter if he can trigger the bug whenever he wants, the crash doesn't happen here so it's not easy to try the change and know if it makes a difference

Comment 3 Vincent Untz 2007-04-29 13:57:24 UTC
The only reason this could happen is the window being freed. What we should do in this case is destroy the menu.

2007-04-29  Vincent Untz  <vuntz@gnome.org>

	* libwnck/window-action-menu.c: (window_weak_notify): destroy the menu
	when the window is getting finalized
	(set_data): kill
	(get_data): walk up in the parent tree to get the widget which knows
	about "wnck-action-data"
	(item_activated_callback): updated
	(make_radio_menu_item): don't call set_data since it's now useless
	(make_check_menu_item): ditto
	(make_menu_item): ditto
	Should fix bug #410133