Finding the Weakest Characterization of Erroneous Inputs Dzintars Avots and Benjamin Livshits.

Slides:



Advertisements
Similar presentations
Chapter 26 Testing Bjarne Stroustrup
Advertisements

Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 1 Summer school on Formal Models.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Abstraction of Source Code (from Bandera lectures and talks)
Semantics Static semantics Dynamic semantics attribute grammars
Delta Debugging and Model Checkers for fault localization
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
Predicate Abstraction and Canonical Abstraction for Singly - linked Lists Roman Manevich Mooly Sagiv Tel Aviv University Eran Yahav G. Ramalingam IBM T.J.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
Symbolic execution © Marcelo d’Amorim 2010.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Introducing BLAST Software Verification John Gallagher CS4117.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
David Brumley, Pongsin Poosankam, Dawn Song and Jiang Zheng Presented by Nimrod Partush.
(c) 2007 Mauro Pezzè & Michal Young Ch 7, slide 1 Symbolic Execution and Proof of Properties.
Partial correctness © Marcelo d’Amorim 2010.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
(Quickly) Testing the Tester via Path Coverage Alex Groce Oregon State University (formerly NASA/JPL Laboratory for Reliable Software)
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Towards a Lightweight Model of BGP Safety Matvey Arye Princeton University Joint work with: Rob Harrison, Richard Wang, Jennifer Rexford (Princeton) Pamela.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main.
Program analysis Mooly Sagiv html://
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Overview of program analysis Mooly Sagiv html://
Type Inference: CIS Seminar, 11/3/2009 Type inference: Inside the Type Checker. A presentation by: Daniel Tuck.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Software Design & Development Software Design & Development Programming Types Event Driven Programming Event driven programming Is a type of programming.
CSC2108 Lazy Abstraction on Software Model Checking Wai Sum Mong.
Finding Optimum Abstractions in Parametric Dataflow Analysis Xin Zhang Georgia Tech Mayur Naik Georgia Tech Hongseok Yang University of Oxford.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
June 27, 2002 HornstrupCentret1 Using Compile-time Techniques to Generate and Visualize Invariants for Algorithm Explanation Thursday, 27 June :00-13:30.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
Aditya V. Nori, Sriram K. Rajamani Microsoft Research India.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Race Checking by Context Inference Tom Henzinger Ranjit Jhala Rupak Majumdar UC Berkeley.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
1 Bisimulations as a Technique for State Space Reductions.
Reasoning about programs March CSE 403, Winter 2011, Brun.
Integrating high-level constructs into programming languages Language extensions to make programming more productive Underspecified programs –give assertions,
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
Learning Symbolic Interfaces of Software Components Zvonimir Rakamarić.
“Isolating Failure Causes through Test Case Generation “ Jeremias Rößler Gordon Fraser Andreas Zeller Alessandro Orso Presented by John-Paul Ore.
Localization and Register Sharing for Predicate Abstraction Himanshu Jain Franjo Ivančić Aarti Gupta Malay Ganai.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Intro to Planning Or, how to represent the planning problem in logic.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Error Explanation with Distance Metrics Authors: Alex Groce, Sagar Chaki, Daniel Kroening, and Ofer Strichman International Journal on Software Tools for.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
Boolean Programs: A Model and Process For Software Analysis By Thomas Ball and Sriram K. Rajamani Microsoft technical paper MSR-TR Presented by.
Compositional Verification part II Dimitra Giannakopoulou and Corina Păsăreanu CMU / NASA Ames Research Center.
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
Reasoning and Design (and Assertions). How to Design Your Code The hard way: Just start coding. When something doesn’t work, code some more! The easier.
Weakest Precondition of Unstructured Programs
Spring 2016 Program Analysis and Verification
Reasoning About Code.
Reasoning about code CSE 331 University of Washington.
Symbolic Implementation of the Best Transformer
Reduction in End-User Shape Analysis
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
The Zoo of Software Security Techniques
COP4020 Programming Languages
Presentation transcript:

Finding the Weakest Characterization of Erroneous Inputs Dzintars Avots and Benjamin Livshits

The Art of Hiding Your Sources Our approach: fleece as many papers as possible Our approach: fleece as many papers as possible You will most likely find similarities with: You will most likely find similarities with: Korat: Automated Testing Based on Java Predicates Korat: Automated Testing Based on Java Predicates Korat: Automated Testing Based on Java Predicates Korat: Automated Testing Based on Java Predicates Automatic Predicate Abstraction of C Programs Automatic Predicate Abstraction of C Programs Automatic Predicate Abstraction of C Programs Automatic Predicate Abstraction of C Programs From Symptom to Cause: Localizing Errors in Counterexample Traces From Symptom to Cause: Localizing Errors in Counterexample Traces From Symptom to Cause: Localizing Errors in Counterexample Traces From Symptom to Cause: Localizing Errors in Counterexample Traces Parametric shape analysis via 3-valued logic Parametric shape analysis via 3-valued logic Parametric shape analysis via 3-valued logic Parametric shape analysis via 3-valued logic Weakest precondition reasoning, etc. Weakest precondition reasoning, etc.

