2004 · 139 citations · 38 references
ComputingComputer ScienceFault ToleranceFault-tolerant SystemsProgramming LanguagesControl-flow AnalysisData-flow AnalysisError DetectionError HandlingSoftware Fault ToleranceControl Flow ControlDataflow GraphsDataflow SemanticsException Control FlowException HandlingFlow AnalysisObligationsSafety Policies
It is di#cult to write programs that behave correctly in the presence of run-time errors. Existing programming language features often provide poor support for executing clean-up code and for restoring invariants in such exceptional situations. We present a dataflow analysis for finding a certain class of error-handling mistakes: those that arise from a failure to release resources or to clean up properly along all paths. Many real-world programs violate such resource safety policies because of incorrect error handling. Our flow-sensitive analysis keeps track of outstanding obligations along program paths and does a precise modeling of control flow in the presence of exceptions. Using it, we have found over 800 error handling mistakes almost 4 million lines of Java code. The analysis is unsound and produces false positives, but a few simple filtering rules su#ce to remove them in practice. The remaining mistakes were manually verified. These mistakes cause sockets, files and database handles to be leaked along some paths. We present a characterization of the most common causes of those errors and discuss the limitations of exception handling, finalizers and destructors in addressing them. Based on those errors, we propose a programming language feature that keeps track of obligations at run time and ensures that they are discharged. Finally, we present case studies to demonstrate that this feature is natural, e#cient, and can improve reliability; for example, retrofitting a 34kLOC program with it resulted in a 0.5% code size decrease, a surprising 17% speed increase (from correctly deallocating resources in the presence of exceptions) , and more consistent behavior.
38
Imperative functional programming
Simon Jones, Philip Wadler · 1993 · 1.2K citations · Full text
A unified approach to global program optimization
Gary A. Kildall · 1973 · 901 citations
Dawson Engler, David Yu Chen, Seth Hallem et al. · 2001 · 747 citations
Glenn Ammons, Rastislav Bodík, James R. Larus · 2002 · 669 citations · Full text