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 385380 - gnome-panel crashes to get_workspace_rect
gnome-panel crashes to get_workspace_rect
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: pager
2.20.x
Other Linux
: Normal critical
: ---
Assigned To: libwnck maintainers
libwnck maintainers
: 395044 492527 495463 496247 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-13 09:30 UTC by Sebastien Bacher
Modified: 2018-01-24 13:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Sebastien Bacher 2006-12-13 09:30:31 UTC
That bug has been opened on https://launchpad.net/bugs/75529

"Crashed on start of gnome. Will attach dump.
...
http://librarian.launchpad.net/5373955/_usr_bin_gnome-panel.1001.crash
crash report
...
 libwnck18 2.16.1-0ubuntu1
...
 Core was generated by `gnome-panel --sm-config-prefix /gnome-panel-1yghQV/ --sm-client-id 110a4b160100'.
 Program terminated with signal 8, Arithmetic exception.
...
crash report"

Debug backtrace from gdb:

586           rect->width = (hsize - (spaces_per_row - 1)) / spaces_per_row;
(gdb) bt
  • #0 get_workspace_rect
    at pager.c line 586
  • #1 wnck_pager_queue_draw_workspace
    at pager.c line 1205
  • #2 IA__g_cclosure_marshal_VOID__BOOLEAN
    at gmarshal.c line 89
  • #3 IA__g_closure_invoke
    at gclosure.c line 469
  • #4 signal_emit_unlocked_R
    at gsignal.c line 2456
  • #5 IA__g_signal_emit_valist
    at gsignal.c line 352
  • #6 IA__g_signal_emit_valist
    at gsignal.c line 2186
  • #7 _wnck_window_process_configure_notify
    at window.c line 2504
  • #8 filter_func
    at xutils.c line 737
  • #9 gdk_event_apply_filters
    at gdkevents-x11.c line 345
  • #10 gdk_event_translate
    at gdkevents-x11.c line 894
  • #11 _gdk_events_queue
    at gdkevents-x11.c line 2254
  • #12 gdk_event_dispatch
    at gdkevents-x11.c line 2314
  • #13 IA__g_main_context_dispatch
    at gmain.c line 2599
  • #14 g_main_context_iterate
    at gmain.c line 2643
  • #15 IA__g_main_loop_run
    at gmain.c line 2873
  • #16 IA__gtk_main
    at gtkmain.c line 1024
  • #17 main
    at main.c line 95

Comment 1 Vincent Untz 2007-02-17 10:38:28 UTC
The only reason why this would happen is because n_spaces < 1. This could be because the screen is not valid or because there's no workspace.

Elijah, I see nowhere in the wm spec that _NET_NUMBER_OF_DESKTOPS must be at least 1.
Comment 2 Vincent Untz 2007-02-17 10:49:16 UTC
It's not cleat to me what's the best way to fix this:

 + should we just do "n_spaces = MAX (1, wnck_screen_get_workspace_count (pager->priv->screen));" ?

 + should we assert on this?

 + should we gracefully return of this function without doing anything?

 + should we check that the screen is a valid screen (I can't think why it wouldn't be one, but it's always safer to check)?
Comment 3 Vincent Untz 2007-02-17 11:24:45 UTC
*** Bug 395044 has been marked as a duplicate of this bug. ***
Comment 4 Elijah Newren 2007-02-17 20:45:17 UTC
True, it isn't mandated by the EWMH but it is pretty much assumed; one statement that almost implies it is the statement about the current desktop: "This is always an integer between 0 and _NET_NUMBER_OF_DESKTOPS - 1".

I'm not sure what the fix is, but we should really find out why there were only 0 (or less) total desktops.  Is there any chance compiz or beryl (or another WM) were in use and that they cause this bug?
Comment 5 Brian J. Murrell 2007-03-12 15:23:39 UTC
Well, in my most recent gnome start-up (just a few moments ago) I got this same issue again and I can tell you that, at least visually, on my panels, I have 4 workspaces on each screen.

Is there some kind of configuration probe I can do to help you out?
Comment 6 Vincent Untz 2007-04-29 17:57:18 UTC
Seems to be only happening at the start of GNOME. It's probably a race condition: we receive an event and we process it, but we didn't get the information about the screen yet.

Based on the stack trace, here's what I believe is happening:

 + GNOME starts
 + pager is created
 + we get a screen for it, but we didn't fetch the information about it
 + we connect to the screen with wnck_pager_connect_screen()
 + for all windows, we do wnck_pager_connect_window() (this means "listen to a lot of signals related to this window")
 + geometry of a window is changed
 + we get the event
 + it goes to _wnck_window_process_configure_notify()
 + this function emits a geometry_changed signal
 + this causes window_geometry_changed_callback() to be called
 + this calls wnck_pager_queue_draw_window()
 + which calls wnck_pager_queue_draw_workspace()
 + which calls get_workspace_rect()
 + which tries to get the number of workspaces in the screen, but we didn't have time to fetch this information

There's just a small problem with all this: to successfully call wnck_pager_connect_window(), we need to have a list of windows in the screen. This is done in do_update_now(), which is exactly the call that fetches the information about the screen. So we should have it.

Still looks like a race condition, though.
Comment 7 Vincent Untz 2007-06-18 10:32:10 UTC
gnome-bugs@interlinx.bc.ca: I'd love to know which window manager you were using when this happened. Was it metacity, compiz/beryl or something else? If you don't remember, do you remember the window managers you have used in the past few months?

It sounds to me like this could happen if _NET_NUMBER_OF_DESKTOPS isn't set. Which happens when there's no ewmh-compliant WM running.
Comment 8 Vincent Untz 2007-06-18 10:33:48 UTC
Btw, a possible fix would be to default to having one workspace when we can't get this information, since there's at least always one workspace.
Comment 9 Brian J. Murrell 2007-06-18 11:02:06 UTC
(In reply to comment #7)
> gnome-bugs@interlinx.bc.ca: I'd love to know which window manager you were
> using when this happened.

Always metacity.

Comment 10 Vincent Untz 2007-06-18 11:03:18 UTC
(In reply to comment #8)
> Btw, a possible fix would be to default to having one workspace when we can't
> get this information, since there's at least always one workspace.

I've done this in trunk.
Comment 11 Vincent Untz 2007-06-18 15:38:00 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > gnome-bugs@interlinx.bc.ca: I'd love to know which window manager you were
> > using when this happened.
> 
> Always metacity.

How many workspaces did you have, how many rows in the workspace switcher did you have?

Also, were you able to reproduce the crash? Or did it happen only once?
Comment 12 Vincent Untz 2007-06-29 19:20:13 UTC
gnome-bugs@interlinx.bc.ca: I'd love to know if this only happend in 2.16, or if it also happened with 2.18. Also, was it always when the panel was starting? And did it happen many times or just once or twice?
Comment 13 Brian J. Murrell 2007-07-04 11:56:11 UTC
(In reply to comment #12)
> gnome-bugs@interlinx.bc.ca: I'd love to know if this only happend in 2.16, or
> if it also happened with 2.18.

Hrm.  I dunno TBH.  I'm tracking Ubuntu devel pretty close to daily.  Maybe a Ubuntu person could correlate the date of the bug with what was in the devel branch.

> Also, was it always when the panel was starting?
> And did it happen many times or just once or twice?

Hrm.  There have been so many bugs lately with the panel an libwnck and applets that I'm really not sure any more.  :-(
Comment 14 Vincent Untz 2007-07-04 12:08:55 UTC
Thanks.

While we don't know the root problem of this, I believe the change made in comment #10 fixes the crash. It might be that the number of workspaces was not set on one screen (since you're running a multihead setup).

I'll mark the bug as NEEDINFO for now, so we can keep an eye on it and because I'd like to know if this can happen with libwnck >= 2.19.4, but I think we'll close the bug in the end.

Don't hesitate to reopen the bug if you have any news!
Comment 15 Sebastien Bacher 2007-07-05 16:23:14 UTC
the ubuntu submitter seems to not have the bug on gutsy
Comment 16 Vincent Untz 2007-07-05 16:49:32 UTC
Ok, let's close the bug for now and reopen it if someone can see it again with 2.19.4 or later.
Comment 17 Sebastien Bacher 2007-10-01 14:15:26 UTC
https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/147466 looks somewhat similar, reopening

"#0  0x00002b97d94e2667 in get_workspace_rect (pager=0xa3e1c0, space=4, rect=0x7fffdea96de0) at pager.c:620
	hsize = -22317
	vsize = -22317
	n_spaces = <value optimized out>
	widget = (GtkWidget *) 0xa3e1c0
	col = <value optimized out>
	focus_width = 11159
	__PRETTY_FUNCTION__ = "get_workspace_rect"
  • #1 wnck_pager_queue_draw_workspace
    at pager.c line 1388
  • #2 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.14.1/gobject/gclosure.c line 490
  • #3 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.14.1/gobject/gsignal.c line 2440
  • #4 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.14.1/gobject/gsignal.c line 2199
  • #5 IA__g_signal_emit
    at /build/buildd/glib2.0-2.14.1/gobject/gsignal.c line 2243
  • #6 do_update_now
    at screen.c line 2391
  • #7 update_idle
    at screen.c line 2338
  • #8 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.14.1/glib/gmain.c line 2061
  • #9 g_main_context_iterate
    at /build/buildd/glib2.0-2.14.1/glib/gmain.c line 2694
  • #10 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.14.1/glib/gmain.c line 2898

Comment 18 Vincent Untz 2007-10-10 08:43:26 UTC
i=1 and then space=4 doesn't make a lot of sense.
I've asked questions on launchpad about the wm and a possible multihead setup, to help with blind guessing. Marking as NEEDINFO for now.

Bugsquad: don't close the bug, and please reopen if there are new duplicates (version >= 2.20.0).
Comment 19 Vincent Untz 2007-11-13 07:24:02 UTC
*** Bug 496247 has been marked as a duplicate of this bug. ***
Comment 20 Vincent Untz 2007-11-13 07:24:49 UTC
Duplicate is happening with 2.20.1...
Comment 21 Vincent Untz 2007-11-13 08:43:13 UTC
*** Bug 492527 has been marked as a duplicate of this bug. ***
Comment 22 Vincent Untz 2007-11-13 08:43:21 UTC
*** Bug 495463 has been marked as a duplicate of this bug. ***
Comment 23 Akhil Laddha 2010-12-28 04:48:42 UTC
Is this bug still valid in GNOME 2.30.2 or GNOME 2.32.1 ?
Comment 24 GNOME Infrastructure Team 2018-01-24 13:38:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libwnck/issues/76.