[gstreamer-bugs] [Bug 322708] New: gst_plugin_load_file leaks a reference to a GstPlugin

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Mon Nov 28 16:13:38 PST 2005


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=322708
 GStreamer | gstreamer (core) | Ver: HEAD CVS

           Summary: gst_plugin_load_file leaks a reference to a GstPlugin
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: alessandro at nnva.org
         QAContact: gstreamer-bugs at lists.sourceforge.net
                CC: all-bugs at bugzilla.gnome.org


Please describe the problem:
valgrind log:

==25221== 176 (16 direct, 160 indirect) bytes in 1 blocks are definitely lost in
loss record 3373 of 3724
==25221==    at 0x1B8FF896: malloc (vg_replace_malloc.c:149)
==25221==    by 0x1BAAA59F: g_malloc (in /usr/lib/libglib-2.0.so.0.900.0)
==25221==    by 0x1CEC4ABF: plugin_init (gsttypefindfunctions.c:1933)
==25221==    by 0x1B948622: gst_plugin_register_func (gstplugin.c:260)
==25221==    by 0x1B948B1F: gst_plugin_load_file (gstplugin.c:446)
==25221==    by 0x1B9492E2: gst_plugin_load_by_name (gstplugin.c:870)
==25221==    by 0x1B949746: gst_plugin_feature_load (gstpluginfeature.c:111)
==25221==    by 0x1B95F323: gst_type_find_factory_call_function
(gsttypefindfactory.c:230)
==25221==    by 0x1C1B2D1B: gst_ogg_type_find (gstoggdemux.c:2856)
==25221==    by 0x1C1AC5A0: gst_ogg_pad_typefind (gstoggdemux.c:785)
==25221==    by 0x1C1ACE67: gst_ogg_pad_submit_packet (gstoggdemux.c:969)
==25221==    by 0x1C1AD5E1: gst_ogg_pad_submit_page (gstoggdemux.c:1081)

I think the bug is at gstreamer/gst/gstplugin.c:465 (gst_plugin_load_file).
Before the gst_object_ref call, the plugin has refcount == 1;
then the refcount is incremented with gst_object_ref, so refcount == 2;
at line 466 gst_default_registry_add_plugin is called and the refcount is
incremented again (gstregistry.c:307), so refcount == 3;
gst_plugin_load_file then returns the plugin instance to gst_plugin_load_by_name
which in turn returns it to gst_plugin_feature_load;
in gst_plugin_feature_load (line 118) the refcount is correctly decremented only
once, so refcount == 2;
at the end the refcount is 2: one reference is held in the registry, the other
is leaked. 

Steps to reproduce:
for example by demuxing any ogg file (as oggdemux does typefinding/plugin loading)

Actual results:


Expected results:


Does this happen every time?


Other information:

------- You are receiving this mail because: -------
You are the assignee for the bug.
You are the QA contact for the bug.




More information about the Gstreamer-bugs mailing list