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

Commit 1edd9ee6 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: 89915109

parents e8296bdc 89915109
Loading
Loading
Loading
Loading
+14 −4
Original line number Original line Diff line number Diff line
@@ -181,10 +181,20 @@ struct ProcessSession {
            wp<RpcSession> weakSession = session;
            wp<RpcSession> weakSession = session;
            session = nullptr;
            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();
                sp<RpcSession> strongSession = weakSession.promote();
                EXPECT_EQ(nullptr, strongSession)
                EXPECT_EQ(nullptr, strongSession)
                    << (debugBacktrace(host.getPid()), debugBacktrace(getpid()), "Leaked sess: ")
                        << (debugBacktrace(host.getPid()), debugBacktrace(getpid()),
                    << strongSession->getStrongCount();
                            "Leaked sess: ")
                        << strongSession->getStrongCount() << " checked time " << i;

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