Looper: Lightweight Detection of Infinite Loops at Runtime Presenter: M. Amin Alipour Software Design Laboratory

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
PLDI’2005Page 1June 2005 Example (C code) int double(int x) { return 2 * x; } void test_me(int x, int y) { int z = double(x); if (z==y) { if (y == x+10)
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Paris, 3 Dec 2007MPRI Course on Concurrency MPRI – Course on Concurrency Lecture 12 Probabilistic process calculi Catuscia Palamidessi LIX, Ecole Polytechnique.
50.530: Software Engineering Sun Jun SUTD. Week 10: Invariant Generation.
1 MODULE name (parameters) “Ontology” “Program” “Properties” The NuSMV language A module can contain modules Top level: parameters less module Lower level.
1 Regression-Verification Benny Godlin Ofer Strichman Technion.
Recursion in Python. Recursion Problems in every area of life can be defined recursively, that is, they can be described in terms of themselves. An English.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter: M. Amin Alipour Software Design Laboratory
CSE503: SOFTWARE ENGINEERING SYMBOLIC TESTING, AUTOMATED TEST GENERATION … AND MORE! David Notkin Spring 2011.
1 Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
CS 536 Spring Run-time organization Lecture 19.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Program analysis Mooly Sagiv html://
DART Directed Automated Random Testing Patrice Godefroid, Nils Klarlund, and Koushik Sen Syed Nabeel.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
Validating High-Level Synthesis Sudipta Kundu, Sorin Lerner, Rajesh Gupta Department of Computer Science and Engineering, University of California, San.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Overview of program analysis Mooly Sagiv html://
Run-time Environment and Program Organization
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Describing Syntax and Semantics
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Dynamic Taint Analysis and Forward Symbolic Execution Ankush Tyagi.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 17: Code Mining.
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
DART: Directed Automated Random Testing Koushik Sen University of Illinois Urbana-Champaign Joint work with Patrice Godefroid and Nils Klarlund.
CUTE: A Concolic Unit Testing Engine for C Technical Report Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Wishnu Prasetya WLP for Automated Testing.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Symbolic Execution.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Great Theoretical Ideas in Computer Science.
More on Correctness. Prime Factorization Problem: Write a program that computes all the prime factors of a given number Solution (Idea): Factors are less.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015Information Security, CS 5261.
CS265: Dynamic Partial Order Reduction Koushik Sen UC Berkeley.
© The McGraw-Hill Companies, 2006 Chapter 3 Iteration.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
CUTE: A Concolic Unit Testing Engine for C Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION SYMBOLIC TESTING Autumn 2011.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 8: Static Analysis II Roman Manevich Ben-Gurion University.
Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex 1.
CSE 311 Foundations of Computing I
Reasoning about code CSE 331 University of Washington.
Great Theoretical Ideas in Computer Science
Semantics In Text: Chapter 3.
C. M. Overstreet Old Dominion University Spring 2006
CUTE: A Concolic Unit Testing Engine for C
C. M. Overstreet Old Dominion University Fall 2005
C. M. Overstreet Old Dominion University Fall 2007
Pointer analysis John Rollinson & Kaiyuan Li
Presentation transcript:

Looper: Lightweight Detection of Infinite Loops at Runtime Presenter: M. Amin Alipour Software Design Laboratory

Outline Problem Statement Motivating Example Basic Idea Solution in More Detail

Problem statement Dynamic Detection of Non-Terminating Loops – When a program does not responding if user knows whether it is in an infinite loop or making progress, she can decide to force the program to quit or wait and let it finishes its job.

Example Main() { x = foo(); y = bar(); while (x != 3 && y > 0) { x = (x * x + 2) % 10; y++; } This program will loop forever if foo() returns 6 and bar() returns 1.

Basic Idea Assumption: User Invokes the Looper when the program is unresponsive. Dynamic Instrumentation of running code Concolic Execution of program Basic Invariant Generation Construct non-terminating arguments Checking the argument with SMT solver

Example Main() { x = foo(); y = bar(); while (x != 3 && y > 0) { x = (x * x + 2) % 10; y++; } This program will loop forever if foo() returns 6 and bar() returns 1. while (x != 3 && y > 0) { x = (x * x + 2) % 10; y++; }  Assume Looper starts with x=8 and y=52  The symbolic execution treats variables x and y as symbolic inputs and infers that:  Starting X=8 and y>0, after iteration: x-->6 and y-->y+1 (It abstracts y and concretizes x )  Starting X=6 and y>0, after iteration x-->8 and y-->y+1.  It infers that these iterations follow each other and x will never be 3 and y will be positive, and the loop will run forever.

Mathematizations Assume M 0,c is initial concrete program state model Looper symbolically executes the program in parallel with one full concrete execution. After iteration 1 It produces M 1,Symbolic memory map after 1 st iteration Produces path constraint Φ 1 path constraint of execution path π 1 It tries to prove Φ 1 ==>Φ 1 [M 1 ] is tautology (done by an SMT solver)

General Formula Main() { x = foo(); y = bar(); while (x != 3 && y > 0) { x = (x * x + 2) % 10; y++; } This program will loop forever if foo() returns 6 and bar() returns 1. After iteration k It produces M k,Symbolic memory map after 1 st iteration Produces pah constraint Φ k path constraint of execution path π k It tries to prove Λ i Є [1,k] (Φ i ==>V jЄ [1,k] Φ j [M j ]) is tautology (done by an SMT solver) If it fails to prove after some fixed number it reports cannot conclude

Another example

Step 1 Abstract variable index Attempt Non-termination proof Symbolic Execution X

Step 3-5 Attempt for Non-termination proof fails for these steps, for example: Symbolic Execution X

Step 6 It proves Non-termination! Symbolic Execution results M 1

Programming Model and Concrete Semantics P::= Stmt* Stmt::= [l:] S S::= lhs=e | if p goto l’ | HALT e::= v | c| e op e p::= v comp v

Instrumentation Before InstrumentationAfter Instrumentation Initialization global vars M 0 =M I=0 global vars i =inputNumber= 0; Loop start i=i+1 if(i!=1) { M i = M; if(try_to proof(i)) Report non-termination; Exit; if(i==k) Report “Cannot conclude!” Exit; v=eIf (i==1) {inputNumber = inputNumber+1; initInput(&v, inputNumber);} execute symbolic(&v,“e”); M(v)=e v=e

Instrumentation-cntd InstrumentationAfter Instrumentation if (p) goto l evaluate_predicate(“p”, p); Upon result add p or !p to path constraints if (p) goto l V = new T If (i==1) {inputNumber = inputNumber+1; initInput(&v, inputNumber);} execute symbolic(&v,“ ﬩ ”); V.m=eM(V,M(m))=e;

References. Burnim, J., N. Jalbert, C. Sterigou, and K. Sen. “Looper: Lightweight Detection of Infinite Loops at Runtime ” Proc. 24th IEEE/ACM nternational Conference on Automated Software Engineering, Nov Sen, K., Marinov, D., and Agha, G CUTE: a concolic unit testing engine for C. In Proceedings of the 10th European Software Engineering Conference Held Jointly with 13th ACM SIGSOFT international Symposium on Foundations of Software Engineering (Lisbon, Portugal, September , 2005).