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 347304 - Massive leaks with xvimagesink
Massive leaks with xvimagesink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 0.10.9
Assigned To: Jan Schmidt
GStreamer Maintainers
: 344259 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-07-12 13:18 UTC by Jan Schmidt
Modified: 2006-07-13 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
player test application (601 bytes, text/x-python)
2006-07-12 13:19 UTC, Jan Schmidt
  Details
Patch (14.97 KB, patch)
2006-07-12 16:48 UTC, Jan Schmidt
committed Details | Review

Description Jan Schmidt 2006-07-12 13:18:32 UTC
It seems that a fair bit of memory is leaked when changing uris using playbin and xvimagesink.

Attaching a test program which plays a file repeatedly using playbin. Watching the memory consumption of this, it seems to leak something on the order of 10MB at each cycle. The same thing doesn't happen with ximagesink or fakesink.
Comment 1 Jan Schmidt 2006-07-12 13:19:06 UTC
Created attachment 68815 [details]
player test application
Comment 2 Jan Schmidt 2006-07-12 16:48:18 UTC
Created attachment 68825 [details] [review]
Patch

So, it turns out that xvimagesink was _never_ correctly releasing buffer_alloced buffers, resulting in leaking all the shared memory segments.

fixing that exposed a bug where buffers returned to the sink at the exact moment it was shutting down might remain in the buffer pool, and cause crashes later when the sink is reused. This patch fixes that by using locks to protect the XContext and the 'running' variable, so that the buffer_finalize method isn't racy with respect to what the sink is doing.

Patch fixes the same problem in ximagesink. It also fixes a not-so-small caps leak in decodebin exposed by valgrind.
Comment 3 Fabio Bonelli 2006-07-13 12:08:47 UTC
Maybe a duplicate of bug 344259?
Comment 4 Jan Schmidt 2006-07-13 13:39:42 UTC
*** Bug 344259 has been marked as a duplicate of this bug. ***
Comment 5 Jan Schmidt 2006-07-13 13:49:08 UTC
Certainly is, thanks!

It also raises the point that we should look at filesrc, although an fd leak is
small enough that I'm fazed about punting it until after the release.
Comment 6 Jan Schmidt 2006-07-13 14:37:13 UTC
OK, committing based on feedback on IRC.
Comment 7 Jan Schmidt 2006-07-13 14:40:32 UTC
        * gst/playback/gstdecodebin.c: (find_compatibles):
        Fix a caps leak when linking (#347304)

        * sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
        (gst_ximagesink_ximage_destroy), (gst_ximagesink_xcontext_clear),
        (gst_ximagesink_change_state):
        * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
        (gst_xvimage_buffer_finalize), (gst_xvimagesink_check_xshm_calls),
        (gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
        (gst_xvimagesink_xcontext_clear), (gst_xvimagesink_change_state):
        Don't leak shared memory resources. Use the object lock to protect
        against the xcontext disappearing while returning a buffer from the
        pipeline. (#347304)