Problem Statement A lot of static tools produce error traces A lot of static tools produce error traces Metal Metal Intrinsa Intrinsa Others Others However, testing for false negatives in error traces is often hard However, testing for false negatives in error traces is often hard Why? Why? Need to determine if the error trace is feasible Need to determine if the error trace is feasible How to trigger that particular path? How to trigger that particular path? What conditions on the input and environment need to hold? What conditions on the input and environment need to hold?

More Concrete Examples Comes from (real) research motivation Comes from (real) research motivation Buffer overruns (last year’s FSE) Buffer overruns (last year’s FSE) A buffer overrun is a “tainted” user value copied to a statically sized buffer A buffer overrun is a “tainted” user value copied to a statically sized buffer Generated buffer overruns across many procedure invocations Generated buffer overruns across many procedure invocations How to test if it may actually be exploitable? How to test if it may actually be exploitable? Fault injection in Java (current research) Fault injection in Java (current research) Introduce “bad” values into the system Introduce “bad” values into the system Start with HttpRequest Start with HttpRequest Populate its fields Populate its fields Push the request through the system Push the request through the system See if we get an exception thrown See if we get an exception thrown

Exploring Possibilities Assume: varying the input influences the outcome Assume: varying the input influences the outcome Input: Input: string buffers string buffers elements of a Java structures elements of a Java structures Korat: Korat: try “small” inputs and see what happens try “small” inputs and see what happens Want: Want: weakest condition on the input that always causes a failure weakest condition on the input that always causes a failure

Observations Would be nice to have summarized representations of input which leads to definite failure, or definite success Would be nice to have summarized representations of input which leads to definite failure, or definite success Could use TVLA to show whether this input succeeds or fails, or both Could use TVLA to show whether this input succeeds or fails, or both Can we automatically derive classes of inputs through program analysis? Can we automatically derive classes of inputs through program analysis?

Properties: Int_val(u1) > 0, char_val(u2) >0, char_val(u3)=0 Properties: Int_val(u1) > 0, char_val(u2) >0, char_val(u3)=0 Edges: “is followed by” Edges: “is followed by” Represents: 5“abcde\0”, 1“x\0”, etc. Represents: 5“abcde\0”, 1“x\0”, etc. Current stream position also represented Current stream position also represented Stores describe program input u1u1 u2u2 stdin u3u3

Imitating Pred Abstraction Define predicate update formula using predicates satisfying weakest precondition Define predicate update formula using predicates satisfying weakest precondition pred’ = WP(pred)  ¬ WP( ¬ pred)1/2 pred’ = WP(pred)  ¬ WP( ¬ pred)  1/2 Enforce construct is taken care of by TVLA coerce optimization Enforce construct is taken care of by TVLA coerce optimization

Problems Length properties Length properties How to compare lengths of summarized lists with iterator position How to compare lengths of summarized lists with iterator position Deriving input shape Deriving input shape Input store properties are initially unknown Input store properties are initially unknown Reads “create” or reuse input nodes Reads “create” or reuse input nodes Branch conditions assert properties of input shape – which isn’t that interesting if “unknown” Branch conditions assert properties of input shape – which isn’t that interesting if “unknown”

Where do we need precision? Local pointer relations (same as before) Local pointer relations (same as before) Current stream position Current stream position Relevant branch condition predicates Relevant branch condition predicates If (x) { if (y) …; FAIL(); else…; } else { if (y) …; FAIL(); else…;} y is relevant, x is not ? y is relevant, x is not ? What if ( ¬ x,y) and (x, ¬ y) are both infeasible? What if ( ¬ x,y) and (x, ¬ y) are both infeasible?

Classifying Predicates Classify of all paths through program: Classify of all paths through program: Erroneous “evil” paths Erroneous “evil” paths Good paths Good paths Classify all predicates in the program: Classify all predicates in the program: P 1 : Located on erroneous paths only P 1 : Located on erroneous paths only P 0 : Located on good paths only P 0 : Located on good paths only P 1/2 : Located on both types of paths P 1/2 : Located on both types of paths (most fall in the last category) (most fall in the last category)

Iteratively Run TVLA I = P 0  P 1 ; // set of instrumentation predicates do { 1. use I as instrumentation predicates 1. use I as instrumentation predicates 2. run TVLA on the program 2. run TVLA on the program 3. add input TVLA structures leading to error to S 3. add input TVLA structures leading to error to S 4. include more predicates into I if have ½ values 4. include more predicates into I if have ½ values } while ( I changes && not tired yet ) ; // simplify structures leading to error w = empty foreach (configuration c in S){ OR c with w// w is the weakest input leading to error OR c with w// w is the weakest input leading to error}

Bottom Line Identify weakest input w leading to errors Identify weakest input w leading to errors TVLA provides a sound proof that it will always lead to an error TVLA provides a sound proof that it will always lead to an error Have a choice of which predicates to add to I next, can try heuristics Have a choice of which predicates to add to I next, can try heuristics Get a qualitatively much stronger answer that Korat Get a qualitatively much stronger answer that Korat