Understanding the Interleaving Space Overlap across Inputs and So7ware Versions

Similar documents
CFix. Automated Concurrency-Bug Fixing. Guoliang Jin, Wei Zhang, Dongdong Deng, Ben Liblit, and Shan Lu. University of Wisconsin Madison

Do you have to reproduce the bug on the first replay attempt?

RaceMob: Crowdsourced Data Race Detec,on

Ad Hoc Synchroniza/on Considered Harmful

Dynamic Race Detection with LLVM Compiler

Understanding and Genera-ng High Quality Patches for Concurrency Bugs. Haopeng Liu, Yuxi Chen and Shan Lu

Diagnosing Production-Run Concurrency-Bug Failures. Shan Lu University of Wisconsin, Madison

Leveraging the Short-Term Memory of Hardware to Diagnose Production-Run Software Failures. Joy Arulraj, Guoliang Jin and Shan Lu

Deterministic Replay and Data Race Detection for Multithreaded Programs

Slides by Y. Nir-Buchbinder, adapted by O. Agmon Ben-Yehuda 1/30

Embedded System Programming

Production-Run Software Failure Diagnosis via Hardware Performance Counters. Joy Arulraj, Po-Chun Chang, Guoliang Jin and Shan Lu

Chimera: Hybrid Program Analysis for Determinism

LDetector: A low overhead data race detector for GPU programs

Semantic Atomicity for Multithreaded Programs!

Fixing, preventing, and recovering from concurrency bugs

Berkeley Parlab P A R A L L E L C O M P U T I N G L A B O R A T O R Y

DoubleChecker: Efficient Sound and Precise Atomicity Checking

Yuxi Chen, Shu Wang, Shan Lu, and Karthikeyan Sankaralingam *

Optimistic Shared Memory Dependence Tracing

CS 153 Lab4 and 5. Kishore Kumar Pusukuri. Kishore Kumar Pusukuri CS 153 Lab4 and 5

MS Windows Concurrency Mechanisms Prepared By SUFIAN MUSSQAA AL-MAJMAIE

Predicting Data Races from Program Traces

PRINCIPLES OF OPERATING SYSTEMS

Automated Concurrency-Bug Fixing

A Serializability Violation Detector for Shared-Memory Server Programs

Tools zur Op+mierung eingebe2eter Mul+core- Systeme. Bernhard Bauer

TERN: Stable Deterministic Multithreading through Schedule Memoization

SQLite with a Fine-Toothed Comb. John Regehr Trust-in-So1 / University of Utah

Fast dynamic program analysis Race detection. Konstantin Serebryany May

Understanding the Interleaving-Space Overlap across Inputs and Software Versions

Synchronization. CS61, Lecture 18. Prof. Stephen Chong November 3, 2011

New features in AddressSanitizer. LLVM developer meeting Nov 7, 2013 Alexey Samsonov, Kostya Serebryany

Runtime Atomicity Analysis of Multi-threaded Programs

Hybrid Static-Dynamic Analysis for Statically Bounded Region Serializability

Analysing OpenMP Programs Inspector XE and Amplifier XE

Transaction Memory for Existing Programs Michael M. Swift Haris Volos, Andres Tack, Shan Lu, Adam Welc * University of Wisconsin-Madison, *Intel

Instrumentation and Sampling Strategies for Cooperative Concurrency Bug Isolation

CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1

ThreadSanitizer APIs for External Libraries. Kuba Mracek, Apple

Carnegie Mellon. Synchroniza+on : Introduc+on to Computer Systems Recita+on 14: November 25, Pra+k Shah (pcshah) Sec+on C

Evolving HPCToolkit John Mellor-Crummey Department of Computer Science Rice University Scalable Tools Workshop 7 August 2017

MPI Performance Analysis Trace Analyzer and Collector

Atomicity via Source-to-Source Translation

Lightweight Data Race Detection for Production Runs

Efficient Data Race Detection for Unified Parallel C

Automatically Classifying Benign and Harmful Data Races Using Replay Analysis

DataCollider: Effective Data-Race Detection for the Kernel

DMP Deterministic Shared Memory Multiprocessing

ConSeq: Detecting Concurrency Bugs through Sequential Errors

Formal Verification Techniques for GPU Kernels Lecture 1

Accelerating Dynamic Data Race Detection Using Static Thread Interference Analysis

Announcements. Cond Var: Review

Explicitly Parallel Programming with Shared Memory is Insane: At Least Make it Deterministic!

Kernel Debugging Techniques - Oops (Linux Driver Development) By Jie Deng

