chiark / gitweb /
Fix CRC error reporting
authorNick Sanders <nsanders@chromium.org>
Mon, 11 Dec 2017 19:59:16 +0000 (11:59 -0800)
committerNick Sanders <nsanders@chromium.org>
Mon, 11 Dec 2017 20:07:48 +0000 (12:07 -0800)
In the situation where CRC calculation fails,
but no data miscompares were found, we print out
an error, but don't increment the error count.
This leads stressapptest to report "PASS" incorrectly.

We'll add an error count increment to fix the issue.

BUG=https://github.com/stressapptest/stressapptest/issues/56
TEST=add code to corrupt CRC, see "FAIL" as expected.

Signed-off-by: Nick Sanders <nsanders@chromium.org>
src/worker.cc

index 5b0fe5917f1d5055125a9eedb0d88b7a7537d4a6..922d2c1ca8b9680ae2dcfe32870019922279e3f6 100644 (file)
@@ -1238,9 +1238,11 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe,
                       expectedcrc->ToHexString().c_str());
             struct ErrorRecord er;
             er.actual = sourcemem[0];
-            er.expected = 0x0;
+            er.expected = 0xbad00000ull << 32;
             er.vaddr = sourcemem;
             ProcessError(&er, 0, "Hardware Error");
+            errors += 1;
+            errorcount_ ++;
           }
         }
       }
@@ -1385,6 +1387,8 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe,
             er.expected = 0xbad;
             er.vaddr = sourcemem;
             ProcessError(&er, 0, "Hardware Error");
+            errors ++;
+            errorcount_ ++;
           }
         }
       }