Skip to content

Commit

Permalink
Fix error collision
Browse files Browse the repository at this point in the history
There are four types of errors:

- Unknown seed,
- CRC mismatch,
- Invalid types,
- Execution time < 10s.

All of these errors are handled by the 'total_errors' variable.
However, handling of the 'unknown seed' error differs from other types:
it sets 'total_errors' to -1, while other types of errors increment this variable.
This behavior leads to situations where one error overrides another.
For example, if you compile the program incorrectly and get an unknown
seed, and then run the program for less than 10 seconds, you will get
total_errors = 0 (because one error sets it to -1, while another
increments it to 0). See eembc#4.
As a result, you'll receive "Correct operation validated" when you
shouldn't.
  • Loading branch information
HepoH3 committed Jul 29, 2024
1 parent d5fad6b commit 4b7efe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ for (i = 0; i < MULTITHREAD; i++)
ee_printf("2K validation run parameters for coremark.\n");
break;
default:
total_errors = -1;
total_errors++;
break;
}
if (known_id >= 0)
Expand Down Expand Up @@ -426,7 +426,7 @@ for (i = 0; i < MULTITHREAD; i++)
}
if (total_errors > 0)
ee_printf("Errors detected\n");
if (total_errors < 0)
if (known_id < 0)
ee_printf(
"Cannot validate operation for these seed values, please compare "
"with results on a known platform.\n");
Expand Down

0 comments on commit 4b7efe6

Please sign in to comment.