<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>118473</bug_id>
          
          <creation_ts>2013-07-08 09:09:53 -0700</creation_ts>
          <short_desc>[GTK] Leak: GstElement* leaking in MediaPlayerPrivateGStreamer::createAudioSink()</short_desc>
          <delta_ts>2013-07-16 13:18:09 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>116317</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Brian Holt">brian.holt</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>glenn</cc>
    
    <cc>gustavo</cc>
    
    <cc>jer.noble</cc>
    
    <cc>kbalazs</cc>
    
    <cc>menard</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>906825</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-08 09:09:53 -0700</bug_when>
    <thetext>In Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

Leaks found using the &quot;--leak&quot; option in the Gtk port:


Command: /home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/Programs/DumpRenderTree -
Leak_StillReachable
3,328 bytes in 13 blocks are still reachable in loss record 939 of 1,061
    realloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    g_realloc (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/gmem.c:224)
    g_array_maybe_expand (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/garray.c:785)
    g_array_append_vals (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/garray.c:423)
    gst_structure_id_set_value (/WebKitBuild/Dependencies/Source/gstreamer/gst/gststructure.c:476)
    gst_element_class_set_static_metadata (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelement.c:1345)
    gst_audio_convert_class_intern_init (/WebKitBuild/Dependencies/Source/gst-plugins-base/gst/audioconvert/gstaudioconvert.c:204)
    g_type_class_ref (/WebKitBuild/Dependencies/Source/glib-2.36.0/gobject/gtype.c:2239)
    g_object_newv (/WebKitBuild/Dependencies/Source/glib-2.36.0/gobject/gobject.c:1624)
    gst_element_factory_create (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:377)
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin() (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::MediaPlayerPrivateGStreamer::load(WTF::String const&amp;) [clone .part.24] (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::MediaPlayer::loadWithNextMediaEngine(WebCore::MediaPlayerFactory*) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::MediaPlayer::load(WebCore::KURL const&amp;, WebCore::ContentType const&amp;, WTF::String const&amp;) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::HTMLMediaElement::loadResource(WebCore::KURL const&amp;, WebCore::ContentType&amp;, WTF::String const&amp;) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::HTMLMediaElement::selectMediaResource() (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::HTMLMediaElement::loadTimerFired(WebCore::Timer&lt;WebCore::HTMLMediaElement&gt;*) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::ThreadTimers::sharedTimerFiredInternal() (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    WebCore::timeout_cb(void*) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0.19.1)
    g_timeout_dispatch (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/gmain.c:4413)
    g_main_context_dispatch (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/gmain.c:3054)
    g_main_context_iterate.isra.22 (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/gmain.c:3701)
    g_main_loop_run (/WebKitBuild/Dependencies/Source/glib-2.36.0/glib/gmain.c:3895)
    gtk_main (/WebKitBuild/Dependencies/Source/gtk+-3.6.0/gtk/gtkmain.c:1163)
    runTest(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
    runTestingServerLoop() (/home/likewise-open/SERILOCAL/brian.holt/Code/gnome3/WebKit/WebKitBuild/Release/Programs/DumpRenderTree)
Suppression (error hash=#FDF24213CEA9E828#):
  For more info on using suppressions see http://dev.chromium.org/developers/tree-sheriffs/sheriff-details-chromium/memory-sheriff#TOC-Suppressing-memory-reports
{
   &lt;insert_a_suppression_name_here&gt;
   Memcheck:Leak
   fun:realloc
   fun:g_realloc
   fun:g_array_maybe_expand
   fun:g_array_append_vals
   fun:gst_structure_id_set_value
   fun:gst_element_class_set_static_metadata
   fun:gst_audio_convert_class_intern_init
   fun:g_type_class_ref
   fun:g_object_newv
   fun:gst_element_factory_create
   fun:gst_element_factory_make
   fun:_ZN7WebCore27MediaPlayerPrivateGStreamer15createAudioSinkEv
   fun:_ZN7WebCore27MediaPlayerPrivateGStreamer16createGSTPlayBinEv
   fun:_ZN7WebCore27MediaPlayerPrivateGStreamer4loadERKN3WTF6StringE.part.24
   fun:_ZN7WebCore11MediaPlayer23loadWithNextMediaEngineEPNS_18MediaPlayerFactoryE
   fun:_ZN7WebCore11MediaPlayer4loadERKNS_4KURLERKNS_11ContentTypeERKN3WTF6StringE
   fun:_ZN7WebCore16HTMLMediaElement12loadResourceERKNS_4KURLERNS_11ContentTypeERKN3WTF6StringE
   fun:_ZN7WebCore16HTMLMediaElement19selectMediaResourceEv
   fun:_ZN7WebCore16HTMLMediaElement14loadTimerFiredEPNS_5TimerIS0_EE
   fun:_ZN7WebCore12ThreadTimers24sharedTimerFiredInternalEv
   fun:_ZN7WebCoreL10timeout_cbEPv
   fun:g_timeout_dispatch
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906826</commentid>
    <comment_count>1</comment_count>
      <attachid>206249</attachid>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-08 09:14:08 -0700</bug_when>
    <thetext>Created attachment 206249
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906832</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-07-08 09:29:20 -0700</bug_when>
    <thetext>I don&apos;t know much about gst, but I thought elements had a floating reference that is consumed when added to a container.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906833</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-07-08 09:31:40 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I don&apos;t know much about gst, but I thought elements had a floating reference that is consumed when added to a container.

Indeed, and the proof of that is that you don&apos;t actually &quot;adopt&quot;. So which one(s) were actually leaking?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906836</commentid>
    <comment_count>4</comment_count>
      <attachid>206249</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-07-08 09:34:24 -0700</bug_when>
    <thetext>Comment on attachment 206249
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206249&amp;action=review

&gt; Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1578
&gt; +    GRefPtr&lt;GstElement&gt; audioSink = adoptGRef(gst_bin_new(&quot;audio-sink&quot;));

The doc says that gst_bin_new() returns a floating reference:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-new

How come adopting doesn&apos;t assert here?
template &lt;&gt; GRefPtr&lt;GstElement&gt; adoptGRef(GstElement* ptr)
{
    ASSERT(!ptr || !gstObjectIsFloating(GST_OBJECT(ptr)));
    return GRefPtr&lt;GstElement&gt;(ptr, GRefPtrAdopt);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906846</commentid>
    <comment_count>5</comment_count>
      <attachid>206249</attachid>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-08 09:52:49 -0700</bug_when>
    <thetext>Comment on attachment 206249
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206249&amp;action=review

&gt;&gt; Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1578
&gt;&gt; +    GRefPtr&lt;GstElement&gt; audioSink = adoptGRef(gst_bin_new(&quot;audio-sink&quot;));
&gt; 
&gt; The doc says that gst_bin_new() returns a floating reference:
&gt; http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-new
&gt; 
&gt; How come adopting doesn&apos;t assert here?
&gt; template &lt;&gt; GRefPtr&lt;GstElement&gt; adoptGRef(GstElement* ptr)
&gt; {
&gt;     ASSERT(!ptr || !gstObjectIsFloating(GST_OBJECT(ptr)));
&gt;     return GRefPtr&lt;GstElement&gt;(ptr, GRefPtrAdopt);
&gt; }

Thanks very much for the link - I should have checked first whether gst_bin_new returns a floating reference.

Regarding the ASSERT, I&apos;m working with a release build so it&apos;s ifdef&apos;ed out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906848</commentid>
    <comment_count>6</comment_count>
      <attachid>206249</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-07-08 09:55:05 -0700</bug_when>
    <thetext>Comment on attachment 206249
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206249&amp;action=review

&gt;&gt;&gt; Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1578
&gt;&gt;&gt; +    GRefPtr&lt;GstElement&gt; audioSink = adoptGRef(gst_bin_new(&quot;audio-sink&quot;));
&gt;&gt; 
&gt;&gt; The doc says that gst_bin_new() returns a floating reference:
&gt;&gt; http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-new
&gt;&gt; 
&gt;&gt; How come adopting doesn&apos;t assert here?
&gt;&gt; template &lt;&gt; GRefPtr&lt;GstElement&gt; adoptGRef(GstElement* ptr)
&gt;&gt; {
&gt;&gt;     ASSERT(!ptr || !gstObjectIsFloating(GST_OBJECT(ptr)));
&gt;&gt;     return GRefPtr&lt;GstElement&gt;(ptr, GRefPtrAdopt);
&gt;&gt; }
&gt; 
&gt; Thanks very much for the link - I should have checked first whether gst_bin_new returns a floating reference.
&gt; 
&gt; Regarding the ASSERT, I&apos;m working with a release build so it&apos;s ifdef&apos;ed out.

Sometimes to streamer doc is wrong about these things so it should be double checked. Also note that the behaviour is sometimes different between streamer 0.10 and gstreamer 1.0.
It is important that you test with a debug build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906851</commentid>
    <comment_count>7</comment_count>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-08 09:57:11 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; I don&apos;t know much about gst, but I thought elements had a floating reference that is consumed when added to a container.
&gt; 
&gt; Indeed, and the proof of that is that you don&apos;t actually &quot;adopt&quot;. So which one(s) were actually leaking?

I think all of them were leaking: gst_element_factory_make () returns a new GstElement or NULL if unable to create element. [transfer floating]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906852</commentid>
    <comment_count>8</comment_count>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-08 09:57:53 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 206249 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=206249&amp;action=review
&gt; 
&gt; &gt;&gt;&gt; Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1578
&gt; &gt;&gt;&gt; +    GRefPtr&lt;GstElement&gt; audioSink = adoptGRef(gst_bin_new(&quot;audio-sink&quot;));
&gt; &gt;&gt; 
&gt; &gt;&gt; The doc says that gst_bin_new() returns a floating reference:
&gt; &gt;&gt; http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-new
&gt; &gt;&gt; 
&gt; &gt;&gt; How come adopting doesn&apos;t assert here?
&gt; &gt;&gt; template &lt;&gt; GRefPtr&lt;GstElement&gt; adoptGRef(GstElement* ptr)
&gt; &gt;&gt; {
&gt; &gt;&gt;     ASSERT(!ptr || !gstObjectIsFloating(GST_OBJECT(ptr)));
&gt; &gt;&gt;     return GRefPtr&lt;GstElement&gt;(ptr, GRefPtrAdopt);
&gt; &gt;&gt; }
&gt; &gt; 
&gt; &gt; Thanks very much for the link - I should have checked first whether gst_bin_new returns a floating reference.
&gt; &gt; 
&gt; &gt; Regarding the ASSERT, I&apos;m working with a release build so it&apos;s ifdef&apos;ed out.
&gt; 
&gt; Sometimes to streamer doc is wrong about these things so it should be double checked. Also note that the behaviour is sometimes different between streamer 0.10 and gstreamer 1.0.
&gt; It is important that you test with a debug build.

I definitely will in the future.  Thanks for the helpful comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906853</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-07-08 10:01:20 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; I don&apos;t know much about gst, but I thought elements had a floating reference that is consumed when added to a container.
&gt; &gt; 
&gt; &gt; Indeed, and the proof of that is that you don&apos;t actually &quot;adopt&quot;. So which one(s) were actually leaking?
&gt; 
&gt; I think all of them were leaking: gst_element_factory_make () returns a new GstElement or NULL if unable to create element. [transfer floating]

gst_element_factory() returns a floating reference and get_bin_add_many() should take ownership of the returned values later on:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBin.html#gst-bin-add

Therefore, I don&apos;t understand why it leaks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>906854</commentid>
    <comment_count>10</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-07-08 10:01:49 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; I don&apos;t know much about gst, but I thought elements had a floating reference that is consumed when added to a container.
&gt; &gt; 
&gt; &gt; Indeed, and the proof of that is that you don&apos;t actually &quot;adopt&quot;. So which one(s) were actually leaking?
&gt; 
&gt; I think all of them were leaking: gst_element_factory_make () returns a new GstElement or NULL if unable to create element. [transfer floating]

a GstElement is a GInitiallyUnowned, so it&apos;s returning a new element with a floating reference. You only need to convert it into a normal ref (which is what GRefPtr is does) if it&apos;s not added to a container that consumes the floating ref.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>907051</commentid>
    <comment_count>11</comment_count>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-09 02:37:10 -0700</bug_when>
    <thetext>Some more detail about the origins of the leaks from the debug build:

Leak_StillReachable
40 bytes in 1 blocks are still reachable in loss record 335 of 1,176
    malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1564)
GstElement* scale = gst_element_factory_make(&quot;scaletempo&quot;, 0);

Leak_StillReachable
554 bytes in 41 blocks are still reachable in loss record 855 of 1,176
    malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)    
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1570)
GstElement* convert = gst_element_factory_make(&quot;audioconvert&quot;, 0);

Leak_StillReachable
576 bytes in 4 blocks are still reachable in loss record 836 of 1,139
    realloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1571)
GstElement* resample = gst_element_factory_make(&quot;audioresample&quot;, 0);

Leak_StillReachable
304 bytes in 10 blocks are still reachable in loss record 750 of 1,176
    malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1572)
GstElement* sink = gst_element_factory_make(&quot;autoaudiosink&quot;, 0);

Leak_StillReachable
120 bytes in 3 blocks are still reachable in loss record 525 of 1,139
    malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1578)
GstElement* audioSink = gst_bin_new(&quot;audio-sink&quot;);


Additionally there are leaks at
Leak_StillReachable
3,928 bytes in 49 blocks are still reachable in loss record 1,016 of 1,138
    calloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1599)
