Using Meta-level Compilation to Check FLASH Protocol Code

Abstract

Building systems such as OS kernels and embedded software is difficult. An important source of this difficulty is the numerous rules they must obey: interrupts cannot be disabled for "too long," global variables must be protected by locks, user pointers passed to OS code must be checked for safety before use, etc. A single violation can crash the system, yet typically these invariants are unchecked, existing only on paper or in the implementor's mind. This paper is a case study in how system implementors can use a new programming methodology, meta-level compilation (MO), to easily check such invariants. It focuses on using MC to check for errors in the code used to manage cache coherence on the FLASH shared memory multiprocessor. The only real practical method known for verifying such code is testing and simulation. We show that simple, system-specific checkers can dramatically improve this situation by statically pinpointing errors in the program source. These checkers can be written by implementors themselves and, by exploiting the system-specific information this allows, can detect errors unreachable with other methods. The checkers in this paper found 34 bugs in FLASH code despite the care used in building it and the years of testing it has undergone. Many of these errors fall in the worst category of systems bugs: those that show up sporadically only after days of continuous use. The case study is interesting because it shows that the MC approach finds serious errors in well-tested, non-toy systems code. Further, the code to find such bugs is usually 10-100 lines long, written in a few hours, and exactly locates errors that, if discovered during testing, would require several days of investigation by an experienced implementor. The paper presents 8 checkers we wrote, their application to five different protocol implementations, and a discussion of the errors that we found.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Jan 01, 2000
Accession Number
ADA419588

Entities

People

  • Andy Chou
  • Benjamin Chelf
  • Dawson Engler
  • Mark Heinrich

Organizations

  • Stanford University

Tags

DTIC Thesaurus Topics

  • Abstracts
  • Case Studies
  • Compilers
  • Computer Programming
  • Computers
  • Consistency
  • Debugging
  • Directories
  • Embedded Systems
  • Floating Point Operations
  • Kernels (Operating System)
  • Language
  • Object Code
  • Operating Systems
  • Programming Languages
  • Simulations
  • Simulators

Fields of Study

  • Computer science
  • Engineering

Readers

  • Applied Combinatorial Optimization and Logic Circuit Design.
  • Educational Psychology
  • Parallel and Distributed Computing.