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 728064 - New AtlasTextures should keep designated atlas alive
New AtlasTextures should keep designated atlas alive
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: CoglTexture
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
: 719551 729868 731870 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-04-11 22:25 UTC by Felix Riemann
Modified: 2014-06-18 17:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.89 KB, patch)
2014-04-11 22:33 UTC, Felix Riemann
none Details | Review

Description Felix Riemann 2014-04-11 22:25:22 UTC
This is my first time with cogl, so sorry if I'm on the wrong track. I spotted this while debugging a crash I got with the current totem release (bug 727369) which hinted to some ref-counting problem in cogl with some criticals.

When a new CoglAtlasTexture is created it tries to find an existing atlas it fits into. This causes a reorganization of the atlas if it's too small. However, the texture does only increase the refcount on the atlas after the reorganization. Now if the only other texture in the atlas gets freed in that reorganization step as in my case (the texture was held by a pipeline layer that get flushed by the blitting step) the new texture will try to use a no longer existing atlas afterwards.
Comment 1 Felix Riemann 2014-04-11 22:33:38 UTC
Created attachment 274139 [details] [review]
proposed fix

This patch makes the texture keep the atlas alive while it expands. This fixed my problems with totem.

It has one drawback though. If the described scenario occurs (one texture replacing another with the same size) the resulting atlas is likely larger than necessary.
Comment 2 Ross Lagerwall 2014-05-04 20:34:15 UTC
While I can't say whether the patch is correct or not, it fixes the issue for me so it would be good if this could be looked at (hint hint :-) ).
Comment 3 Ross Lagerwall 2014-05-04 20:35:11 UTC
Looks to be the same as bug 719551.
Comment 4 Bastien Nocera 2014-05-09 13:48:40 UTC
*** Bug 719551 has been marked as a duplicate of this bug. ***
Comment 5 Bastien Nocera 2014-05-09 13:49:00 UTC
*** Bug 729868 has been marked as a duplicate of this bug. ***
Comment 6 Neil Roberts 2014-05-19 11:55:03 UTC
Thanks for the detailed bug report and patch. I think this is a good fix so I've pushed it to the master and 1.18 branches with some small changes to the comments.

https://git.gnome.org/browse/cogl/commit/?id=2eec9758f67e9073371c2edd6337

I've also posted a patch for a test case to the mailing list:

http://lists.freedesktop.org/archives/cogl/2014-May/001662.html
Comment 7 Bastien Nocera 2014-06-18 17:46:08 UTC
*** Bug 731870 has been marked as a duplicate of this bug. ***