Section: Software

Cmmtest: a tool for hunting concurrency compiler bugs

Participants : Francesco Zappa Nardelli [contact] , Robin Morisset, Pankaj Pawan.

Languages, concurrency, memory models, C11/C++11, compiler, bugs.

The cmmtest tool performs random testing of C and C++ compilers against the C11/C++11 memory model. A test case is any well-defined, sequential C program; for each test case, cmmtest:

  1. compiles the program using the compiler and compiler optimisations that are being tested;

  2. runs the compiled program in an instrumented execution environment that logs all memory accesses to global variables and synchronisations;

  3. compares the recorded trace with a reference trace for the same program, checking if the recorded trace can be obtained from the reference trace by valid eliminations, reorderings and introductions.

Although not yet publicly distributed, cmmtest already identified several mistaken write introductions and other unexpected behaviours in the latest release of the gcc compiler. These have been promptly fixed by the gcc developers.