Merge lp:~vanvugt/qtmir/fix-1495871 into lp:qtmir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel d'Andrada
Proposed branch: lp:~vanvugt/qtmir/fix-1495871
Merge into: lp:qtmir
Diff against target: 33 lines (+9/-7)
1 file modified
src/modules/Unity/Application/mirsurfaceitem.cpp (+9/-7)
To merge this branch: bzr merge lp:~vanvugt/qtmir/fix-1495871
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+272360@code.launchpad.net

Commit message

Fix fd leak (actually a whole texture+buffer leak) of zombie surfaces
(LP: #1495871)

Description of the change

I'm not completely confident about this. It seems to work, but the fds in question still come and go under normal usage anyway. So the "leak" is hard to detect reliably.

Added to that; every attempt I try to detect GL errors, I see none. But there are other plausible explanations for that...

Then again, if this branch really is working, it might be working for reasons other than those in the comments :)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The following branch already fixes that:
https://code.launchpad.net/~dandrader/qtmir/textureCleanUp-lp1499388/+merge/272452

And no, I didn't copy your branch :)

review: Disapprove
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Wow. Nice timing.

Unmerged revisions

378. By Daniel van Vugt

Fix fd leak (actually a whole texture leak) of zombie surfaces
(LP: #1495871)

I think. Fingers crossed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp'
2--- src/modules/Unity/Application/mirsurfaceitem.cpp 2015-09-18 20:11:50 +0000
3+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2015-09-25 09:48:00 +0000
4@@ -67,10 +67,6 @@
5
6 bool smooth;
7
8- void releaseTexture() {
9- t.reset();
10- }
11-
12 void setTexture(QSharedPointer<QSGTexture> newTexture) {
13 t = newTexture;
14 }
15@@ -586,9 +582,15 @@
16 if (!m_surface->isBeingDisplayed() && window()) {
17 disconnect(window(), nullptr, m_surface, nullptr);
18 }
19- if (m_textureProvider) {
20- m_textureProvider->releaseTexture();
21- }
22+
23+ // Note we don't release the texture from m_textureProvider here.
24+ // Any attempt to release the texture here will silently succeed and
25+ // also leak (file descriptors and GPU resources) because the requisite
26+ // GL context is missing in the GUI thread. Such a leak is known as
27+ // "orphaning" the EGLImage that is used inside the Mir Buffer object;
28+ // https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_base.txt
29+ // Instead, we just wait patiently for the render thread to clean up
30+ // properly and calls MirSurfaceItem::releaseResources() below.
31 }
32
33 m_surface = surface;

Subscribers

People subscribed via source and target branches