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 745159 - d3dvideosink: swap chain leak
d3dvideosink: swap chain leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal normal
: 1.4.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-25 13:55 UTC by Krzysztof Kotlenga
Modified: 2015-02-26 12:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Backtraces (20.88 KB, text/plain)
2015-02-25 13:55 UTC, Krzysztof Kotlenga
  Details
d3dvideosink: release existing D3D swap chain on init (838 bytes, patch)
2015-02-25 13:57 UTC, Krzysztof Kotlenga
committed Details | Review

Description Krzysztof Kotlenga 2015-02-25 13:55:57 UTC
Created attachment 297874 [details]
Backtraces

There is a massive leak happening from calling d3d_init_swap_chains multiple times in some situations. Real life example:
1. pipeline is set to PLAYING
2. window handle is set on "prepare-window-handle", d3d_init_swap_chains is called the first time in consequence
3. set_caps is called, d3d_init_swap_chains is called the second time - at least sink->d3d.swapchain is lost. This later leads to massive resource leaks when going to NULL.

I'm attaching a gdb log showing the above and a basic patch that frees existing swap chain first - this fixes the major leak here, but perhaps d3d_init_swap_chains shouldn't be called multiple times like this in the first place.

It might as well fix some other d3dvideosink bugs related to memory leaks.

Note: all credits go to Roman Nowicki, I'm only upstreaming it.
Comment 1 Krzysztof Kotlenga 2015-02-25 13:57:37 UTC
Created attachment 297876 [details] [review]
d3dvideosink: release existing D3D swap chain on init
Comment 2 Sebastian Dröge (slomo) 2015-02-25 14:17:38 UTC
Ah, that might also fix another bug. Thanks!
Comment 3 Sebastian Dröge (slomo) 2015-02-25 14:18:54 UTC
commit 29098129be0af66f4cb430d7afa6d43cb39750c6
Author: Roman Nowicki <r.nowicki@sims.pl>
Date:   Wed Feb 25 14:48:59 2015 +0100

    d3dvideosink: release existing D3D swap chain on init
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745159