Merge lp:~alan-griffiths/mir/fix-fd-leak-thomi-reported into lp:~mir-team/mir/trunk

Proposed by Alan Griffiths on 2013-06-07
Status: Merged
Approved by: Alexandros Frantzis on 2013-06-07
Approved revision: 726
Merged at revision: 727
Proposed branch: lp:~alan-griffiths/mir/fix-fd-leak-thomi-reported
Merge into: lp:~mir-team/mir/trunk
Diff against target: 21 lines (+5/-0)
1 file modified
src/client/mir_surface.cpp (+5/-0)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-fd-leak-thomi-reported
Reviewer Review Type Date Requested Status
Alexandros Frantzis (community) 2013-06-07 Approve on 2013-06-07
PS Jenkins bot continuous-integration Approve on 2013-06-07
Review via email: mp+168012@code.launchpad.net

Commit message

client: close surface fds when finished with surface

Description of the change

client: close surface fds when finished with surface

"The mir_stress binary is now built as part of the regular trunk build process. However, the client API seems to be leaking FDs again.

"My plan is to make the stress tests run as part of every merge proposal, which will make regressions such as this impossible to land in the future. However, there's a bit of infrastructure we need to wrangle until that can happen, and I'm on holiday for the next few weeks.

"It would be great if someone familiar with the client API could run the mir-stress tests (run "mir_stress -n 10"), fix the FD leak, and possibly keep an eye on the situation until we manage to get this automated." - thomi

A better command is:

valgrind --track-fds=yes bin/mir_stress -n 10

To post a comment you must log in.
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/client/mir_surface.cpp'
2--- src/client/mir_surface.cpp 2013-06-03 08:14:01 +0000
3+++ src/client/mir_surface.cpp 2013-06-07 10:56:53 +0000
4@@ -25,6 +25,7 @@
5 #include "mir/input/input_platform.h"
7 #include <cassert>
8+#include <unistd.h>
10 namespace geom = mir::geometry;
11 namespace mcl = mir::client;
12@@ -66,6 +67,10 @@
13 input_thread->stop();
14 input_thread->join();
15 }
17+ for (auto i = 0, end = surface.fd_size(); i != end; ++i)
18+ close(surface.fd(i));
20 release_cpu_region();
21 }


People subscribed via source and target branches