Reproducer: 1) Set desktop icon type to minimized app icons 2) Switch workspaces xfdesktop cores. (xfdesktop:11999): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `XfdesktopWindowIconManager' Program received signal SIGSEGV, Segmentation fault. #0 0x00a2f5af in wnck_screen_get_active_workspace () from /usr/lib/libwnck-1.so.18 #1 0x08063e1d in workspace_changed_cb (wnck_screen=0x9bbb570, previous_workspace=0x9ba2090, user_data=0x241140) at xfdesktop-window-icon-manager.c:226 #2 0x07081259 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0 #3 0x07073f0b in g_closure_invoke () from /lib/libgobject-2.0.so.0 #4 0x07084e83 in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #5 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #6 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #7 0x00a2d1d1 in wnck_screen_get_workspace () from /usr/lib/libwnck-1.so.18 #8 0x00a2e268 in wnck_screen_get_workspace_count () from /usr/lib/libwnck-1.so.18 #9 0x00a2f168 in wnck_screen_get_workspace_count () from /usr/lib/libwnck-1.so.18 #10 0x06ff45e1 in g_source_is_destroyed () from /lib/libglib-2.0.so.0 #11 0x06ff6342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 #12 0x06ff931f in g_main_context_check () from /lib/libglib-2.0.so.0 #13 0x06ff96c9 in g_main_loop_run () from /lib/libglib-2.0.so.0 #14 0x073f4b84 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 #15 0x08055158 in main (argc=Cannot access memory at address 0x1 ) at main.c:370 It appears that wmanager->priv is NULL thus wmanager->priv->wnck_screen causes a segfaults
Actually, no wmanager->priv is not null. It actually crashes in: 0x00a2f5af in wnck_screen_get_active_workspace (screen=0x313a706f) at screen.c:594 594 g_return_val_if_fail (WNCK_IS_SCREEN (screen), NULL); #0 0x00a2f5af in wnck_screen_get_active_workspace (screen=0x313a706f) at screen.c:594 #1 0x08063e25 in workspace_changed_cb (wnck_screen=0x8dfa0c0, previous_workspace=0x8dfd090, user_data=0x737140) at xfdesktop-window-icon-manager.c:229 #2 0x07081259 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0 #3 0x07073f0b in g_closure_invoke () from /lib/libgobject-2.0.so.0 #4 0x07084e83 in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #5 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #6 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #7 0x00a2d1d1 in emit_active_workspace_changed (screen=<value optimized out>) at screen.c:1969 #8 0x00a2e268 in do_update_now (screen=0x8dfa0c0) at screen.c:1694 #9 0x00a2f168 in update_idle (data=0x8dfa0c0) at screen.c:1934 #10 0x06ff45e1 in g_source_is_destroyed () from /lib/libglib-2.0.so.0 #11 0x06ff6342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 #12 0x06ff931f in g_main_context_check () from /lib/libglib-2.0.so.0 #13 0x06ff96c9 in g_main_loop_run () from /lib/libglib-2.0.so.0 #14 0x073f4b84 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 #15 0x08055158 in main (argc=Cannot access memory at address 0x1 ) at main.c:370 (gdb) p (XfdesktopWindowIconManager) *0x737140 $4 = {parent = {g_type_instance = {g_class = 0x0}, ref_count = 0, qdata = 0x9174938}, priv = 0x9177670} (gdb) p (XfdesktopWindowIconManagerPrivate) *0x9177670 $5 = {inited = 0, desktop = 0x19, icon_view = 0x9177620, gscreen = 0x746b7365, wnck_screen = 0x313a706f, nworkspaces = 842609715, active_ws_num = 2112041, icon_workspaces = 0x39} inited is 0, but still adding a test will work at first change and then xfdesktop will crash the same at next switch.
No, the hint is in your first bit of output: (xfdesktop:11999): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `XfdesktopWindowIconManager' 'user_data' -> 'wmanager' isn't valid for some reason. Can you open up /usr/include/libwnck-1.0/libwnck/screen.h and check for the prototype of active_workspace_changed in WnckScreenClass? It should be void (*active_workspace_changed)(WnckScreen *screen, WnckWorkspace *previous_workspace); Is it? And if it is, any chance you can check through the sources for your version of libwnck and make sure g_signal_emit() for that signal is actually passing the correct arguments? If not, let me know your versions... Maybe it's just an API incompatibility since libwnck isn't API-frozen.
Bingo! Well spotted, I forgot that the API of libwnck was not frozen :( The prototype is: void (* active_workspace_changed) (WnckScreen *screen); On libwnck-2.16.
Wheee, good, that was easier than I thought. Hmm, looks like it was changed on 5 June 2007, which was libwnck 2.19.3.1. Weird. I guess libwnck does the even-stable/odd-unstable thing? So checking for 2.20.0 for the new API should be sufficient? Meh, I wanted to do a runtime check, but libwnck doesn't export version information at runtime. Figures. g_signal_query() to the rescue, I guess. Can you try current svn trunk?
Humm, now it segfaults at startup: (gdb) run Starting program: xfce-svn/xfdesktop/src/xfdesktop [Thread debugging using libthread_db enabled] [New Thread -1209039168 (LWP 3166)] ** (xfdesktop:3166): DEBUG: saturation is 1.0000 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1209039168 (LWP 3166)] workspace_changed_cb (wnck_screen=0x8a8b220, arg1=0x0, user_data=0x8a8e290) at xfdesktop-window-icon-manager.c:253 253 ws = wnck_screen_get_active_workspace(wmanager->priv->wnck_screen);
Hmm, it looks like my signal prototype detection is off... dammit.
Do you still get this with trunk? I compiled wnck 2.20, and it works fine for me. If so, can you give me an 'info locals' at the point of the crash?
y(In reply to comment #7) > Do you still get this with trunk? I compiled wnck 2.20, and it works fine for > me. Yes, it still crashes here. Revision: 28938 [Switching to Thread -1208629568 (LWP 7768)] workspace_changed_cb (wnck_screen=0x8849030, arg1=0x0, user_data=0x882da90) at xfdesktop-window-icon-manager.c:253 253 ws = wnck_screen_get_active_workspace(wmanager->priv->wnck_screen); (gdb) bt #0 workspace_changed_cb (wnck_screen=0x8849030, arg1=0x0, user_data=0x882da90) at xfdesktop-window-icon-manager.c:253 #1 0x080652d3 in xfdesktop_window_icon_manager_real_init (manager=0x882da90, icon_view=0x884c008) at xfdesktop-window-icon-manager.c:602 #2 0x08061e04 in xfdesktop_icon_view_realize (widget=0x884c008) at xfdesktop-icon-view.c:1493 #3 0x07081259 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0 #4 0x070726f9 in g_value_set_static_boxed () from /lib/libgobject-2.0.so.0 #5 0x07073fed in g_closure_invoke () from /lib/libgobject-2.0.so.0 #6 0x0708531a in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #7 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #8 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #9 0x0420648a in gtk_widget_realize () from /usr/lib/libgtk-x11-2.0.so.0 #10 0x04206a6e in gtk_widget_set_parent () from /usr/lib/libgtk-x11-2.0.so.0 #11 0x04016405 in gtk_bin_get_child () from /usr/lib/libgtk-x11-2.0.so.0 #12 0x07080769 in g_cclosure_marshal_VOID__OBJECT () from /lib/libgobject-2.0.so.0 #13 0x070726f9 in g_value_set_static_boxed () from /lib/libgobject-2.0.so.0 #14 0x07073f0b in g_closure_invoke () from /lib/libgobject-2.0.so.0 #15 0x0708531a in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #16 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #17 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #18 0x04055bac in gtk_container_add () from /usr/lib/libgtk-x11-2.0.so.0 #19 0x08059a9a in xfce_desktop_setup_icon_view (desktop=0x882f860) at xfce-desktop.c:261 #20 0x0805bdb1 in xfce_desktop_realize (widget=0x882f860) at xfce-desktop.c:781 #21 0x07081259 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0 #22 0x070726f9 in g_value_set_static_boxed () from /lib/libgobject-2.0.so.0 #23 0x07073f0b in g_closure_invoke () from /lib/libgobject-2.0.so.0 #24 0x0708531a in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #25 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #26 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #27 0x0420648a in gtk_widget_realize () from /usr/lib/libgtk-x11-2.0.so.0 #28 0x04216040 in gtk_window_new () from /usr/lib/libgtk-x11-2.0.so.0 #29 0x07081259 in g_cclosure_marshal_VOID__VOID () from /lib/libgobject-2.0.so.0 #30 0x070726f9 in g_value_set_static_boxed () from /lib/libgobject-2.0.so.0 #31 0x07073f0b in g_closure_invoke () from /lib/libgobject-2.0.so.0 #32 0x0708531a in g_signal_override_class_closure () from /lib/libgobject-2.0.so.0 #33 0x0708637f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0 #34 0x07086539 in g_signal_emit () from /lib/libgobject-2.0.so.0 #35 0x04205b18 in gtk_widget_show () from /usr/lib/libgtk-x11-2.0.so.0 #36 0x080555bb in main (argc=Cannot access memory at address 0x1 ) at main.c:347 > If so, can you give me an 'info locals' at the point of the crash? (gdb) info locals wmanager = (XfdesktopWindowIconManager *) 0x0 n = <value optimized out> ws = <value optimized out>
*** Bug 4649 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 5048 ***
God dammit. Backwards.
*** Bug 5048 has been marked as a duplicate of this bug. ***
With no complaints from xfdesktop 4.10 for this, marking resolved.