Affiliation:
1. Stanford University, Stanford, CA
Abstract
A major obstacle to finding program errors in a real system is knowing what correctness rules the system must obey. These rules are often undocumented or specified in an ad hoc manner. This paper demonstrates techniques that automatically extract such checking information from the source code itself, rather than the programmer, thereby avoiding the need for a priori knowledge of system rules.The cornerstone of our approach is inferring programmer "beliefs" that we then cross-check for contradictions. Beliefs are facts implied by code: a dereference of a pointer, p, implies a belief that p is non-null, a call to "unlock(1)" implies that 1 was locked, etc. For beliefs we know the programmer must hold, such as the pointer dereference above, we immediately flag contradictions as errors. For beliefs that the programmer may hold, we can assume these beliefs hold and use a statistical analysis to rank the resulting errors from most to least likely. For example, a call to "spin_lock" followed once by a call to "spin_unlock" implies that the programmer may have paired these calls by coincidence. If the pairing happens 999 out of 1000 times, though, then it is probably a valid belief and the sole deviation a probable error. The key feature of this approach is that it requires no a priori knowledge of truth:
if two beliefs contradict, we know that one is an error without knowing what the correct belief is
.Conceptually, our checkers extract beliefs by tailoring rule "templates" to a system --- for example, finding all functions that fit the rule template "
a
must be paired with
b
." We have developed six checkers that follow this conceptual framework. They find hundreds of bugs in real systems such as Linux and OpenBSD. From our experience, they give a dramatic reduction in the manual effort needed to check a large system. Compared to our previous work [9], these template checkers find ten to one hundred times more rule instances and derive properties we found impractical to specify manually.
Publisher
Association for Computing Machinery (ACM)
Reference23 articles.
1. M. Bishop and M. Dilger. Checking for race conditions in file accesses. Computing systems pages 131-152 Spring 1996.]] M. Bishop and M. Dilger. Checking for race conditions in file accesses. Computing systems pages 131-152 Spring 1996.]]
2. Bandera
Cited by
201 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Fuzzing API Error Handling Behaviors using Coverage Guided Fault Injection;Proceedings of the 19th ACM Asia Conference on Computer and Communications Security;2024-07
2. Automatic Repair of Quantum Programs via Unitary Operation;ACM Transactions on Software Engineering and Methodology;2024-06-28
3. DSHGT
: Dual-Supervisors Heterogeneous Graph Transformer - A pioneer study of using heterogeneous graph learning for detecting software vulnerabilities;ACM Transactions on Software Engineering and Methodology;2024-06-28
4. Diffy: Data-Driven Bug Finding for Configurations;Proceedings of the ACM on Programming Languages;2024-06-20
5. ValBench: Benchmarking Exact Value Analysis;Proceedings of the 13th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis;2024-06-20