230 likes | 255 Views
How to isolate cause of failure?. 2006.10.31 최윤라. Contents. Introduction Isolating relevant input Isolating relevant states Isolating the error Experiments Conclusions. ✘. ✘. ✘. ✘. ✘. This infection chain must be traced back – and broken. ✘. Introduction - From Defect to Failure.
E N D
How to isolate cause of failure? 2006.10.31 최윤라
Contents • Introduction • Isolating relevant input • Isolating relevant states • Isolating the error • Experiments • Conclusions
✘ ✘ ✘ ✘ ✘ This infection chain must be traced back – and broken. ✘ Introduction - From Defect to Failure • The programmer creates a defect– an error in the code. • When executed, the defect creates an infection –an error in the state. • The infection propagates. • The infection causes a failure. Variables t
Explaining Counterexamples • Error explanation: • Provides an explanation of a counterexample trace: a story about causality. • Fault localization: • Tells where the bug might be.
Related Works • Testing/automated debugging in general: • Renieris, Reiss: Fault Localization with Nearest Neighbor Queries (ASE 03) • Wotawa, others: Model based diagnosis of program errors • Slicing (dynamic/static) • Model checking: • Jin, Ravi, Somenzi: Fate and Free Will (TACAS 02) • Ball, Naik, Rajamani: From Symptom to Cause (POPL 03) • Groce, Visser: Error Explanation with Distance Metrics (TACAS 04) • Also, Chechik, et al.: proof-like counterexamples, temporal queries
Automated Tests • Allow for reuse of tests • Allow tests that are difficult to carry out manually • Make tests repeatable • Increase confidence in software
Failure cause Isolating Relevant Input
Causes as Differences Actual world empty: GCC works fine Alternate world fail.c: GCC crashes Cause: fail.c
Actual Causes “The” cause (actual cause) is a minimal difference Actual cause
✔ ? Isolating Causes Alternate world Actual world ✘ Test Mixed world
Isolating Causes Alternate world Actual world “+ 1.0” ✔ ✘ ? Test Mixed world
Delta Debugging Configuration Goal • isolates failure-inducing difference • : 1-minimal
Delta Debugging (cont.) dd algorithm
Isolating Relevant States • Differences accumulate during execution: • How do we isolate the relevant state differences?
Memory Graph • Extract program states as graph. • Vertices are variables, edges are references.
Isolating the GCC Cause-Effect • HOWCOME components
The process in a Nutshell • Comparable States? • Current PC and backtrace of the two locations must be identical.
GCC cause-effect chain • HOWCOME starts with three events, occurring in both r and r • After the program start • When cc1 reaches the function main • In the middle of the program run • When cc1 reaches combine_instructions • Shortly before the failure • When cc1 reaches if_then_else_cond
Isolating Errors • Narrowing at conbine_instructions • Narrowing down relevant events
www.askigor.org Submit buggy pgm Specify invocations Click on “Debug it” Diagnosis comes via e-mail
Conclusions • Pros • Cause-effect chains explain the causes of program failures automatically and effectively. • Systematic experimentation leads to much higher precision than “classical analysis”. • Via automation, debugging becomes a well-understood, systematic discipline. • Cons • We need a passing executions as a reference. • Large testing costs can be prohibitive • Preventing bugs is still an issue!