Interactive Debugging QuickZoom: A State Alteration and Inspection-based Interactive Debugger 1.

Slides:



Advertisements
Similar presentations
Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Advertisements

Advanced Programming 15 Feb The “OI” Programming Process Reading the problem statement Thinking Coding + Compiling Testing + Debugging Finalizing.
Software & Services Group PinPlay: A Framework for Deterministic Replay and Reproducible Analysis of Parallel Programs Harish Patil, Cristiano Pereira,
IGOR: A System for Program Debugging via Reversible Execution Stuart I. Feldman Channing B. Brown slides made by Qing Zhang.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
RIVERSIDE RESEARCH INSTITUTE Helikaon Linux Debugger: A Stealthy Custom Debugger For Linux Jason Raber, Team Lead - Reverse Engineer.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
Program Slicing. 2 CS510 S o f t w a r e E n g i n e e r i n g Outline What is slicing? Why use slicing? Static slicing of programs Dynamic Program Slicing.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
Presented By: Krishna Balasubramanian
1 Appendix A: Writing and Submitting SAS ® Programs A.1 Writing and Submitting SAS Programs.
Continuously Recording Program Execution for Deterministic Replay Debugging.
CS 225 Lab #2 - Pointers, Copy Constructors, Destructors, and DDD.
2  Problem Definition  Project Purpose – Building Obfuscator  Obfuscation Quality  Obfuscation Using Opaque Predicates  Future Planning.
Homework Reading –Finish K&R Chapter 1 (if not done yet) –Start K&R Chapter 2 for next time. Programming Assignments –DON’T USE and string library functions,
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Debugging Cluster Programs using symbolic debuggers.
The Art of Debugging Shlomy Gantz 02/13/01MDCFUG.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
Support for Debugging Automatically Parallelized Programs Robert Hood Gabriele Jost CSC/MRJ Technology Solutions NASA.
1 ENERGY 211 / CME 211 Lecture 13 October 20, 2008.
Goals: To gain an understanding of assembly To get your hands dirty in GDB.
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
1 Causal-Consistent Reversible Debugging Ivan Lanese Focus research group Computer Science and Engineering Department University of Bologna/INRIA Bologna,
Time Warp State Saving and Simultaneous Events. Outline State Saving Techniques –Copy State Saving –Infrequent State Saving –Incremental State Saving.
Program Errors and Debugging Week 10, Thursday Lab.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
Testing and Debugging Session 9 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Debugging and Profiling With some help from Software Carpentry resources.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
References: “Pruning Dynamic Slices With Confidence’’, by X. Zhang, N. Gupta and R. Gupta (PLDI 2006). “Locating Faults Through Automated Predicate Switching’’,
Lecture Notes - Copyright © S. C. Kothari, All rights reserved.1 Efficient Debugging CPRE 556 Lecture 19.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Seminar of “Virtual Machines” Course Mohammad Mahdizadeh SM. University of Science and Technology Mazandaran-Babol January 2010.
Debugging Computer Networks Sep. 26, 2007 Seunghwan Hong.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
CISC Machine Learning for Solving Systems Problems Presented by: Suman Chander B Dept of Computer & Information Sciences University of Delaware Automatic.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
COP 3530 Spring2012 Data Structures & Algorithms Discussion Session Week 2.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
Source Level Debugging of Parallel Programs Roland Wismüller LRR-TUM, TU München Germany.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
Software testing techniques Software testing techniques REGRESSION TESTING Presentation on the seminar Kaunas University of Technology.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
DEBUG.
Free Transactions with Rio Vista
14 Compilers, Interpreters and Debuggers
CSE 374 Programming Concepts & Tools
Topic: Functions – Part 2
Deploying and Configuring SSIS Packages
Lab: ssh, scp, gdb, valgrind
Lab: ssh, scp, gdb, valgrind
Free Transactions with Rio Vista
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
Testing, debugging, and using support libraries
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Our Environment We will exercise on Microsoft Visual C++ v.6
Homework Reading Programming Assignments Finish K&R Chapter 1
CSE 303 Concepts and Tools for Software Development
Programming Logic and Design Eighth Edition
Presentation transcript:

Interactive Debugging QuickZoom: A State Alteration and Inspection-based Interactive Debugger 1

QZ DB Goal  QUICK: 2 State Inspection—Source Code Modification — Compile —Run From Beginning State Inspection—State Rollback—State Alteration

3 Faulty Program Zoom Faulty Function Faulty Statement/ Variable Zoom  ZOOM: QZ DB Goal

QZ DB Overview 4  State Inspection  State Alteration  State Rollback ZOOM QUICK

Debugging Process Incorrect Output or Crash ERROR Correct? 5 State Rollback State Alteration State Inspection

QZ DB features  State Alteration  predicate switching [ICSE 2006]  execution suppression [TOPLAS 2010]  State Inspection  record  dynamic slice [TOPLAS 2005]  prune  sbreak  conditional breakpoint  State Rollback  checkpoint  rollback 6

Add State Inspection Enabling Commands Set Checkpoint Set Record region Set breakpoints Perform State Inspection Compute Slice Navigate Slice Prune Slice Introduce State Alteration Commands Switch Commands Suppress Commands Execute program from Begin point Introduce new State Inspection Enabling Commands Sbreak Set Record Region Set Checkpoints Select New Begin Point && Rollback Execution ZOOM QUICK QZ DB Program Start

Predicate Switching The predicate switching interface allows programmers to dynamically change the outcome of a branch.  Benefit  root cause speculation  avoid source code modification, recompilation and re- execution  Interface  switch fileName:lineNum [all|once|n] all: switch the result of all the execution instances of this predicate once: only switch the result of next execution instance n: only switch the result of N-th execution instance 8

Predicate Switching-Example (qzdb) 1: for(i=0; i<N; i++) 2: { 3: if(i>j) 4: j++; 5: else 6: k++; 7: } (qzdb) list switch 3 all/once/4 9

Execution Suppression The execution suppression interface allows programmers to dynamically suppress the execution of some statement or function invocation.  Benefit  bug isolation and root cause speculation  avoid repeated source code modification, recompilation and re-execution  Interface  suppress fileName:lineNum [all|once|n] all: suppress all the execution instances of this statement once: only suppress the next execution instance n: only suppress the N-th execution instance 10

Execution Suppression-Example (qzdb) 1: for(i=0; i<N; i++) 2: { 3 array[i]=NULL; 4: } 5: do(); list suppress 3 all/once/2 11 suppress 5 all/once/1 (qzdb)

Dynamic Slice based State Inspection The dynamic slice interface allows programmers to construct a backwards dynamic slice for the given criterion.  Benefit  Programmers can only focus and speculate(through predicate switching or execution suppression) on bug- related statements, which are much less compared to the whole execution trace with traditional debuggers.  Enhance debugging efficiency  Interface  slice statement i variable|address [size]|register  slice statement i  slice statement 12

Record on/off The record interface allows programmers to designate interesting/suspicious code regions for logging and dynamic slicing. Predicate switching and execution suppression can suggest smaller suspicious code regions for record interface.  Benefit  Enhance logging and slicing efficiency  save programmers’ time and effort to inspect the slice and reason about the root cause  Interface  record on/off  record fileName:lineNum instance on/off 13

Example 1: p=…; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; //wrong sum Control Flow Graph Execution with N=1

Compute Dynamic Slice - Example 15 ( qzdb ) 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; (qzdb) slice 17 1 sum record on record off 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; Dynamic Slice 1: 17 1  14 1 due to sum 2: 14 1  12 1 due to j 3: 12 1  9 1 due to CD 4: 14 1  6 1 due to CD 5: 9 1  6 1 due to CD 6: 14 1  4 1 due to sum 7: 12 1  3 1 due to j 8: 9 1  2 1 due to i 9: 6 1  2 1 due to i Dynamic Slice

