Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.

Slides:



Advertisements
Similar presentations
Concurrency Issues Motivation, Problems, Directions Dennis Kafura - CS Operating Systems1.
Advertisements

Understanding and Detecting Real-World Performance Bugs
An Case for an Interleaving Constrained Shared-Memory Multi-Processor Jie Yu and Satish Narayanasamy University of Michigan.
Relaxed Consistency Models. Outline Lazy Release Consistency TreadMarks DSM system.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
Multiprocessor OS The functional capabilities often required in an OS for a multiprogrammed computer include the resource allocation and management schemes,
Guoliang Jin, Linhai Song, Wei Zhang, Shan Lu, and Ben Liblit University of Wisconsin–Madison Automated Atomicity- Violation Fixing.
/ PSWLAB Concurrent Bug Patterns and How to Test Them by Eitan Farchi, Yarden Nir, Shmuel Ur published in the proceedings of IPDPS’03 (PADTAD2003)
On-the-Fly Garbage Collection: An Exercise in Cooperation Edsget W. Dijkstra, Leslie Lamport, A.J. Martin and E.F.M. Steffens Communications of the ACM,
Chapter 3.5 Debugging Games
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.
Active Learning and Collaborative Filtering
CS444/CS544 Operating Systems Introduction to Synchronization 2/07/2007 Prof. Searleman
ADVERSARIAL MEMORY FOR DETECTING DESTRUCTIVE RACES Cormac Flanagan & Stephen Freund UC Santa Cruz Williams College PLDI 2010 Slides by Michelle Goodstein.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
Vertically Integrated Analysis and Transformation for Embedded Software John Regehr University of Utah.
Microsoft Research Faculty Summit Yuanyuan(YY) Zhou Associate Professor University of Illinois, Urbana-Champaign.
Heuristic Evaluation IS 485, Professor Matt Thatcher.
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
CS510 Concurrent Systems Class 5 Threads Cannot Be Implemented As a Library.
Slide 1 Testing Multivariate Assumptions The multivariate statistical techniques which we will cover in this class require one or more the following assumptions.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Exceptions and Mistakes CSE788 John Eisenlohr. Big Question How can we improve the quality of concurrent software?
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Concurrency: Deadlock and Starvation Chapter 6.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
What Change History Tells Us about Thread Synchronization RUI GU, GUOLIANG JIN, LINHAI SONG, LINJIE ZHU, SHAN LU UNIVERSITY OF WISCONSIN – MADISON, USA.
Predicting Accurate and Actionable Static Analysis Warnings: An Experimental Approach J. Ruthruff et al., University of Nebraska-Lincoln, NE U.S.A, Google.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Cooperative Concurrency Bug Isolation Guoliang Jin, Aditya Thakur, Ben Liblit, Shan Lu University of Wisconsin–Madison Instrumentation and Sampling Strategies.
Stat 1510: Sampling Distributions
Detecting and Eliminating Potential Violation of Sequential Consistency for concurrent C/C++ program Duan Yuelu, Feng Xiaobing, Pen-chung Yew.
Deadlock Analysis with Fewer False Positives Thread T1: sync(G){ sync(L1){ sync(L2){} } }; T3 = new T3(); j3.start(); J3.join(); sync(L2){ sync(L1){} }
EDCC-8 28 April 2010 Valencia, Spain MobiLab Roberto Natella, Domenico Cotroneo {roberto.natella,
Copyright © Curt Hill Concurrent Execution An Overview for Database.
Debugging Threaded Applications By Andrew Binstock CMPS Parallel.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Detecting Atomicity Violations via Access Interleaving Invariants
CAPP: Change-Aware Preemption Prioritization Vilas Jagannath, Qingzhou Luo, Darko Marinov Sep 6 th 2011.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Atom-Aid: Detecting and Surviving Atomicity Violations Brandon Lucia, Joseph Devietti, Karin Strauss and Luis Ceze LBA Reading Group 7/3/08 Slides by Michelle.
Soyeon Park, Shan Lu, Yuanyuan Zhou UIUC Reading Group by Theo.
Embedded System Lab. 최 진 화최 진 화 Kilmo Choi 최길모 A Study of Linux File System Evolution L. Lu, A. C. Arpaci-Dusseau, R. H. ArpaciDusseau,
Academic Year 2014 Spring Academic Year 2014 Spring.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
PRES: Probabilistic Replay with Execution Sketching on Multiprocessors Soyeon Park and Yuanyuan Zhou (UCSD) Weiwei Xiong, Zuoning Yin, Rini Kaushik, Kyu.
Tanakorn Leesatapornwongsa, Jeffrey F. Lukman, Shan Lu, Haryadi S. Gunawi.
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Tutorial 2: Homework 1 and Project 1
Learning from Mistakes: A Comprehensive Study on Real-World Concurrency Bug Characteristics Ben Shelton.
Healing Data Races On-The-Fly
Presented by: Daniel Taylor
Regression Testing with its types
CSC 591/791 Reliable Software Systems
Multiple Writers and Races
Effective Data-Race Detection for the Kernel
Chapter 12: Concurrency, Deadlock and Starvation
Threads and Memory Models Hal Perkins Autumn 2011
Synchronization Lecture 23 – Fall 2017.
References [1] LEAP:The Lightweight Deterministic Multi-processor Replay of Concurrent Java Programs [2] CLAP:Recording Local Executions to Reproduce.
Test Case Purification for Improving Fault Localization
A Comprehensive Study on Real World Concurrency Bugs in Node.js
Concurrency Bugs Questions answered in this lecture:
Threads and Memory Models Hal Perkins Autumn 2009
Dr. Mustafa Cem Kasapbaşı
Chapter 32 Concurrency Bugs
Concurrency: Mutual Exclusion and Process Synchronization
Speculative execution and storage
Presentation transcript:

Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared in ASPLOS’08 Presented by Michelle Goodstein LBA Reading Group 3/27/08

Introduction Multi-core computers are common More programmers are having to write concurrent programs Concurrent programs have different bugs than sequential programs However, without a study, hard to know what those bugs are First real-world study of concurrency bugs

Introduction Knowing the types of concurrent bugs that actually occur in software will: ◦ Help create better bug detection schemes ◦ Inform the testing process software goes through ◦ Provide information to program language designers

Introduction Current state of affairs ◦ Repeating concurrent bugs is difficult ◦ Test cases are critical to being able to diagnose a bug ◦ Most detection research focuses:  data races  deadlock bugs  some new work on detecting atomicity violations Few studies on real world concurrency bugs ◦ Most use programs that were buggy by design for the study Most studies on bug characteristics focus on non- concurrent bugs

Methodology 4 representative open-source applications: ◦ MySQL ◦ Apache ◦ Mozilla ◦ OpenOffice Each application has ◦ 9-13 years of development history ◦ 1-4 million lines of code

Methodology Randomly selected bugs from bug databases that contained at least one keyword related to concurrency (eg “race”, “concurrency”, “deadlock”, “synchronization”, etc.) From these, randomly choose 500 bugs that have ◦ Root causes explained well and in detail ◦ Source code available ◦ Bug fix info available

Methodology Remove any bugs not truly caused by concurrency Result: 105 concurrency bugs Separate study of deadlock and non- deadlock bugs

Methodology Evaluated bugs in 3 dimensions ◦ Bug pattern: {atomicity-violation, order- violation, other} ◦ Manifestation: required conditions for bug to occur, # threads involved, # variables, # accesses ◦ Bug fix strategy: Look at final patch, mistakes in intermediate patches, and whether TM can help Results organized as a collection of findings

Motivation 34/105 concurrency bugs cause program crashes 37/105 concurrency bugs cause programs to hang  Concurrency bugs are important

Bug Patterns

Findings: Bug Patterns Atomicity Violation Order Violation

Findings: Bug Patterns Most (72/74) of the examined non- deadlock concurrency bugs are either atomicity-violations or order-violations  Focusing on atomicity and order-violations should detect most non-deadlock concurrency bugs In fact, 24/74 are order violations  Since current tools don’t address order- violation, new tools must be developed

Bug Manifestations

Findings: Bug Manifestations Most (101/105) bugs involved ≤ 2 threads Most communication among a small number of threads Enforcing certain partial orderings among a small number of threads can expose bugs Heavy workloads can increase competition for resources, and make it more likely to observe a partial ordering that causes a bug  Pairwise Testing can find many bugs

Findings: Bug Manifestations Some (7/31) bugs experience deadlock bugs with only 1 thread!  Easy to detect/avoid

Findings: Bug Manifestations Many (49/74) non-deadlock bugs involve 1 variable. However, 34% involve ≥ 2 variables  Focusing on 1 variable is a good simplification  However, new tools also necessary to discover multivariable concurrency bugs

Findings: Bug Manifestations Most (30/31 ) deadlock bugs involved ≤ 2 resources  Pairwise testing of order among obtained and released resources should help reveal deadlocks

Findings: Bug Manifestations Most (92%) bugs manifested if enforced certain partial orderings among ≤ 4 memory accesses  Testing small groups of accesses will be polynomial time and expose most bugs

Bug Fixes

Findings: Bug Fixes Adding/changing locks only helps minority (20/74) non-deadlock concurrency bug fixes  Locks aren’t enough to fix all concurrency bugs.  Locks don’t promise ordering, just atomicity  Addition of locks can hurt performance or create new, deadlock bugs

Findings: Bug Fixes Most common fix (19/31) to deadlock bugs allows 1 thread to ignore acquiring a resource, like a lock  This may get rid of deadlock bugs, but create other non-deadlock bugs  Code may no longer be correct

Bug fixes: Buggy Patches 17/57 Mozilla bugs have ≥ 1 buggy patch On average, release.4 buggy patches for every final correct patch Of 23 distinct buggy patches for the 17 bugs: ◦ 6 decrease probability of occurrence but do not eliminate original bug ◦ 5create new concurrency bugs ◦ 12 create new non-concurrency bugs

Findings: Bug fixes In many (41/105) cases, TM can help avoid concurrency bugs

Findings: Bug fixes Also in many cases (44/105), TM might be able to help with concurrency bugs ◦ Need to allow long regions, rollback of I/O, strange “nature” of the code

Findings: Bug fixes In 20/105 cases, TM provides little help ◦ TM cannot help with many order-violation bugs  While TM could be useful in preventing concurrency bugs, it will not fix all of them

Conclusion First real-world concurrent bug study Multiple findings on ◦ Type of concurrency bugs ◦ Conditions for manifestation ◦ Techniques for fixing concurrent bugs Several heuristics proposed for: ◦ Bug detection ◦ Testing ◦ Language Design (ie, TM) Future work can focus on detecting common types of errors ◦ Multi-variable bugs ◦ Order violation bugs ◦ Multiple-access bugs