Lecture: Testing and verification

Question

Describe one type of bugs that cannot be prevented by STACK and one type of bugs that cannot be prevented by Hyperkernel.

Question

Compare Figure 10 from the Hyperkernel paper to Tables 2 and 3 from the Dune paper (“getpid”, “trap”, “appel1”, and “appel2”). Why do you think Dune performs much better on “appel1” and “appel2” than Hyperkernel?

Question

Provide a list of questions you would like to discuss in class. Feel free to provide any comments on the papers and related topics (e.g., which parts you like and which parts you find confusing). For instance, would STACK and the Hyperkernel approach prevent any bugs you had in your xv6 labs?

Hyperkernel source code

If you are interested, check out the source code of Hyperkernel on GitHub.

Write down your answers in a file named answers.txt, and upload it using Canvas.

administrivia

overview

void test_me(int x, int y) {
  int z = 2 * x;
  if (z == y) {
    if (y == x + 10) {
      crash();
    }
  }
}

background: SAT/SMT

bug finding

#include <stdio.h>
#include <stdlib.h>

int foo(int n)
{
        int *arr = malloc(n * sizeof(int));
        //arr[0] = 42;
        //free(arr);
        return arr[0];
}

int main(int argc, const char * argv[]) {
    printf("%d\n", foo(argc));
    return 0;
}

verification