Mining Behavior Graphs for Backtrace of Noncrashing Bugs Chao Liu, Xifeng Yan, Hwanjo Yu, Jiawei Han University of Illinois at Urbana-Champaign Philip.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Designing a Program & the Java Programming Language
Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
A Survey of Runtime Verification Jonathan Amir 2004.
1 Chao Wang, Yu Yang*, Aarti Gupta, and Ganesh Gopalakrishnan* NEC Laboratories America, Princeton, NJ * University of Utah, Salt Lake City, UT Dynamic.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Runtime Verification Ali Akkaya Boğaziçi University.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
Building a Better Backtrace: Techniques for Postmortem Program Analysis Ben Liblit & Alex Aiken.
Building a Better Backtrace: Techniques for Postmortem Program Analysis Ben Liblit & Alex Aiken.
1 Perracotta: Mining Temporal API Rules from Imperfect Traces Jinlin Yang David Evans Deepali Bhardwaj Thirumalesh Bhat Manuvir Das.
Software Model Checking for Embedded Systems PIs: Matthew Dwyer 1, John Hatcliff 1, and George Avrunin 2 Post-docs: Steven Seigel 2, Radu Iosif 1 Students:
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
CS590Z Statistical Debugging Xiangyu Zhang (part of the slides are from Chao Liu)
Statistical Debugging: A Tutorial Steven C.H. Hoi Acknowledgement: Some slides in this tutorial were borrowed from Chao Liu at UIUC.
Checking System Rules Using System-Specific, Programmer- Written Compiler Extensions Dawson Engler, Benjamin Chelf, Andy Chow, Seth Hallem Computer Systems.
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
MULTIVIE W Checking System Rules Using System-Specific, Program-Written Compiler Extensions Paper: Dawson Engler, Benjamin Chelf, Andy Chou, and Seth Hallem.
/* iComment: Bugs or Bad Comments? */
Types and Techniques of Software Testing
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
A Java Based Component Identification Tool for Measuring Circuit Protections James D. Parham J. Todd McDonald Michael R. Grimaila Yong C. Kim 1.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Mining Windows Kernel API Rules Jinlin Yang 09/28/2005CS696.
A Simple Method for Extracting Models from Protocol Code David Lie, Andy Chou, Dawson Engler and David Dill Computer Systems Laboratory Stanford University.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A clone detection approach for a collection of similar.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Bug Localization with Machine Learning Techniques Wujie Zheng
Richard Mancusi - CSCI 297 Static Analysis and Modeling Tools which allows further checking of software systems.
Dynamic Analysis of Multithreaded Java Programs Dr. Abhik Roychoudhury National University of Singapore.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
1 Model Checking of Robotic Control Systems Presenting: Sebastian Scherer Authors: Sebastian Scherer, Flavio Lerda, and Edmund M. Clarke.
Gedae, Inc. Gedae: Auto Coding to a Virtual Machine Authors: William I. Lundgren, Kerry B. Barnes, James W. Steed HPEC 2004.
1 Setuid Demystified Hao Chen David Wagner UC Berkeley Drew Dean SRI International Proceedings of the 11th USENIX Security Symposium San Francisco, California,
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
Algorithms and Problem Solving
YAHMD - Yet Another Heap Memory Debugger
The Software Development Cycle
Verification and Validation Overview
runtime verification Brief Overview Grigore Rosu
Jiawei Han and Micheline Kamber Department of Computer Science
Jiawei Han and Micheline Kamber Department of Computer Science
Mock Object Creation for Test Factoring
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
Software Verification and Validation
Software Verification and Validation
Algorithms and Problem Solving
Automated Analysis and Code Generation for Domain-Specific Models
Software Verification and Validation
Review of Previous Lesson
The Software Development Cycle
Presentation transcript:

Mining Behavior Graphs for Backtrace of Noncrashing Bugs Chao Liu, Xifeng Yan, Hwanjo Yu, Jiawei Han University of Illinois at Urbana-Champaign Philip S. Yu IBM T. J. Watson Research Presented by: Chao Liu

