Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan.

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Pallavi Joshi  Chang-Seo Park  Koushik Sen  Mayur Naik ‡  Par Lab, EECS, UC Berkeley‡
1 Chao Wang, Yu Yang*, Aarti Gupta, and Ganesh Gopalakrishnan* NEC Laboratories America, Princeton, NJ * University of Utah, Salt Lake City, UT Dynamic.
HW/Study Guide. Synchronization Make sure you understand the HW problems!
Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets Tayfun Elmas 1, Shaz Qadeer 2, Serdar Tasiran 1 1 Koç University, İstanbul,
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO and THOMAS ANDERSON.
Serverless Network File Systems. Network File Systems Allow sharing among independent file systems in a transparent manner Mounting a remote directory.
Dynamic Data Race Detection. Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs –Stefan Savage, Michael Burrows, Greg Nelson, Patric.
SOS: Saving Time in Dynamic Race Detection with Stationary Analysis Du Li, Witawas Srisa-an, Matthew B. Dwyer.
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
ADVERSARIAL MEMORY FOR DETECTING DESTRUCTIVE RACES Cormac Flanagan & Stephen Freund UC Santa Cruz Williams College PLDI 2010 Slides by Michelle Goodstein.
Cormac Flanagan and Stephen Freund PLDI 2009 Slides by Michelle Goodstein 07/26/10.
S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, B. Calder UCSD and Microsoft PLDI 2007.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
TaintCheck and LockSet LBA Reading Group Presentation by Shimin Chen.
CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads.
CS533 Concepts of Operating Systems Class 3 Monitors.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
DTHREADS: Efficient Deterministic Multithreading
PRASHANTHI NARAYAN NETTEM.
Cormac Flanagan UC Santa Cruz Velodrome: A Sound and Complete Dynamic Atomicity Checker for Multithreaded Programs Jaeheon Yi UC Santa Cruz Stephen Freund.
Synchronization CSCI 444/544 Operating Systems Fall 2008.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 2006 Exterminator: Automatically Correcting Memory Errors Gene Novark, Emery Berger.
DETECTION OF POTENTIAL DEADLOCKS AND DATARACES ROZA GHAMARI Bogazici UniversityMarch 2009.
Rahul Sharma (Stanford) Michael Bauer (NVIDIA Research) Alex Aiken (Stanford) Verification of Producer-Consumer Synchronization in GPU Programs June 15,
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Accelerating Precise Race Detection Using Commercially-Available Hardware Transactional Memory Support Serdar Tasiran Koc University, Istanbul, Turkey.
AADEBUG MUNCHEN Non-intrusive on-the-fly data race detection using execution replay Michiel Ronsse - Koen De Bosschere Ghent University - Belgium.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
R Environment and Variable Lookup Apr R Environment and Variable Lookup Outline  R Environment and Variable Lookup  R Byte-Code Interpreter.
Chapter 4 Memory Management Virtual Memory.
Aritra Sengupta, Swarnendu Biswas, Minjia Zhang, Michael D. Bond and Milind Kulkarni ASPLOS 2015, ISTANBUL, TURKEY Hybrid Static-Dynamic Analysis for Statically.
Dynamic Data Race Detection. Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs –Stefan Savage, Michael Burrows, Greg Nelson, Patric.
Kernel Locking Techniques by Robert Love presented by Scott Price.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Ali Kheradmand, Baris Kasikci, George Candea Lockout: Efficient Testing for Deadlock Bugs 1.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Threads and Singleton. Threads  The JVM allows multiple “threads of execution”  Essentially separate programs running concurrently in one memory space.
HARD: Hardware-Assisted lockset- based Race Detection P.Zhou, R.Teodorescu, Y.Zhou. HPCA’07 Shimin Chen LBA Reading Group Presentation.
Eraser: A dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson Presenter:
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Institute for Software Technology Professor Horst Cerjak, Roderick Bloem V&T 02Dynamic Algorithms for Concurrency Verification & Testing Dynamic.
Using Escape Analysis in Dynamic Data Race Detection Emma Harrington `15 Williams College
FastTrack: Efficient and Precise Dynamic Race Detection [FlFr09] Cormac Flanagan and Stephen N. Freund GNU OS Lab. 23-Jun-16 Ok-kyoon Ha.
Embedded Real-Time Systems
Detecting Data Races in Multi-Threaded Programs
W4118 Operating Systems Instructor: Junfeng Yang.
Presenter: Godmar Back
Processes and threads.
Chapter 14: System Protection
CS533 Concepts of Operating Systems Class 3
Effective Data-Race Detection for the Kernel
Threads and Memory Models Hal Perkins Autumn 2011
Threads and Memory Models Hal Perkins Autumn 2009
CS533 Concepts of Operating Systems Class 3
CSE 451: Operating Systems Autumn 2003 Lecture 7 Synchronization
CSE 451: Operating Systems Autumn 2005 Lecture 7 Synchronization
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization
Eraser: A dynamic data race detector for multithreaded programs
Pointer analysis John Rollinson & Kaiyuan Li
Chapter 8 & 9 Main Memory and Virtual Memory
Presentation transcript:

Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan Holder2014

Presentation Outline About the Authors What is Eraser? Why is Eraser Important? Background & Related Work Happens-Before Eraser Algorithm Eraser Implementation Experiences Evaluation 2

About the Authors Savage and Anderson (UCB) were at U. Washington. Burrows, Nelson, and Sobalvarro were at Digital Equipment Corporation. Cited by 387 (according to ACM DL) including RaceMob and PARROT. Each averages over 35 cites per article. Eraser their most or second most cited article. 3

What is Eraser? Detects data races in a multithreaded program dynamically. Allows developers to easily find and correct concurrency bugs. Works by monitoring data accesses at a very low level and observing locking patterns. 4

Why is Eraser Important? Basically the first to use lock set idea instead of Happens-Before. Lock set is relatively low overhead compared to Happens-Before, albeit less accurate. Leads to future work combining the two approaches for both speed and reliability (FastTrack by Flanagan and Freund in PLDI 2009). 5

Background What’s a data race? One (or more) thread(s) writes as another thread tries to read or write at the same time. No synchronization mechanism (lock). Unclear who executes first and what final value is read/written. Very hard to debug! 6

Related Work Largely compared to Happens- Before relationships by Lamport in Monitors by Hoare in Lock covers by Dinning and Schonberg in NOT Eraser by Mellon and Crummey in

Happens-Before Within a thread, execution order generates event order. Between threads, synchronization events generate a partial order based on shared resource access. 8

Happens-Before 9 Thread X Thread Y Thread Z Time 0 … Time n Lock(a) Modify Unlock(a) Lock(a) Modify Unlock(a) Lock(a) Modify Unlock(a) Lock(a) Modify Unlock(a) Lock(b) Modify Unlock(b) Lock(b) Modify Unlock(b)

Eraser Algorithm Initialize set of candidate locks to all locks for each shared variable and held locks to empty set. On an access, change the set of candidate locks to be the former set’s intersection with the currently held locks. 10

Example 11 Thread X Thread Y Held Locks | Candidates Time 0 … Time n Lock(a) Modify(var1) Unlock(a) Lock(b) Modify(var1) Unlock(b) {} | U a | U^a = a b | a^b = {}

Improvement 12 Ignore initialization. Allow read sharing. Only remove read locks on the second thread write.

Failure 13 Thread X Thread Y Held Locks | Candidates Time 0 … Time n Allocate(var1) Set thread Y to modify var1 Start thread Y Modify(var1) {} | U If this mod is 1 st, no race detected. If this mod is 1 st, race detected and output. Potential for race regardless.

Eraser Implementation Instruments loads and stores for checking the set of candidate locks. Instruments lock acquire and release and thread initialization and finalization for checking locks held. Instruments storage allocator calls for dynamic data. 14

Output On a race detection (no locks held during access) the following is reported: File and line number. Backtrace of stack frames. Thread ID Memory Address and Access Type Program Counter and Stack Pointer 15

Shadow Words Correspond to real data words in stack and heap. Contain lockset index (30-bit) or thread ID and state condition (2- bit). Lockset index points to hash table entry for the distinct set of locks held. 16

False Alarm Annotations EraserIgnoreOn/Off for disabling benign race output. EraserReuse for resetting shadow memory when using internal memory allocators. EraserReadLock/Unlock and EraserWriteLock/Unlock for communicating private lock usage. 17

AltaVista Experience Programs Tested Ni2 (9) and ft (5) Mhttpd (10) False Positives Avoid locking overhead Finalization checks Global Statistics 18

Vesta Cache Server Experience Valid Fingerprint Boolean False Positives (10) CacheS Free List Flush TCP_sock and SRPC Objects 19

Petal Experience Server Running State Checks False Positives (several) Private Reader-Writer Locks Global Statistics Stack Memory Reuse on Forking 20

Undergraduate Assignments Experience 10% data races detected across runnable assignments. False Positives (1) Locked Head and Tail in Queue 21

Experiences Dependent on test runs versus absolute relationships. “Easy to use” Promising results with deadlock- checking. 22

Evaluation Novelty Lock sets instead of Happens-Before. Importance Much faster. Handles dynamic data. Works on large and small scale code bases. 23

Evaluation Negatives Still not that fast. Doesn’t specify how to fix the problem (later papers actually tell how or do it themselves). Measurements aren’t similar and are arbitrarily ran. LOTS of false positives. 24

Questions 25