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 528245 - rtpbin element leaks
rtpbin element leaks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.7
Other Linux
: Normal blocker
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-15 16:07 UTC by Wim Taymans
Modified: 2008-04-22 08:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix some leaks (3.24 KB, patch)
2008-04-15 16:09 UTC, Wim Taymans
committed Details | Review
patch for one more leak (539 bytes, patch)
2008-04-17 23:34 UTC, Olivier Crête
none Details | Review
More leak fixes (6.58 KB, patch)
2008-04-18 19:47 UTC, Olivier Crête
committed Details | Review

Description Wim Taymans 2008-04-15 16:07:48 UTC
g_signal_emitv() requires the passed in GValues to be cleared with g_value_unset after usage.
Comment 1 Wim Taymans 2008-04-15 16:09:32 UTC
Created attachment 109313 [details] [review]
patch to fix some leaks

This patch 
- unsets the GValues used for emitv
- unref a leaked pad name
Comment 2 Wim Taymans 2008-04-17 07:32:11 UTC
        * gst/rtpmanager/gstrtpbin.c: (get_pt_map), (free_client),
        (gst_rtp_bin_associate), (gst_rtp_bin_get_free_pad_name):
        * gst/rtpmanager/gstrtpjitterbuffer.c:
        (gst_rtp_jitter_buffer_get_clock_rate):
        * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_get_caps):
        * gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_clock_rate):
        Unset GValues after g_signal_emitv so that we avoid a refcount leak.
        Don't leak a padname.
        Don't leak client streams list.
        Lock rtpbin when associating streams. Fixes #528245.
Comment 3 Olivier Crête 2008-04-17 23:34:34 UTC
Created attachment 109460 [details] [review]
patch for one more leak

This fixes a leak of a ref to the jb.
Comment 4 Olivier Crête 2008-04-17 23:35:40 UTC
It still leaks (re-using bug).. I'll try to run my farsight2 tests through valgrind again to see if I can still see any leaks.
Comment 5 Olivier Crête 2008-04-18 19:47:50 UTC
Created attachment 109504 [details] [review]
More leak fixes

With this patch, I can run all of the farsight2 unit tests in valgrind without detecting leaks related to rtpmanager.
Comment 6 Jan Schmidt 2008-04-20 17:43:34 UTC
Wim, if this patch is ok for you, put it in
Comment 7 Wim Taymans 2008-04-21 08:04:33 UTC
I get some caps problems with rtspsrc with this and I need more time to test.
Comment 8 Wim Taymans 2008-04-21 08:21:40 UTC
This was causing problems in rtspsrc:

        * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (request_pt_map),
        (gst_rtspsrc_configure_caps):
        Ref caps as the return value for the request_pt_map signal.
        Remove some caps weirdness when configuring a stream. See #528245.
Comment 9 Wim Taymans 2008-04-21 08:26:47 UTC
        Patch by: Olivier Crete <tester at tester dot ca>

        * gst/rtpmanager/gstrtpbin.c: (create_session), (get_pt_map),
        (new_ssrc_pad_found):
        Ref caps when inserting into the cache.
        Don't leak pads.

        * gst/rtpmanager/gstrtpjitterbuffer.c:
        (gst_rtp_jitter_buffer_get_clock_rate),
        (gst_rtp_jitter_buffer_query):
        Avoid a caps leak.
        Don't leak refcount in query.

        * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_get_caps),
        (gst_rtp_pt_demux_chain):
        Avoid caps leaks.

        * gst/rtpmanager/gstrtpsession.c: (source_get_sdes_structure),
        (gst_rtp_session_init), (return_true),
        (gst_rtp_session_clear_pt_map), (gst_rtp_session_cache_caps),
        (gst_rtp_session_clock_rate):
        Ref caps when inserting into the cache.
        Fix some more caps leaks. Fixes #528245.
Comment 10 Wim Taymans 2008-04-22 08:22:09 UTC
This one is also needed (same code as rtspsrc)

        * gst/sdp/gstsdpdemux.c: (request_pt_map):
        Ref caps, see #528245.