Department of Computer Sciences Dynamic Shape Analysis via Degree Metrics Maria Jump & Kathryn S. McKinley Department of Computer Sciences The University.

Slides:



Advertisements
Similar presentations
Basics of Recursion Programming with Recursion
Advertisements

1 Verification by Model Checking. 2 Part 1 : Motivation.
Thursday, November 1, 2001(c) 2001 Ibrahim K. El-Far. All rights reserved.1 Enjoying the Perks of Model-based Testing Ibrahim K. El-Far Florida Institute.
1 Parametric Heap Usage Analysis for Functional Programs Leena Unnikrishnan Scott D. Stoller.
kareRCIserIsviFIsaRsþGnuvtþKMerag
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Addition Facts
Using Checkers for End-User Shape Analysis National Taiwan University – August 11, 2009 Bor-Yuh Evan Chang 張博聿 University of Colorado, Boulder If some.
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Configuration management
Uncovering Performance Problems in Java Applications with Reference Propagation Profiling PRESTO: Program Analyses and Software Tools Research Group, Ohio.
Runtime Techniques for Efficient and Reliable Program Execution Harry Xu CS 295 Winter 2012.
S-Curves & the Zero Bug Bounce:
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
Executional Architecture
Texas Skyward User Group Conference Boot Camp For Administrators: Discipline Kim Lyons Santa Fe ISD.
Addition 1’s to 20.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Let’s take a 15 minute break Please be back on time.
Module 12 WSP quality assurance tool 1. Module 12 WSP quality assurance tool Session structure Introduction About the tool Using the tool Supporting materials.
University of Minnesota Optimizing MapReduce Provisioning in the Cloud Michael Cardosa, Aameek Singh†, Himabindu Pucha†, Abhishek Chandra
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
Techniques for proving programs with pointers A. Tikhomirov.
Data Structures Using C++ 2E
Chapter 9: Using Classes and Objects. Understanding Class Concepts Types of classes – Classes that are only application programs with a Main() method.
Program Slicing – Based Techniques
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Department of Computer Sciences Cork: Dynamic Memory Leak Detection with Garbage Collection Maria Jump Kathryn S. McKinley
CORK: DYNAMIC MEMORY LEAK DETECTION FOR GARBAGE- COLLECTED LANGUAGES A TRADEOFF BETWEEN EFFICIENCY AND ACCURATE, USEFUL RESULTS.
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://
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Bell: Bit-Encoding Online Memory Leak Detection Michael D. Bond Kathryn S. McKinley University of Texas at Austin.
Overview of program analysis Mooly Sagiv html://
Tolerating Memory Leaks Michael D. Bond Kathryn S. McKinley.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Revolutionizing the Field of Grey-box Attack Surface Testing with Evolutionary Fuzzing Department of Computer Science & Engineering College of Engineering.
Design Space Exploration
Control Flow Resolution in Dynamic Language Author: Štěpán Šindelář Supervisor: Filip Zavoral, Ph.D.
CSCA48 Course Summary.
1 Fast and Efficient Partial Code Reordering Xianglong Huang (UT Austin, Adverplex) Stephen M. Blackburn (Intel) David Grove (IBM) Kathryn McKinley (UT.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.
Page 1 5/2/2007  Kestrel Technology LLC A Tutorial on Abstract Interpretation as the Theoretical Foundation of CodeHawk  Arnaud Venet Kestrel Technology.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
Chapter 1 Introduction Major Data Structures in Compiler
An Axiomatic Basis for Computer Programming Robert Stewart.
Department of Computer Sciences ISMM No Bit Left Behind: The Limits of Heap Data Compression Jennifer B. Sartor* Martin Hirzel †, Kathryn S. McKinley*
CoCo: Sound and Adaptive Replacement of Java Collections Guoqing (Harry) Xu Department of Computer Science University of California, Irvine.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.
Introduction to Software Analysis CS Why Take This Course? Learn methods to improve software quality – reliability, security, performance, etc.
1Computer Sciences Department. 2 Advanced Design and Analysis Techniques TUTORIAL 7.
R-Verify: Deep Checking of Embedded Code James Ezick † Donald Nguyen † Richard Lethin † Rick Pancoast* (†) Reservoir Labs (*) Lockheed Martin The Eleventh.
Tracking Bad Apples: Reporting the Origin of Null & Undefined Value Errors Michael D. Bond UT Austin Nicholas Nethercote National ICT Australia Stephen.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
Dynamic Bug Detection & Tolerance Kathryn S McKinley The University of Texas at Austin.
Advanced Computer Systems
YAHMD - Yet Another Heap Memory Debugger
Software Verification and Validation
Cork: Dynamic Memory Leak Detection with Garbage Collection
runtime verification Brief Overview Grigore Rosu
Yikes! Why is my SystemVerilog Testbench So Slooooow?
Presentation transcript:

Department of Computer Sciences Dynamic Shape Analysis via Degree Metrics Maria Jump & Kathryn S. McKinley Department of Computer Sciences The University of Texas at Austin

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Software is Dynamic Software is always changing New expectations New algorithms New applications New users New notions of what is cool Limited only by human ambition First Law of Software: Software is a gas! It expands to fit the container it is in! [Nathan Myhrvold, Former CTO, Microsoft]

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Software Complexity Developed by large teams Few, if any, understand all parts Need tools to help Property of a system that is directly proportional to the difficulty one has in comprehending the system at a level and detail necessary to make changes without introducing instability or functional regressions [Peter Rosser, Microsoft Software Engineer]

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Code + Data Program = Program Analysis Software complexity leads to heap complexity

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Heap Complexity Exacerbated by modern languages Objects are smaller and more numerous Most objects allocated on the heap Objects encode program state Heap contains semantic, memory, and concurrency bugs Program analysis is incomplete without heap analysis

Department of Computer Sciences 20-Jun-2009 Jump & McKinley An Opportunity Automatic memory management examines live data on a regular basis Understand heap usage Detect heap-based bugs Optimize program based on heap usage Opportunity to perform heap analysis dynamically

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Shape Analysis Characterize the shape of heap-allocated pointer-based data structures and verify shape-preserving properties

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Shape Analysis Code + Data Program = Static Conservatively characterizes all possible shapes at every program point Only works on small programs Dynamic Discover shape of current data structure Generate assertions for verification Monitor shape during entire execution

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Shape Analysis % of Heap LinkedHashMap: 99.3% OctTree: 98% BinaryTree: 35.8% HashMap: 59.5% Custom Library Custom: 33% Library: 58%

Department of Computer Sciences 20-Jun-2009 Jump & McKinley ShapeUp Desired goals Discover shape of current data structure Discover dynamic invariants Monitor expected shape of current data structure during execution Heap summarization graph [POPL 07] Class field-wise graph (CFWG) Identifies recursive data structures (RDS) Summarize dynamic degree invariants

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Class Field-Wise Graph (CFWG) Heap Home-brewed data structure from SPECjbb2000 (simplified) CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Class Field-Wise Graph (CFWG) Heap Home-brewed data structure from SPECjbb2000 (simplified) CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Class Field-Wise Graph (CFWG) Heap Home-brewed data structure from SPECjbb2000 (simplified) CFWG Degree Metrics

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Degree Metrics Degree metrics per instance: Out-degree: # of outgoing references In-degree: # of incoming references Only count edges between objects of same class Use word in header to track in-degree of backbone objects Summarize by class per data structure instance in a degree profile

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=1

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=1

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=1

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=2

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=2

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=2

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=3

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=3

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=3

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=4

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=5

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=6

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=6

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=6

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=7

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=8

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=9

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=9

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=9

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=10

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=10

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=10

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=11

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=12

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=13

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=13

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=13

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=14

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG n=15

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile constant range n Complete Binary Tree CFWG

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Calculating Degree Profile CFWG left right constant range Complete Binary Tree

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Interpreting Degree Profile Monitoring degree profile shows errors: Error: constant violation Warning: range violation [min-,max+] Indicate problem with RDS during development and testing Monitor shape after deployment for dynamically introduced errors What kind of errors can be detected?

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Implementation and Methodology Jikes RVM SPECjvm98, DaCapo, SPECjbb2000 Heap composition Showed degree metric are stable by class Overheads <8% total time <1% space overhead [used bits in header] Microbenchmarks Single RDS in isolation Random error injection Singly-linked list Doubly-linked list Binary Tree Binary Tree w/ PP

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Looking for errors TRAINING Ran microbenchmark 100 times Merged together dynamic invariants ERROR DETECTION Created RDS with 100,000 nodes Errors: 1, 2, 3, 4, 5, 10, 50, and 100 Detected dynamic invariant violations

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Doubly-linked List =0=1=2 in02n-2 out02n-2 circle cyclic disconnect skip

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Doubly-linked List =0=1=2 in02n-2 out02n-2

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Binary Tree =0=1=2 Complete Binary Tree in1 n-10 out[50.0,50.2]0[49.8,50.0] Full Binary Tree in1n-10 out[50.0,50.1]0[49.9,50.0] Random Binary Tree in1n-10 out[33.6,35.7][28.7,35.1][32.3,35.6] link

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Binary Tree =0=1=2 Complete Binary Tree in1 n-10 out[50.0,50.2]0[49.8,50.0] Full Binary Tree in1n-10 out[50.0,50.1]0[49.9,50.0] Random Binary Tree in1n-10 out[33.6,35.7][28.7,35.1][32.3,35.6]

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Binary Tree w/ PP =1=2=3 Complete Binary Tree w/ PP in[50.0,50.0]2[49.9,50.0] out[50.0,50.0]2[49.9,50.0] Full Binary Tree w/ PP in[50.0,50.1]1[49.9,50.0] out[50.0,50.1]1[49.9,50.0] Random Binary Tree w/ PP in[33.8,35.2][30.0,32.6][33.6,34.8] out[33.8,35.2][30.0,32.6][33.6,34.8] link disconnect

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Microbenchmark: Binary Tree w/ PP

Department of Computer Sciences 20-Jun-2009 Jump & McKinley ShapeUps Contributions Performs dynamic heap analysis to determine shape of current data structure Summarizes degree metrics using a class field-wise graph with low overheads Shows whole-heap degree metrics are not stable, but class degree metrics are Introduces degree profiles for RDS Regular RDS have more invariants than random RDS Degree profiles can detect some shape errors Thank You!

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Thank You!

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Space Overhead jessEclipse Geomean # of types bm+VM avg max # of edges avg max Increased Alloc %0.094%0.167%0.233% 19% 2.7X 0.233%

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Time Overhead Normalized Total Time Heap Size Relative to Minimum

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Singly-linked List circle := attaches head to tail cyclic := creates a cycle from tail to random node =0=1 in1n-1 out1n-1 Detection %

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Microbenchmark: HashMap =0=1=2 in[31.9,51.6][48.4,68.1]{0} out[31.9,51.6][48.4,68.1]{0} link := creates a connection between buckets from a null ptr to a random entry

Department of Computer Sciences 20-Jun-2009 Jump & McKinley Data Structures in Benchmarks BenchmarkRDS NodeL or H?% Raytrace OctNode H78.0 Jack LinkedHashMap$LinkedHashEntry L44.2 RuntimeNfaState H9.4 Antlr Object[] H76.2 Bloat HashMap$HashEntry L56.6 CallMethodExpr H3.7 Eclipse LinkedHashmap$LinkedHashEntry L59.0 AND_AND_Expression H0.4 Fop HashMap$HashEntry L51.4 PropertyList H4.4 Jython Pyframe H94.6 Luindex LinkedHashMap$LinkedHashEntry L99.3 Lusearch WeakHashMap$WeakBucket L47.5 HitDoc H2.0 Xalan ChildIterator H34.6