Bug 496054 - crash when using a single workspace
crash when using a single workspace
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-11-12 04:46 UTC by Matthias Clasen
Modified: 2007-12-09 23:12 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (679 bytes, patch)
2007-11-12 04:47 UTC, Matthias Clasen
committed Details | Diff | Review

Description Matthias Clasen 2007-11-12 04:46:39 UTC
When the number of workspaces is 1, bringing up the window menu leads to a crash
in meta_window_menu_new, when attaching an item for MENU_ITEM_WORKSPACE_LIST
Comment 1 Matthias Clasen 2007-11-12 04:47:07 UTC
Created attachment 98955 [details] [review]
the patch
Comment 2 Thomas Thurman 2007-11-12 05:19:08 UTC
Can you confirm this is a problem in trunk, please? I can't reproduce it.
Comment 3 Thomas Thurman 2007-11-13 03:53:31 UTC
(Patch is good if the problem exists, but I can't reproduce it.)
Comment 4 Matthias Clasen 2007-11-13 04:08:27 UTC
i've only see this actually cause crashes when running the new gdm's login screen under metacity, inside a full session I have only seen g_criticals due to this. But it is clear from the code that you can reach that place in the function with mi being NULL.
Comment 5 Thomas Thurman 2007-11-13 05:06:16 UTC
I'm sorry if I'm being slow, but I don't see how it's clear that mi can be NULL at that point. mi is initialised to the result of menu_item_new (). This can only be NULL if menuitem->type is MENU_ITEM_WORKSPACE_LIST, whereupon mi is reassigned to the result of menu_item_new () given a MENU_ITEM_NORMAL! So how can mi be NULL at the end of the function?

Nevertheless, I can't see it can do much harm to program defensively and check whether mi is null if we're going to pass it places.
Comment 6 Thomas Thurman 2007-12-09 23:12:31 UTC
okay, committed.

Note You need to log in before you can comment on or make changes to this bug.