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 765058 - Do not skip CoglError parameters
Do not skip CoglError parameters
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 762038 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-04-14 14:48 UTC by Florian Müllner
Modified: 2016-04-21 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cursor: Do not try to unref NULL CoglObject (974 bytes, patch)
2016-04-14 14:48 UTC, Florian Müllner
none Details | Review
Do not skip CoglError parameters (9.95 KB, patch)
2016-04-14 14:48 UTC, Florian Müllner
none Details | Review
Do not skip CoglError parameters (10.13 KB, patch)
2016-04-14 15:25 UTC, Florian Müllner
committed Details | Review
Do not try to unref NULL CoglObjects (1.47 KB, patch)
2016-04-15 15:22 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2016-04-14 14:48:05 UTC
See patch.
Comment 1 Florian Müllner 2016-04-14 14:48:09 UTC
Created attachment 326011 [details] [review]
cursor: Do not try to unref NULL CoglObject
Comment 2 Florian Müllner 2016-04-14 14:48:14 UTC
Created attachment 326012 [details] [review]
Do not skip CoglError parameters

While CoglError is a define to GError, it doesn't follow the convention
of ignoring errors when NULL is passed, but rather treats the error as
fatal :-(
That's clearly unwanted for a compositor, so make sure to always pass
an error parameter where a runtime error is possible (i.e. any CoglError
that is not a malformed blend string).
Comment 3 Florian Müllner 2016-04-14 15:25:13 UTC
Created attachment 326013 [details] [review]
Do not skip CoglError parameters

Missed one bit ...
Comment 4 Rui Matos 2016-04-15 15:15:18 UTC
Review of attachment 326013 [details] [review]:

seems fine, I think the comment below should be addressed on the other patch

::: src/compositor/meta-surface-actor-x11.c
@@ +125,1 @@
+  if (error != NULL)

All the other cases seem fine, but this one in particular, if it fails, will leave priv->texture == NULL which will crash calling cogl_object_unref() on it in detach_pixmap()
Comment 5 Florian Müllner 2016-04-15 15:22:59 UTC
Created attachment 326112 [details] [review]
Do not try to unref NULL CoglObjects

Ah yes, thanks for the catch!
Comment 6 Rui Matos 2016-04-15 15:44:06 UTC
Review of attachment 326112 [details] [review]:

lgtm
Comment 7 Florian Müllner 2016-04-15 15:51:11 UTC
Attachment 326013 [details] pushed as 8842bdf - Do not skip CoglError parameters
Attachment 326112 [details] pushed as bdc72dd - Do not try to unref NULL CoglObjects
Comment 8 Ray Strode [halfline] 2016-04-15 19:44:21 UTC
*** Bug 762038 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Buslowicz 2016-04-15 21:31:33 UTC
Any chance this ends up in 3.18 as well?
Comment 10 Florian Müllner 2016-04-21 11:00:44 UTC
I still had a 3.18 release pending to push out a fix for a regression in the previous version, and I've included those patches now.