m_playBin = gst_element_factory_make(gPlaybinName, &quot;play&quot;);


Leak_StillReachable
3,104 bytes in 28 blocks are still reachable in loss record 1,008 of 1,139
    calloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ...
    gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
    WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink(_GstElement*) (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:563)
m_fpsSink = gst_element_factory_make(&quot;fpsdisplaysink&quot;, &quot;sink&quot;);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>907053</commentid>
    <comment_count>12</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2013-07-09 02:53:52 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; Some more detail about the origins of the leaks from the debug build:
&gt; 
&gt; Leak_StillReachable
&gt; 40 bytes in 1 blocks are still reachable in loss record 335 of 1,176
&gt;     malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
&gt;     ...
&gt;     gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
&gt;     WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1564)
&gt; GstElement* scale = gst_element_factory_make(&quot;scaletempo&quot;, 0);
&gt; 

still-reachebles are not leaks, at least in WebKit sense.
It&apos;s normal that there are unfreed heap objects at termination because WebKit is intentionally does not care about that (the idea is to terminate faster, the OS frees up the memory anyway). It means that for example singletons are usually created on the heap and never freed.
We should be sure that the objects holding these pointers are actually destroyed. Only in that case can we say that these are real leaks. Given that in this case valgrind would rather report definitely-lost failures, I assume these are not leaks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>907058</commentid>
    <comment_count>13</comment_count>
    <who name="Brian Holt">brian.holt</who>
    <bug_when>2013-07-09 03:03:33 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; (In reply to comment #11)
&gt; &gt; Some more detail about the origins of the leaks from the debug build:
&gt; &gt; 
&gt; &gt; Leak_StillReachable
&gt; &gt; 40 bytes in 1 blocks are still reachable in loss record 335 of 1,176
&gt; &gt;     malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
&gt; &gt;     ...
&gt; &gt;     gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
&gt; &gt;     WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1564)
&gt; &gt; GstElement* scale = gst_element_factory_make(&quot;scaletempo&quot;, 0);
&gt; &gt; 
&gt; 
&gt; still-reachebles are not leaks, at least in WebKit sense.
&gt; It&apos;s normal that there are unfreed heap objects at termination because WebKit is intentionally does not care about that (the idea is to terminate faster, the OS frees up the memory anyway). It means that for example singletons are usually created on the heap and never freed.
&gt; We should be sure that the objects holding these pointers are actually destroyed. Only in that case can we say that these are real leaks. Given that in this case valgrind would rather report definitely-lost failures, I assume these are not leaks.

