Issue 30579 in chromium-os: Update Engine should check for downloaded size before checking hash

0 views
Skip to first unread message

chrom...@googlecode.com

unread,
May 4, 2012, 8:15:57 PM5/4/12
to chromium...@chromium.org
Status: Started
Owner: jay...@chromium.org
CC: dgarr...@chromium.org, garn...@chromium.org, r...@chromium.org,
su...@chromium.org, gaur...@chromium.org
Labels: Type-Bug Pri-1 Area-Installer Sev-2 Mstone-20 Iteration-55

New issue 30579 by jay...@chromium.org: Update Engine should check for
downloaded size before checking hash
http://code.google.com/p/chromium-os/issues/detail?id=30579

When investigating Royans' report of AU errors, we found that due to some
reason (to be investigated), our downloads get terminated before the full
payload is downloaded. Sometimes with 0 bytes, sometimes with 1MB instead
of 2MB.

Although we have code to check for size mismatch, that code happens after
the check for hash mismatch. As a result, all size mismatch issues (which
are relatively more common) show up as hash mismatch and make it look
scarier and harder to investigate.

This bug is just for moving the size check before the hash check in the
code below in delta_performer.cc. That's why we see zero count of
kActionCodeDownloadSizeMismatchError (11) errors in the report whereas we
see 2467 counts of kActionCodeDownloadHashMismatchError (10) errors and 255
counts of kActionCodeDownloadPayloadVerificationError (12) errors. If we
move the size check first, then we'll really know which are partial
download issue (which needs to be fixed as a separate bug) and the real
number of hash/payload issues, if any.

// Verifies the download hash.
const string& download_hash_data = hash_calculator_.hash();
TEST_AND_RETURN_VAL(kActionCodeDownloadPayloadVerificationError,
!download_hash_data.empty());
TEST_AND_RETURN_VAL(kActionCodeDownloadHashMismatchError,
download_hash_data == update_check_response_hash);

// Verifies the download size.
TEST_AND_RETURN_VAL(kActionCodeDownloadSizeMismatchError,
update_check_response_size ==
manifest_metadata_size_ + buffer_offset_);

chrom...@googlecode.com

unread,
May 8, 2012, 2:58:08 PM5/8/12
to chromium...@chromium.org

Comment #2 on issue 30579 by bugdro...@chromium.org: Update Engine should
check for downloaded size before checking hash
http://code.google.com/p/chromium-os/issues/detail?id=30579#c2

Commit: 0d8fb40f60da36de40ee99f9feeb1ae8588a4401
Email: jay...@chromium.org

Verify downloaded size matches before verifying download hash match.

Hash mismatches should be rare and should not be seen during
normal operations, whereas size mismatches are more common due to failed
download attempts. So this CL re-orders the existing checks so that
we can easily determine the true number of hash mismatches, if any,
that's happening in the field.

BUG=chromium-os:30579
TEST=Tested with both valid and invalid sizes on my zgb.
Change-Id: Iea6b494011a32fbb3e30089eb7279db4927203d5
Reviewed-on: https://gerrit.chromium.org/gerrit/22067
Commit-Ready: Jay Srinivasan <jay...@chromium.org>
Reviewed-by: Jay Srinivasan <jay...@chromium.org>
Tested-by: Jay Srinivasan <jay...@chromium.org>

M delta_performer.cc

chrom...@googlecode.com

unread,
May 16, 2012, 4:03:56 PM5/16/12
to chromium...@chromium.org
Updates:
Status: Fixed
Labels: -Iteration-56

Comment #4 on issue 30579 by jay...@chromium.org: Update Engine should
check for downloaded size before checking hash
http://code.google.com/p/chromium-os/issues/detail?id=30579

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages