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 569682 - playbin2 leaks request pad from input selector
playbin2 leaks request pad from input selector
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: Michael Smith
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-29 14:53 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2009-04-14 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stefan Sauer (gstreamer, gtkdoc dev) 2009-01-29 14:53:47 UTC
valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=30 --suppressions=../gstreamer/common/gst.supp -v gst-launch-0.10 playbin2 uri=file:///home/ensonic/audio/sample.wav

(same with mp3 or such)

==27135== 506 (300 direct, 206 indirect) bytes in 1 blocks are definitely lost in loss record 5,377 of 5,483
==27135==    at 0x4025D2E: malloc (vg_replace_malloc.c:207)
==27135==    by 0x41B3D63: g_malloc (gmem.c:131)
==27135==    by 0x41CA8E2: g_slice_alloc (gslice.c:824)
==27135==    by 0x41CAC14: g_slice_alloc0 (gslice.c:833)
==27135==    by 0x4154E0A: g_type_create_instance (gtype.c:1654)
==27135==    by 0x41393D4: g_object_constructor (gobject.c:1334)
==27135==    by 0x4139C05: g_object_newv (gobject.c:1211)
==27135==    by 0x413A801: g_object_new_valist (gobject.c:1315)
==27135==    by 0x413A94D: g_object_new (gobject.c:1056)
==27135==    by 0x4C9A26D: gst_input_selector_request_new_pad (gstinputselector.c:1217)
==27135==    by 0x4087B2D: gst_element_get_request_pad (gstelement.c:902)
==27135==    by 0x47E0446: pad_added_cb (gstplaybin2.c:1726)
==27135==    by 0x41408DB: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:636)
==27135==    by 0x4133C4A: g_closure_invoke (gclosure.c:767)
==27135==    by 0x414A094: signal_emit_unlocked_R (gsignal.c:3244)
==27135==    by 0x414B7AB: g_signal_emit_valist (gsignal.c:2977)
==27135==    by 0x414BC25: g_signal_emit (gsignal.c:3034)
==27135==    by 0x408875B: gst_element_add_pad (gstelement.c:685)
==27135==    by 0x4808215: new_decoded_pad_cb (gsturidecodebin.c:685)
==27135==    by 0x480CF42: gst_play_marshal_VOID__OBJECT_BOOLEAN (gstplay-marshal.c:207)
==27135==    by 0x4133C4A: g_closure_invoke (gclosure.c:767)
==27135==    by 0x414A094: signal_emit_unlocked_R (gsignal.c:3244)
==27135==    by 0x414B7AB: g_signal_emit_valist (gsignal.c:2977)
==27135==    by 0x414BC25: g_signal_emit (gsignal.c:3034)
==27135==    by 0x48011D7: gst_decode_group_expose (gstdecodebin2.c:2047)
==27135==    by 0x4801944: gst_decode_group_check_if_blocked (gstdecodebin2.c:1850)
==27135==    by 0x4801C01: source_pad_blocked_cb (gstdecodebin2.c:2278)
==27135==    by 0x409AD8C: handle_pad_block (gstpad.c:3740)
==27135==    by 0x409CE2E: gst_pad_push_event (gstpad.c:4467)
==27135==    by 0x4091FEC: gst_proxy_pad_do_event (gstghostpad.c:126)
Comment 1 Michael Smith 2009-01-30 02:19:09 UTC
Taking. There are actually a whole lot of refcount leaks around here.

Will have a patch (preliminary, at least) tomorrow.
Comment 2 Michael Smith 2009-01-31 02:33:07 UTC
Fixed all the leaks I could find with this command and simple gapless playback of 2 or 3 files using test7.

Pushed the following to git:

gst-plugins-bad: 
commit 6a0a9fc01e2aec4020b8f35b4a4ce5df8e60e9d7
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 18:27:03 2009 -0800

    Unref event if we don't forward it, unref pads when done with them.


gst-plugins-base: 
commit b36d8f3e119f9edc5993c08025614ee32642972e
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 17:48:23 2009 -0800

    Remove pad-removed handlers after setting the decodebins to NULL.
    
    They do needed cleanup; without this we leak selector requestpads.

commit 61e81ada2c9eb5d4bfb12e4e2997be790650ced3
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 17:47:07 2009 -0800

    Unref selector request pad even if we no longer have a selector.
    
    During destruction, we won't have a selector any more, but we still need
    to unref the pad to avoid leaking it.

commit c799f3f77f7a06d6a7c02e03d9d2d86610a94134
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 15:23:23 2009 -0800

    Unref source in playbin2's finalize method

commit b6cbe7e3315d49313b7e7098f27dc0a895e96dc1
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 12:04:01 2009 -0800

    Fix more leaks of pads and elements in gstplaysink.
    
    Don't keep extra references to volume and mute elements; we don't need
    to do so.
    Ensure we unref pads that we have references to, and release request
    pads.

commit c34f4441747bfe9bbf7abbfd6c821b1b17f2a070
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 11:04:37 2009 -0800

    Avoid leaking all playsinks. Fix some internal leaks.
    
    Playsink was holding references to itself. Don't do that, it's not cool.
    Also, free all chains in dispose.

commit 906502b9bba200697173da369acac45aaa2e0e75
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 10:54:12 2009 -0800

    Unref peer request pad after releasing it, since we hold a reference.

commit af8d3c51f08ebd9d7d30bbdfcdf6bedf1d046ec3
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 10:52:52 2009 -0800

    Fix caps leak in playbin2.

commit ef1fa84575b06db3b079c5955efc57ac0a4a583b
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 10:51:11 2009 -0800

    Unref active pad from selector when finding active stream.

commit f7abf8ed943949de4f012626967b94f07fe5e893
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 10:49:55 2009 -0800

    Free uris when finalizing playbin2 instance.

commit a2b0229058c86c008f5918706e69f5a44d65474e
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 10:38:17 2009 -0800

    Unref pads when iterating over them in analyse_source.
    
    Fixes leak of source's srcpad when using uridecodebin.

Comment 3 Michael Smith 2009-02-11 04:47:16 UTC
Reverted this as it was causing deadlocks.

Reopening.

commit b36d8f3e119f9edc5993c08025614ee32642972e
Author: Michael Smith <msmith@songbirdnest.com>
Date:   Fri Jan 30 17:48:23 2009 -0800

    Remove pad-removed handlers after setting the decodebins to NULL.

    They do needed cleanup; without this we leak selector requestpads.
Comment 4 Wim Taymans 2009-04-14 11:33:16 UTC
I think this is fixed now, I don't see the leaks anymore. Reopen if you still see them.