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 762639 - shaped-texture: Invalidate mask texture when main texture changes size
shaped-texture: Invalidate mask texture when main texture changes size
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 763458 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-02-24 18:53 UTC by Rui Matos
Modified: 2016-03-10 15:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shaped-texture: Invalidate mask texture when main texture changes size (1.34 KB, patch)
2016-02-24 18:53 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2016-02-24 18:53:51 UTC
Trying to reproduce bug 762618 I got this crash instead:

0  0x00007f5dc2163501 in cogl_texture_get_height (texture=0x0) at cogl-texture.c:216
1  0x00007f5dc6b40379 in meta_shaped_texture_get_image (stex=0x2c4a380, clip=0x7ffe26462e60) at compositor/meta-shaped-texture.c:869
2  0x00007f5dcac448ce in shell_util_get_content_for_window_actor (window_actor=0x2c48400, window_rect=0x22348c0) at shell-util.c:448
3  0x00007f5dbe0e7d30 in ffi_call_unix64 () from /lib64/libffi.so.6
4  0x00007f5dbe0e779b in ffi_call () from /lib64/libffi.so.6
5  0x00007f5dc996b7cb in ?? () from /lib64/libgjs.so.0
6  0x00007f5dc996ccc5 in ?? () from /lib64/libgjs.so.0
7  0x00007f5dc929625c in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) () from /lib64/libmozjs-24.so
8  0x00007f5dc929662b in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) () from /lib64/libmozjs-24.so
9  0x00007f5dc94f0d0d in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) () from /lib64/libmozjs-24.so
10 0x00007f5dcb14aaa2 in ?? ()
11 0x0000000000000000 in ?? ()
Comment 1 Rui Matos 2016-02-24 18:53:56 UTC
Created attachment 322276 [details] [review]
shaped-texture: Invalidate mask texture when main texture changes size

We currently rely only on MetaWindowActor to update the mask
texture. This isn't good enough since we might get asked to use the
mask (e.g. via meta_shaped_texture_get_image() ) after having a new
texture size but before MetaWindowActor decides to update the the mask
in which case we might crash since cogl_texture_new_from_sub_texture()
might fail with an early return such as

Cogl-CRITICAL **: cogl_sub_texture_new: assertion 'sub_x + sub_width
<= next_width' failed
Comment 2 Rui Matos 2016-03-10 13:10:31 UTC
*** Bug 763458 has been marked as a duplicate of this bug. ***
Comment 3 Jonas Ådahl 2016-03-10 13:22:22 UTC
Review of attachment 322276 [details] [review]:

Seems reasonable. I suppose the mask texture will be regenerated before the next time the window is painted.
Comment 4 Olivier Fourdan 2016-03-10 13:24:20 UTC
Yeap, attachment 322276 [details] [review] fixes the issue for me as well! Thanks!
Comment 5 Rui Matos 2016-03-10 15:16:44 UTC
Attachment 322276 [details] pushed as ca1b438 - shaped-texture: Invalidate mask texture when main texture changes size