paycheck: accommodate > 255 block reads/writes
It turns out that, in some delta payloads, we're read/writing specific
blocks as many as 270 times. Therefore, the unsigned char counters we've
used for recording these accesses overflow and cause the execution to
die unexpectedly (also failing paygen when that happens). This change
increases the counter size to an unsigned short.
It should be noted that the fact that we have such frequently accessed
blocks through the course of an update is somewhat troubling by itself,
and should be investigated.
BUG=chromium:261417
TEST=Checking a previously failed payload now passes
Change-Id: I47903cde9971c142cd33382b485b22a88a06b80f
Reviewed-on: https://gerrit.chromium.org/gerrit/63040
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/update_payload/checker.py b/scripts/update_payload/checker.py
index 18da5af..2a1dd31 100644
--- a/scripts/update_payload/checker.py
+++ b/scripts/update_payload/checker.py
@@ -885,11 +885,11 @@
Args:
total_size: the total block size in bytes
Returns:
- An array of unsigned char elements initialized to zero, one for each of
+ An array of unsigned short elements initialized to zero, one for each of
the blocks necessary for containing the partition.
"""
- return array.array('B', [0] * self._SizeToNumBlocks(total_size))
+ return array.array('H', [0] * self._SizeToNumBlocks(total_size))
def _CheckOperations(self, operations, report, base_name, old_fs_size,
new_fs_size, new_usable_size, prev_data_offset,