! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfdesktops cores when changing workspace when icon type == app icons
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Olivier Fourdan editbugs 2008-09-17 10:50:19 CEST
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
Comment 1 Olivier Fourdan editbugs 2008-09-17 11:08:13 CEST
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.
Comment 2 Brian J. Tarricone (not reading bugmail) 2008-09-25 11:37:31 CEST
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.
Comment 3 Olivier Fourdan editbugs 2008-09-25 12:42:46 CEST
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.
Comment 4 Brian J. Tarricone (not reading bugmail) 2008-09-25 20:11:58 CEST
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?
Comment 5 Olivier Fourdan editbugs 2008-09-26 10:57:40 CEST
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);
Comment 6 Brian J. Tarricone (not reading bugmail) 2008-10-07 11:18:58 CEST
Hmm, it looks like my signal prototype detection is off... dammit.
Comment 7 Brian J. Tarricone (not reading bugmail) 2008-11-27 02:51:10 CET
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?
Comment 8 Olivier Fourdan editbugs 2008-11-28 11:22:09 CET
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>
Comment 9 Brian J. Tarricone (not reading bugmail) 2009-03-21 18:44:51 CET
*** Bug 4649 has been marked as a duplicate of this bug. ***
Comment 10 Brian J. Tarricone (not reading bugmail) 2009-08-22 09:45:16 CEST

*** This bug has been marked as a duplicate of bug 5048 ***
Comment 11 Brian J. Tarricone (not reading bugmail) 2009-08-22 09:45:44 CEST
God dammit.  Backwards.
Comment 12 Brian J. Tarricone (not reading bugmail) 2009-08-22 09:46:08 CEST
*** Bug 5048 has been marked as a duplicate of this bug. ***
Comment 13 Eric Koegel editbugs 2014-03-19 18:48:41 CET
With no complaints from xfdesktop 4.10 for this,
marking resolved.

Bug #4395

Reported by:
Olivier Fourdan
Reported on: 2008-09-17
Last modified on: 2014-03-19
Duplicates (2):

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
3 users

Version

Attachments

Additional information