Prune Slice The prune interface allows programmers to exclude dependence edges regarding user-specified confident variables from the generated slice. It is useful when programmers are pretty sure that the values of some variables are correct.  Benefit  Irrelevant or less important statements can be significantly suppressed.  save programmers’ time and effort to inspect the slice and reason about the root cause  Interface  prune slice_id variable list 16

Prune Slice - Example 17 (qzdb) 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; (qzdb) slice 17 1 sum list record off 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; Pruned Dynamic Slice Slice Id=2 prune 2 i, j 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; Dynamic Slice Slice Id =2

Sbreak The sbreak interface allows programmers to generate a breakpoint at the statements in the slice.  Benefit  set breakpoints more efficiently and easily  Interface  sbreak slice_id s1,s2,...  sbreak slice_id all 18

breakpoint Slice - Example 19 1: p=x; 2: i=0; 3: j=3; 4: sum=0; 5: p=i+j; 6: while(i<N) 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; (qzdb) slice 17 1 sum record off 1: p=x; 2: i=0; 3: j=3; 4: sum=0; //insert a breakpoint 5: p=i+j; 6: while(i<N) //insert a breakpoint 7: { 8: w=p*2; 9: if(i>=1) 10: j++; 11: else 12: j--; 13: p+=j; 14: sum+=j; 15: i++; 16: } 17: k=sum; Pruned Dynamic Slice Slice Id =2 prune 2 i, j sbreak 2 s1, s2

Conditional Breakpoint The extended conditional breakpoint interface allows programmers to set conditional breakpoint for standard library functions, whose source code are often unavailable.  Benefit  Designed for memory-related bugs  selectively and efficiently capture critical library function invocations  Interface  breakpoint library function [if condition]  if write/read/access address [size] if argN|ret==value 20

Conditional Breakpoint-Example (qzdb) 1: str=malloc(N*sizeof(char)); //suppose checkpoint 3 is saved here 2: … 3: … 4: … 5: free(str); 6: … 7: p=str; 8: free(p); //suppose the address of p is Addr /*crash point*/ 21 rollback 3 list breakpoint malloc if ret==Addr breakpoint free if arg1==Addr breakpoint free if write Addr (qzdb)

State Rollback Interfaces The state rollback interfaces allows programmers to restore the program state to a previous point.  Benefit  useful for repeated debugging(repeated state inspection, state alteration in SAID)  avoid repeated execution from start  Interface  checkpoint  rollback checkpoint_id 22

Checkpoint & Rollback-Example (qzdb) 1: for(i=0; i<N; i++) 2: { 3 array[i]=NULL; 4: } 5: process(job); (qzdb) Checkpoint 2 at 0x80482b7: file tidy.c, line 1. You can rollback the program state to this checkpoint by rollback 2 list checkpoint (qzdb) 5: process(job); 6: … (qzdb) rollback 2 list 23

Case Studies Benchmark Overview

QZ DB Demo Stack Smashing bug in ncompress

Program Binary Programmer Remote Debugging Protocol KDbg GDB QZ DB – Implementation Dynamic Slicing Checkpoint &Rollback Other Commands Pin

QZ DB Implementation  GDB provides the monitor command for remote debugging. It can send arbitrary commands to the remote monitor and is designed for extending GDB. We use the monitor command to support the new commands implemented based on Pin.  monitor slice linenum instance variable  Modify GDB to preprocess the monitor command  mapping from source lines to program addresses (ref info line)  mapping from variable names to memory addresses(ref print &a)  Modify GDB to post-process the generated slice 27

Dynamic Slice Time &Space Overhead 28 ProgramMS/K instr.KB/K instr. tidy ncompress bc ghostscript tar

Future Plan  More State Alteration features  Insert a statement  Replacement a statement  Automatic patch source code  Combination of Slice and Reversible Debugging  Allow reverse execution along dependence edge  Easy forward and backward source code navigation along slice  User Studies  Comparison of debugging efficiency between QZ DB and GDB 29

Question? 30