GNOME Bugzilla – Bug 635421
Fix crash in check_needs_shadow
Last modified: 2010-11-21 18:59:10 UTC
Backtrace: --------- Program received signal SIGSEGV, Segmentation fault. *INT_cairo_region_get_extents (region=0x0, extents=0x7fff0d74f1e0) at cairo-region.c:457 457 if (region->status) { (gdb) bt
+ Trace 224767
(See patch for details)
Created attachment 174946 [details] [review] [MetaWindowActor] Fix crash in shadow shape creation check_needs_shadow passes the shape_region to meta_window_shape_new for shaped windows, which can be NULL for short lived windows, and thus causing a crash. Fix that by falling back to the bounding_region in that case.
Review of attachment 174946 [details] [review]: This looks basically good to me - it's presumably the same case as fixed by: http://bugzilla-attachments.gnome.org/attachment.cgi?id=174298 (which was squashed into a different patch before pushing the branch), where if the window is destroyed before we fetch it's shape, window->shape_region ends up as null. When I did that patch, I wasn't fully convinced that bounding_region would never be NULL under any circumstances, so I made it defensive against that as well. Can you do the same here? I'd do it with something lke: if (priv->shadow_shape == NULL) { if (priv->shaped && priv->shape_region) priv->shadow_shape = meta_window_shape_new (priv->shape_region); else if (priv->bounding_region) priv->shadow_shape = meta_window_shape_new (priv->bounding_region); } if (priv->shadow_shape != NULL) { /* variables moved from above into inner block where they are used */ /* recomputation of shadow */ }
Created attachment 174975 [details] [review] [MetaWindowActor] Fix crash in shadow shape creation Protect against shape_region or bounding_region being NULL in check_needs_shadow. This can happen for short lived windows and result into a crash.
Review of attachment 174975 [details] [review]: Looks good