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 753081 - applemedia/avsample: Cleanup of CA layer is racy and crashes occasionally
applemedia/avsample: Cleanup of CA layer is racy and crashes occasionally
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-30 21:43 UTC by Heinrich Fink
Modified: 2015-08-16 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
applemedia/avsample: Fix racy cleanup of CA layer (1.37 KB, patch)
2015-07-30 21:43 UTC, Heinrich Fink
committed Details | Review

Description Heinrich Fink 2015-07-30 21:43:55 UTC
Created attachment 308498 [details] [review]
applemedia/avsample: Fix racy cleanup of CA layer

The block that is dispatched async to the main thread assumed the wrapping GstAvSampleVideoSink to be alive. However, at the time of the block execution the GstObject instance that is deferenced to access the CA layer might already be freed, which caused occasional crashes. Instead, we now only pass the CoreAnimation layer that needs to be released to the block. We use __block to make sure the block is not increasing the refcount of the CA layer again on its own.

patch for above fix is attached
Comment 1 Matthew Waters (ystreet00) 2015-07-31 03:00:13 UTC
Thanks!

commit 0cc6d16c94d0e5ab09167b3a8d03ed0531c8f795
Author: Heinrich Fink <hfink@toolsonair.com>
Date:   Thu Jul 30 23:31:21 2015 +0200

    applemedia/avsample: Fix racy cleanup of CA layer
    
    The block that is dispatched async to the main thread assumed the
    wrapping GstAvSampleVideoSink to be alive. However, at the time of
    the block execution the GstObject instance that is deferenced to access
    the CA layer might already be freed, which caused occasional crashes.
    Instead, we now only pass the CoreAnimation layer that needs to be
    released to the block. We use __block to make sure the block is not
    increasing the refcount of the CA layer again on its own.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753081