Software Architecture and Engineering: Part II

W4118: concurrency error. Instructor: Junfeng Yang

Introduction to Threads

Advanced Threads & Monitor-Style Programming 1/24

Threads Cannot Be Implemented As a Library

Mutual Exclusion and Synchronization

Statistical Debugging for Real-World Performance Problems

FastTrack: Efficient and Precise Dynamic Race Detection (+ identifying destructive races)

Accelerating Data Race Detection with Minimal Hardware Support

Speculative Synchronization

THREADS: (abstract CPUs)

Concurrency: Locks. Announcements

Implementing Locks. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

COMP6771 Advanced C++ Programming

LLFI: An Intermediate Code-Level Fault Injection Tool for Hardware Faults

Verifying Concurrent Programs

Can We Make It Faster? Efficient May-Happen-in-Parallel Analysis Revisited

CSE 374 Programming Concepts & Tools

Races. Example. A race condi-on occurs when the computa-on result depends on scheduling (how threads are interleaved)

Synchronization Spinlocks - Semaphores

Leveraging User Session Data to Support Web Applica8on Tes8ng

Light64: Ligh support for data ra. Darko Marinov, Josep Torrellas. a.cs.uiuc.edu

ProRace: Practical Data Race Detection for Production Use

Charlie Garrod Michael Hilton

Charlie Garrod Bogdan Vasilescu

Concurrency: Mutual Exclusion (Locks)

Hypergraph Sparsifica/on and Its Applica/on to Par//oning

CSC2/458 Parallel and Distributed Systems Scalable Synchronization

CROWDMARK. Examination Midterm. Spring 2017 CS 350. Closed Book. Page 1 of 30. University of Waterloo CS350 Midterm Examination.

Automatically Repairing Concurrency Bugs with ARC MUSEPAT 2013 Saint Petersburg, Russia

GPU Sparse Graph Traversal

Lightweight Fault Detection in Parallelized Programs

[537] Locks. Tyler Harter

Register Alloca.on Deconstructed. David Ryan Koes Seth Copen Goldstein

A unified machine-checked model for multithreaded Java

CS 450 Exam 2 Mon. 4/11/2016