That&apos;s a fair point.  I will restrict my efforts to Definitely-Lost in the meantime.  

Should I mark this as wontfix?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>907059</commentid>
    <comment_count>14</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2013-07-09 03:26:54 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; (In reply to comment #12)
&gt; &gt; (In reply to comment #11)
&gt; &gt; &gt; Some more detail about the origins of the leaks from the debug build:
&gt; &gt; &gt; 
&gt; &gt; &gt; Leak_StillReachable
&gt; &gt; &gt; 40 bytes in 1 blocks are still reachable in loss record 335 of 1,176
&gt; &gt; &gt;     malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
&gt; &gt; &gt;     ...
&gt; &gt; &gt;     gst_element_factory_make (/WebKitBuild/Dependencies/Source/gstreamer/gst/gstelementfactory.c:446)
&gt; &gt; &gt;     WebCore::MediaPlayerPrivateGStreamer::createAudioSink() (/WebKitBuild/Debug/../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1564)
&gt; &gt; &gt; GstElement* scale = gst_element_factory_make(&quot;scaletempo&quot;, 0);
&gt; &gt; &gt; 
&gt; &gt; 
&gt; &gt; still-reachebles are not leaks, at least in WebKit sense.
&gt; &gt; It&apos;s normal that there are unfreed heap objects at termination because WebKit is intentionally does not care about that (the idea is to terminate faster, the OS frees up the memory anyway). It means that for example singletons are usually created on the heap and never freed.
&gt; &gt; We should be sure that the objects holding these pointers are actually destroyed. Only in that case can we say that these are real leaks. Given that in this case valgrind would rather report definitely-lost failures, I assume these are not leaks.
&gt; 
&gt; That&apos;s a fair point.  I will restrict my efforts to Definitely-Lost in the meantime.  
&gt; 
&gt; Should I mark this as wontfix?

I would rather mark it invalid.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>206249</attachid>
            <date>2013-07-08 09:14:08 -0700</date>
            <delta_ts>2013-07-16 13:18:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-118473-20130708171209.patch</filename>
            <type>text/plain</type>
            <size>3376</size>
            <attacher name="Brian Holt">brian.holt</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTUyNDQ1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZmI5ZGM5ODY2ZTBlYTMz
Mzc4MmM3YWI1YzdhYjUwMDBlYzQ2ZmRmYy4uYmEzOTJlMTU4OWY3NmNhMGUxOTNlNmY2NjY5MDg5
MjIzYWIyYTI2ZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBAC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