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 599988 - Toplevel with TYPE_HINT_NOTIFICATION causes crash
Toplevel with TYPE_HINT_NOTIFICATION causes crash
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
2.28.x
Other Linux
: Normal major
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-29 04:53 UTC by Grahame Bowland
Modified: 2011-10-17 19:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
untested patch (1.11 KB, patch)
2011-09-04 16:03 UTC, Matthias Clasen
rejected Details | Review
window.c: use a consistent mapping from frame_type => decorated (1.27 KB, patch)
2011-10-17 15:58 UTC, Owen Taylor
committed Details | Review

Description Grahame Bowland 2009-10-29 04:53:11 UTC
This simple pygtk program will crash mutter:

--
#!/usr/bin/env python

import gtk

w = gtk.Window()
w.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_NOTIFICATION)
w.show_all()
gtk.main()
--

The crash is:

Window manager warning: Log level 8: meta_theme_get_frame_style: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 8: meta_theme_get_title_scale: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 8: meta_theme_calc_geometry: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 8: meta_frames_get_geometry: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 8: meta_theme_get_frame_style: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 8: meta_theme_calc_geometry: assertion `type < META_FRAME_TYPE_LAST' failed
Window manager warning: Log level 16: Native children wider or taller than 65535 pixels are not supported
Window manager warning: Log level 8: meta_theme_get_frame_style: assertion `type < META_FRAME_TYPE_LAST' failed
[1]    14858 segmentation fault  mutter --replace
Comment 1 Matthias Clasen 2011-09-04 16:03:14 UTC
Created attachment 195629 [details] [review]
untested patch
Comment 2 Colin Walters 2011-09-05 21:39:26 UTC
Seems like an ugly fix - if the assertion here is that windows of type NOTIFICATION can't have frames, we should just treat it as if the user had specified no decorations; look at window.c:recalc_window_features() for similar.
Comment 3 Matthias Clasen 2011-09-06 16:58:29 UTC
The problem here is that we get FRAME_TYPE_LAST even though frame_exists is set to TRUE, and then get_frame_style does not return a style for FRAME_TYPE_LAST. And the later code assumes that when frame_exist is TRUE, style will be non-NULL.

It is a local problem in this function, and my patch fixes the crash that is a consequence. 

I don't know if it is ugly or not. If it is, somebody who knows mutter code better will have to come up with a less ugly fix.
Comment 4 Owen Taylor 2011-10-17 15:43:14 UTC
Review of attachment 195629 [details] [review]:

The problem here seems to be that the idea of "what types are decorated" is out of sync between recalc_window_features() and meta_window_get_frame_type() - so we get this case where META_CORE_WINDOW_HAS_FRAME => true, and META_CORE_GET_FRAME_TYPE => FRAME_TYPE_LAST. Think there's an easy fix to make recalc_window_features() just call meta_window_get_frame_type() to avoid duplicate bits of code that have to be in sync.
Comment 5 Owen Taylor 2011-10-17 15:58:11 UTC
Created attachment 199224 [details] [review]
window.c: use a consistent mapping from frame_type => decorated

If a window had a type hint intended for override-redirect windows
like NOTIFICATION, we ended up with a window that was decorated but
with a frame type of FRAME_TYPE_LAST, causing assertion failures.
Fix this by making recalc_window_features() just call
meta_window_get_frame_type().
Comment 6 Owen Taylor 2011-10-17 19:10:59 UTC
Attachment 199224 [details] pushed as f94f008 - window.c: use a consistent mapping from frame_type => decorated