Outline Motivations Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Motivations Software is full of bugs –Windows 2000, 35M LOC 63,000 known bugs at the time of release, 2 per 1000 lines Software failure costs –Ariane 5 explosion is due to errors in the software of the inertial reference system (Ariaen-5 flight 501 inquiry board report –A study by the National Institute of Standards and Technology found that software errors cost the U.S. economy about $59.5 billion annually Testing and debugging are laborious and expensive –50% of my company employees are testers, and the rest spends 50% of their time testing! --Bill Gates, in 1995 Courtesy to CNN.com

Bug Localization Automatically circle out the most suspicious places Two kinds of bugs w.r.t. symptoms –Crashing bugs Typical symptoms: segmentation faults Reasons: memory access violations –Noncrashing bugs Typical symptoms: smooth executions but unexpected outputs Reasons: logic or semantic errors An example

Running Example Subject program –replace: perform regular expression matching and substitutions –563 lines of C code –17 functions are involved Execution behaviors –130 out of 5542 test cases fail to give correct outputs –No incorrect executions incur segmentation faults Debug method –Step-by-step tracing void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if (m >= 0){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if ((m >= 0) && (lastm != m) ){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; }

Debugging Crashes

Bug Localization via Backtrace Backtrace for noncrashing bugs? Major challenges –No abnormality is visible on the surface. –When and where the abnormality happens.

Outline Motivations Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Related Work Crashing bugs –Memory access monitoring Purify [HJ92], Valgrind [SN00], GDB … Noncrashing bugs –Static program analysis –Traditional model checking –Model checking source code

Static Program Analysis Methodology –Examine source code directly –Enumerate all the possible execution paths without running the program –Check user-specified properties, e.g. free(p) …… (*p) lock(res) …… unlock(res) receive_ack() … … send_data() Strengths –Check all possible execution paths Problems –Shallow semantics –Properties should be directly mapped to source code structure Tools –ESC [DRL+98], LCLint [EGH+94], ESP [DLS02], MC Checker [ECC00] … ×

Traditional Model Checking Methodology –Model program computation as finite state machines –It is described with a particular description language –Exhaustively explore all the reachable states in checking desired or undesired properties Strengths –Model deeper semantics –Naturally fit in checking event-driven systems, like protocols Problems –Significant amount of manual efforts in modeling –State space explosion Tools –SMV [M93], SPIN [H97], Murphi [DDH+92] …

Model Checking Source Code Methodology –Execute the real program in a sandbox (e.g., virtual machine) –Manipulate event happenings, e.g., Message incomings Return value of memory allocation Strengths –Less significant manual specification Problems –Application restrictions, e.g., Event-driven programs (still) Clear mapping between source code and logic event Tools –CMC [MPC+02], Verisoft [G97], Java PathFinder [BHP+-00] …

Summary of Related Work In summary, –Semantic inputs are necessary Program model Properties to be checked (all three methods) –Restricted application domain Event-driven model Properties are also event-related.

void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if (m > 0){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if (m >= 0){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } Example Revisited void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if (m >= 0){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if ((m >= 0) && (lastm != m) ){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } No memory violations Not event-driven program No explicit error properties

Outline Motivations Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Synopsis of Program Execution Program behavior graphs –Function-level abstraction of program behaviors –Function calls and transitions –First-order sequential information about function interactions int main(){... A();... B(); } int A(){... } int B(){... C()... } int C(){... }

Identification of Incorrect Executions A two-class classification problem –Every execution gives one behavior graph –Edges and closed frequent subgraphs as features Is classification useful? –Classification itself does not work for bug localization Classifier only labels each run as either correct or incorrect as a whole It does not tell when and where abnormality happens Observations –Good classifiers know the differences between correct and incorrect execution Difference, a kind of abnormality? –Where and when does abnormality happens? Incremental classification ?

Outline Motivations Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Incremental Classification Classification works only when instances from two classes are different. Precision as a measure of the difference. Incremental classification Observe accuracy dynamics

Illustration: Precision Boost main AA BC D B C D One Correct ExecutionOne Incorrect Execution EE F G F G H

Bug Relevance Precision boost –For each function F: Precision boost = Exit precision - Entrance precision. –Intuition & heuristics Differences take place within the execution of F Abnormality happens while F is in the stack The larger the boost, the more likely F is relevant to the bug Bug-relevant function

Outline Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Case Study Subject program –replace: perform regular expression matching and substitutions –563 lines of C code –17 functions are involved Execution behaviors –130 out of 5542 test cases fail to give correct outputs –No incorrect executions incur segmentation faults Task –Can we circle out the backtrace for this bug? void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if (m >= 0){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; } void subline(char *lin, char *pat, char *sub) { int i, lastm, m; lastm = -1; i = 0; while((lin[i] != ENDSTR)) { m = amatch(lin, i, pat, 0); if ((m >= 0) && (lastm != m) ){ putsub(lin, i, m, sub); lastm = m; } if ((m == -1) || (m == i)){ fputc(lin[i], stdout); i = i + 1; } else i = m; }

Precision Pairs

Backtrace for Noncrashing Bugs

Outline Motivations Related Work Classification of Program Executions Extract Backtrace from Classification Dynamics Case Study Conclusions

Identify incorrect executions from program runtime behaviors. Classification dynamics can give away backtrace for noncrashing bugs without any semantic inputs. Data mining can contribute to software engineering and system researches in general. Mining into Software and Systems?

References [DRL+98] David L. Detlefs, K. Rustan, M. Leino, Greg Nelson and James B. Saxe. Extended static checking, 1998 [EGH+94] David Evans, John Guttag, James Horning, and Yang Meng Tan. LCLint: A tool for using specifications to check code. In Proceedings of the ACM SIG-SOFT '94 Symposium on the Foundations of Software Engineering, pages 87-96, [DLS02] Manuvir Das, Sorin Lerner, and Mark Seigle. Esp: Path-sensitive program verication in polynomial time. In Conference on Programming Language Design and Implementation, [ECC00] D.R. Engler, B. Chelf, A. Chou, and S. Hallem. Checking system rules using system-specic, programmer-written compiler extensions. In Proceedings of the Fourth Symposium on Operating Systems Design and Implementation, October [M93] Ken McMillan. Symbolic Model Checking. Kluwer Academic Publishers, 1993 [H97] Gerard J. Holzmann. The model checker SPIN. Software Engineering, 23(5): , [DDH+92] David L. Dill, Andreas J. Drexler, Alan J. Hu, and C. Han Yang. Protocol verication as a hardware design aid. In IEEE International Conference on Computer Design: VLSI in Computers and Processors, pages , [MPC+02] Madanlal Musuvathi, David Y.W. Park, Andy Chou, Dawson R. Engler and David L. Dill. CMC: A Pragmatic Approach to Model Checking Real Code. In Proceedings of the fifth Symposium on Operating Systems Design and Implementation, 2002.

References (contd) [G97] P. Godefroid. Model Checking for Programming Languages using VeriSoft. In Proceedings of the 24th ACM Symposium on Principles of Programming Languages, 1997 [BHP+-00] G. Brat, K. Havelund, S. Park, and W. Visser. Model checking programs. In IEEE International Conference on Automated Software Engineering (ASE), [HJ92] R. Hastings and B. Joyce. Purify: Fast Detection of Memory Leaks and Access Errors in Proceeding of the fthe Winter 1992 USENIX Conference, pages San Francisco, California [SN00] Julian Seward and Nick Nethercote. Valgrind, an open-source memory debugger for x86-GNU/Linux [LLM+04] Zhenmin Li, Shan Lu, Suvda Myagmar, Yuanyuan Zhou. CP-Miner: A Tool for Finding Copy-paste and Related Bugs in Operating System Code, in Proceeding of the 6th Symposium of Operating Systems Design and Implementation, 2004 [LCS+04] Zhenmin Li, Zhifeng Chen, Sudarshan M. Srinivasan, Yuanyuan Zhou. C-Miner: Mining Block Correlations in Storage Systems. In proceeding of the 3rd usenix conferences on file and storage technologies, 2004

Q & A Thank You!