|
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, metalevel compilation (MC), 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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
M. Bishop and M. Dilger. Checking for race conditions in file accesses. Computing systems, pages 131-152, Spring 1996.
|
 |
2
|
|
| |
3
|
S. Chandra, M. Dahlia, B. Richards, R. Wang, T. Anderson, and J. Larus. Experience with a language for writing coherence protocols. In Proceedings of the First Conference on Domain Specific Languages, pages 51-65, October 1997.
|
 |
4
|
Shigeru Chiba, A metaobject protocol for C++, Proceedings of the tenth annual conference on Object-oriented programming systems, languages, and applications, p.285-299, October 15-19, 1995, Austin, Texas, United States
|
| |
5
|
A. Chou and D. Engier. Metal: a language and system for building lightweight, system-specific software checkers, analyzers and optimizers. 2000.
|
 |
6
|
James C. Corbett , Matthew B. Dwyer , John Hatcliff , Shawn Laubach , Corina S. Păsăreanu , Robby , Hongjun Zheng, Bandera: extracting finite-state models from Java source code, Proceedings of the 22nd international conference on Software engineering, p.439-448, June 04-11, 2000, Limerick, Ireland
[doi> 10.1145/337180.337234]
|
| |
7
|
R. F. Crew. ASTLOG: A language for examining abstract syntax trees. In Proceedings of the First Conference on Domain Specific Languages, pages 229-242, October 1997.
|
| |
8
|
D.L. Detlefs, R.M. Leino, G. Nelson, and J.B. Saxe. Extended static checking. TR SRC-159, COMPAQ SRC, December 1998.
|
| |
9
|
D. Engler, B. Chelf, A.C. Chou, and S. Hallem. A simple, effective method for checking and optimizing systems using system-specific, programmerwritten compiler extensions. To Appear in Operating Systems Design and Implementation (OSDI) 2000, April 2000.
|
| |
10
|
D.R. Engler. Incorporating application semantics and control into compilation. In Proceedings of the First Conference on Domain Specij~c Languages, October 1997.
|
| |
11
|
|
| |
12
|
R. W. Floyd. Assigning meanings to programs, pages 19-32. J.T. Schwartz, Ed. American Mathematical Society, 1967.
|
| |
13
|
|
| |
14
|
|
| |
15
|
M. Heinrich, D. Ofelt, M. Horowitz, and J. Hennessy. Hardware/software codesign of the stanford flash multiprocessor. Proceedings of the IEEE Special Issue on Hardware/Software Co-design, 85(3), March 1997.
|
| |
16
|
|
| |
17
|
|
| |
18
|
Intrinsa. A technical introduction to prefix/enterprise. Technical report, Intrinsa Corporation, 1998.
|
| |
19
|
A. Kolawa and A. Hicken. Insure++: A tool to support total quality software. http://ww~, parasoft, tom/insure/papers/ tech.htm.
|
 |
20
|
J. Kuskin , D. Ofelt , M. Heinrich , J. Heinlein , R. Simoni , K. Gharachorloo , J. Chapin , D. Nakahira , J. Baxter , M. Horowitz , A. Gupta , M. Rosenblum , J. Hennessy, The Stanford FLASH multiprocessor, Proceedings of the 21ST annual international symposium on Computer architecture, p.302-313, April 18-21, 1994, Chicago, Illinois, United States
|
| |
21
|
T. Lord. Application specific static code checking for C programs: Ctool. In ~twaddle: A Digital Zine (version 1.0), 1997.
|
| |
22
|
K.L. McMillan and J. Schwalbe. Formal verification of the gigamax cache consistency protocol. In Proceedings of the International Symposium on Shared Memory Multiprocessing, pages 242-51. Tokyo, Japan Inf. Process. Soc., 1991.
|
 |
23
|
Todd C. Mowry , Angela K. Demke , Orran Krieger, Automatic compiler-inserted I/O prefetching for out-of-core applications, Proceedings of the second USENIX symposium on Operating systems design and implementation, p.3-17, October 29-November 01, 1996, Seattle, Washington, United States
|
| |
24
|
G. Nelson. Techniques for program verification. Available as Xerox PARC Research Report CSL- 81-10, June, 1981, Stanford University, 1981.
|
 |
25
|
|
 |
26
|
|
 |
27
|
Vijayaraghavan Soundararajan , Mark Heinrich , Ben Verghese , Kourosh Gharachorloo , Anoop Gupta , John Hennessy, Flexible use of memory for replication/migration in cache-coherent DSM multiprocessors, Proceedings of the 25th annual international symposium on Computer architecture, p.342-355, June 27-July 02, 1998, Barcelona, Spain
|
 |
28
|
|
| |
29
|
|
|