From ad7d6b210d69a35d6170394b4705e7ff7fdca49f Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Fri, 10 Apr 2020 09:38:44 -0700 Subject: [PATCH] Revert "logd: iterator corruption paranoia" This reverts commit 3614a0c5d4aec84fbc5f6cbf1e919e8b3825b818. The original commit was added to check if what should be impossible cases were happening. In the years after it was added, it doesn't appear that these cases have happened. Recent reverts removed the commits that caused the paranoia in the first place, making these cases even more impossible. Test: logging unit tests Change-Id: I687c4d7876a38485e940f004dbd5ae6a1e15fb4c --- logd/LogBuffer.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 5bec0767d..1f8ad05fc 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -1072,22 +1072,9 @@ uint64_t LogBuffer::flushTo(SocketClient* reader, uint64_t start, pid_t* lastTid uint64_t curr = start; - LogBufferElement* lastElement = nullptr; // iterator corruption paranoia - static const size_t maxSkip = 4194304; // maximum entries to skip - size_t skip = maxSkip; for (; it != mLogElements.end(); ++it) { LogBufferElement* element = *it; - if (!--skip) { - android::prdebug("reader.per: too many elements skipped"); - break; - } - if (element == lastElement) { - android::prdebug("reader.per: identical elements"); - break; - } - lastElement = element; - if (!privileged && (element->getUid() != uid)) { continue; } @@ -1128,7 +1115,6 @@ uint64_t LogBuffer::flushTo(SocketClient* reader, uint64_t start, pid_t* lastTid return curr; } - skip = maxSkip; rdlock(); } unlock();