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 604091 - tee: cleanup requestpads in dispose
tee: cleanup requestpads in dispose
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-08 16:31 UTC by Håvard Graff (hgr)
Modified: 2009-12-09 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.91 KB, patch)
2009-12-08 16:33 UTC, Håvard Graff (hgr)
none Details | Review

Description Håvard Graff (hgr) 2009-12-08 16:31:25 UTC
There is a race in gst_tee_buffer_alloc(), where you can dispose the tee, and the allocpad will no longer be valid.

By making sure the tee's own release_pad () is called, this marinal window of error is closed :)
Comment 1 Håvard Graff (hgr) 2009-12-08 16:33:08 UTC
Created attachment 149351 [details] [review]
patch
Comment 2 Sebastian Dröge (slomo) 2009-12-09 06:34:42 UTC
Hm, the releasing of pads should probably be done in READY->NULL already, not when disposing the object completely. Not sure...

And then gst_tee_buffer_alloc() should call gst_pad_get_parent() instead of GST_PAD_PARENT() to make sure that it owns a reference to the parent.
Comment 3 Håvard Graff (hgr) 2009-12-09 08:51:39 UTC
I don't think releasing pads should be done in NULL, you are allowed to set your connected pipeline to NULL, and then bring it back to PLAYING and still have all connectivity intact, I think.
Comment 4 Sebastian Dröge (slomo) 2009-12-09 09:02:31 UTC
Yes, you're right... I guess the patch is good then but doesn't fix this problem in all cases. gst_tee_buffer_alloc() should be made threadsafe
Comment 5 Wim Taymans 2009-12-09 12:01:42 UTC
I was wondering if we couldn't call the release_pad function from the element _dispose function. We could probably follow the oadtemplate and see if this was a request pad and then release it.
Comment 6 Wim Taymans 2009-12-09 12:34:05 UTC
Releasing the pads in gstelement dispose does not work. Some elements (adder) have already executed their dispose method before chaining up and then the datastructures needed to execute the _release are not there anymore.

It looks like we need to add a manual release in all elements.

commit 494495eae6a7892397deace4557d668f742f5822
Author: Havard Graff <havard.graff@tandberg.com>
Date:   Tue Dec 8 17:21:47 2009 +0100

    tee: release pads in dispose
    
    Make sure to release all request-pads in the dispose-method, in case of a
    shutdown-race, where a pad-alloc is about to happen.
    
    Fixes #604091