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

Commit 3768fde6 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

Message: Initialize heapIndex to -1

MessageStack.removeMessage expects a zero or positive value here to
indicate that the message was inserted into a heap.

Without this we were hitting a race where a message could be inserted
into the stack after MessageQueue.nextMessage() called
MessageHeap.heapSweep() but before the call to
MessageHeap.drainFreelist() was made. This would fool
MessageHeap.drainFreelist() into thinking the message needed to
be removed from a heap when in fact it was never inserted into one.

Bug: 421623328
Flag: EXEMPT - bugfix
Test: atest CtsOsTestCasesRavenwood:MessageQueueTest#testStressQuit
Change-Id: I037111ab1e021d8d734b13756aa6e6a0de619232
parent 8efdf61a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment