Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eed866be authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binderRpcTest: session leak investigation part IV" am: b9909b12 am:...

Merge "binderRpcTest: session leak investigation part IV" am: b9909b12 am: 89915109 am: 1edd9ee6

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2241715



Change-Id: I8844485a89e96831731a56ec11e552149d3a65db
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a39238ee 1edd9ee6
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -181,10 +181,20 @@ struct ProcessSession {
            wp<RpcSession> weakSession = session;
            session = nullptr;

            // b/244325464 - 'getStrongCount' is printing '1' on failure here, which indicates the
            // the object should not actually be promotable. By looping, we distinguish a race here
            // from a bug causing the object to not be promotable.
            for (size_t i = 0; i < 3; i++) {
                sp<RpcSession> strongSession = weakSession.promote();
                EXPECT_EQ(nullptr, strongSession)
                    << (debugBacktrace(host.getPid()), debugBacktrace(getpid()), "Leaked sess: ")
                    << strongSession->getStrongCount();
                        << (debugBacktrace(host.getPid()), debugBacktrace(getpid()),
                            "Leaked sess: ")
                        << strongSession->getStrongCount() << " checked time " << i;

                if (strongSession != nullptr) {
                    sleep(1);
                }
            }
        }
    }
};