Abstrac(ons for Middleboxes. à StonyBrook

Symbolic Execution, Dynamic Analysis

Maximal Causality Reduction for TSO and PSO. Shiyou Huang Jeff Huang Parasol Lab, Texas A&M University

Discussion CSE 224. Week 4

Case Study: Using Inspect to Verify and fix bugs in a Work Stealing Deque Simulator

Section 5: Thread Synchronization

Mul$- state systems CSCI 255: Introduc/on to Embedded Systems Keith Vertanen Copyright 2011

CS 537 Lecture 11 Locks

Charlie Garrod Bogdan Vasilescu

Transcription:

Understanding the Interleaving Space Overlap across Inputs and So7ware Versions Dongdong Deng, Wei Zhang, Borui Wang, Peisen Zhao, Shan Lu University of Wisconsin, Madison 1

Concurrency bug detec3on is cri3cal Concurrency bugs are a big problem Widely exist and cause severe damage [Northeast blackout, NasDaq] They only get worse MulI core machines are prevalent 2

Concurrency bug detec3on is costly Data race detecion incurs 10 200X slowdown SoOware many inputs to test Test all inputs again upon new version SoOware companies cannot afford thorough tesing Input Space Interleaving space Software evolving 3

How to speed up? Input Space Interleaving space Software evolving 4

Redundancy across inputs (example) Mozilla JavaScript Engine Thread 1 js_initatomstate( ){ state->table = ; if(state->table) iterate state->table; } Thread 2 js_freeatomstate(..){ ; state->table = NULL; } 5

Redundancy across inputs Thread 1 Thread 2 Input 1 Input 2 Synchronization Shared Memory Access How to find inputs' interleaving space overlap before heavy-weight detection? 6

We have an opportunity Interleaving Space Overlap across Inputs Race Detection 7

We have a problem Interleaving Space Analysis Interleaving Space Overlap across Inputs? 8

A solu3on Here are all my inputs.. 9

Contribu3ons CharacterisIcs study of bug detecion redundancy Among different inputs Among different versions A good metric to approximate interleaving space Concurrent Func3on Pairs Reasonably accurate in depicing interleaving space Lightweight in measurement CFP guided race detecion Similar ideas can be applied to regression test, etc. 10

Outline MoIvaIon Challenges CharacterisIcs study SoluIon in details Experiment EvaluaIon Conclusion 11

Characteris3cs Study Methodology 5 benchmarks wrixen in C/C++ Aget, Click, FFT, Mozilla and Pbzip2 One input set for each benchmark Developer designed: Click and Mozilla We designed: Aget, FFT and Pbzip2 Detect data races and atomicity violaions Exposed by every input Exposed by every version 12

Characteris3cs study Y-axis # of bugs X-axis Input id Bug detected by 2-4 inputs Bug detected by 8 inputs Harmful Data Race PBZIP2 Mozilla Please refer to our paper for more data 13

Characteris3cs study Y-axis # of bugs X-axis Input id Bug detected by 2-4 inputs Bug detected by 8 inputs Data Race (Benign & Harmful) PBZIP2 Mozilla Please refer to our paper for more data 14

Characteris3cs study Y-axis # of bugs X-axis Input id Bug detected by 2-4 inputs Bug detected by 8 inputs Bug detected by 1 input PBZIP2 Mozilla Please refer to our paper for more data 15

Characteris3cs study Y-axis # of bugs X-axis Input id Bug detected by 2-4 inputs Bug detected by 8 inputs Bug detected by 1 input PBZIP2 Mozilla Please refer to our paper for more data 16

Summary of characteris3cs study Applica3on # Inputs that expose the same bug Aget 6.67 1 Click 2.19 1 FFT 4.67 1 Mozilla 5.47 1 Pbzip2 4.17 1 17

Outline MoIvaIon Challenges CharacterisIcs study SoluIon in details Experiment EvaluaIon Conclusion 18

Overview Here are all my inputs.. CFP Detector Step 1 Step 2 Step 3 19

Concurrent Func3on Pair Thread 1 Thread 2 Shared Memory Access Lock Unlock Function CFP, Concurrent Function Pair, set of function pairs that can be potentially executed with each other 20

Step1 How to calculate CFP? Thread 1 Thread 2 Trace THD Addr Func 1 entry 0xab func1 1 exit 0xab func1 2 entry 0xab func2 2 lock 0xab 2 unlock 0xab 2 exit 0xab func2

Step2 Design tes3ng plan Goal: select inputs and functions to avoid redundant CFP coverage CFP of input 1 {f2, f4} {f4, f5} {f2, f3} {f1, f2} CFP Selection Result Input Selected Func 1 {f1, f2, f3, f4, f5} 2 {f3, f4, f5} {f3, f4} {f3, f5} CFP of input 3 CFP of input 2 22

Step3 CFP based Race Detec3on What do we instrument? Only instrument selected funcions for selected inputs. What data race detector do we use? Hybrid of Happen before & lock set 23

CFP based Bug Detec3on Methodology Here are all my inputs.. CFP Detector Step 1 Step 3 Step 2 LLVM C++ Pin 24

Input and func3on selec3on results Applica3on Input Sec3on Log size Reduc3on (%) Aget 3 ouf of 8 94% Click 6 out of 6 64% FFT 1 out of 8 83% Mozilla 7 out of 8 33% PBZIP2 2 out of 8 44% 25

Miss any failure inducing data race? 26

How much redundancy we reduced? Applica3on # Inputs that expose the same bug Aget 6.67 Click 2.19 FFT 4.67 Mozilla 5.47 Pbzip2 4.17 VS Applica3on # Inputs that expose the same bug Aget 1 Click 1.63 FFT 1 Mozilla 2.73 Pbzip2 1.16 27

How much 3me we saved? Applica3on Speedup (X) Aget 0.76 Click 2.14 FFT 7.13 Mozilla 1.27 PBZIP2 1.72 *The time in our approach is calculated as the sum of three steps introduced before 28

29 Extension to Regression Test Data Race Aget (Data Race) typedef struct hist_data { int bwritten; } hist_data; while(td->offset < foffset) { dw = pwrite( ); td->offset += dw; bwritten += dw; } 1 2 3 4 5 Version void save_log() { h.bwritten += bwritten; }

Conclusions Concurrency bug detecion results are redundant across inputs and sooware versions Concurrent funcion pair (CFP) is good coverage metric for interleaving space Lightweight Reasonably accurate CFP can be used to guide concurrency bug detecion across inputs and sooware versions 30

Future Work Applying CFP to help detect other types of bugs Preprocessing to get more accurate CFP Remove funcions that do not access shared variables Trying different heurisics for different tesing budgets Exploring other coverage metrics 31

Thanks! Wei Zhang hxp://pages.cs.wisc.edu/~wzh 32