Mir

Merge lp://staging/~vanvugt/mir/fix-1295231 into lp://staging/mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1500
Proposed branch: lp://staging/~vanvugt/mir/fix-1295231
Merge into: lp://staging/mir
Diff against target: 39 lines (+16/-2)
2 files modified
src/client/mir_client_library.cpp (+11/-2)
tests/acceptance-tests/test_protobuf.cpp (+5/-0)
To merge this branch: bzr merge lp://staging/~vanvugt/mir/fix-1295231
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
Review via email: mp+212367@code.staging.launchpad.net

Commit message

Fix client memory leak that is causing sporadic CI test failures in and around
TestClientInput/DemoPrivateProtobuf. (LP: #1295231)

The leak was a simple mistake in the client library. It was triggered by
DemoPrivateProtobuf tests being strangely racy (not fixed here). However
valgrind doesn't detect that as a leak until the next multi-process test
completes. So it would fail typically during TestClientInput.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

8 + // Use a unique_ptr to ensure connection gets deleted even if we have
9 + // thrown an exception (LP: #1295231)
10 + std::unique_ptr<MirConnection> ptr(connection);

This is the wrong place/way to fix the problem.

This code implements a C API and should not be propagating exceptions.

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

Alan,

We're not propagating exceptions, for that reason. See the catch() below that.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Alan,
>
> We're not propagating exceptions, for that reason. See the catch() below that.

OK

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

How does the latest iteration fix a memory leak?

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> How does the latest iteration fix a memory leak?

Sorry, that was a think-o.

While the test may expose raciness in the RPC code I don't think the test itself is the problem. AFAICS the race is between the client posting disconnect and the client detecting that the server has disconnected.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Rebuilding to see if CI is really happy with this merged.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches