Cormac Flanagan and Stephen Freund PLDI 2009 Slides by Michelle Goodstein 07/26/10.

Slides:



Advertisements
Similar presentations
CS492B Analysis of Concurrent Programs Lock Basics Jaehyuk Huh Computer Science, KAIST.
Advertisements

Relaxed Consistency Models. Outline Lazy Release Consistency TreadMarks DSM system.
Race Detection for Android Applications
Conditional Must Not Aliasing for Static Race Detection Mayur Naik Alex Aiken Stanford University.
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.
Scalable and Precise Dynamic Datarace Detection for Structured Parallelism Raghavan RamanJisheng ZhaoVivek Sarkar Rice University June 13, 2012 Martin.
Multiple-Writer Distributed Memory. The Sequential Consistency Memory Model P1P2 P3 switch randomly set after each memory op ensures some serial order.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO and THOMAS ANDERSON.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
Hastings Purify: Fast Detection of Memory Leaks and Access Errors.
Scaling Model Checking of Dataraces Using Dynamic Information Ohad Shacham Tel Aviv University IBM Haifa Lab Mooly Sagiv Tel Aviv University Assaf Schuster.
Asynchronous Assertions Eddie Aftandilian and Sam Guyer Tufts University Martin Vechev ETH Zurich and IBM Research Eran Yahav Technion.
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.
/ PSWLAB Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs By Cormac Flanagan, Stephen N. Freund 24 th April, 2008 Hong,Shin.
Efficient On-the-Fly Data Race Detection in Multithreaded C++ Programs Eli Pozniansky & Assaf Schuster.
ADVERSARIAL MEMORY FOR DETECTING DESTRUCTIVE RACES Cormac Flanagan & Stephen Freund UC Santa Cruz Williams College PLDI 2010 Slides by Michelle Goodstein.
S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, B. Calder UCSD and Microsoft PLDI 2007.
Threading Part 2 CS221 – 4/22/09. Where We Left Off Simple Threads Program: – Start a worker thread from the Main thread – Worker thread prints messages.
C. FlanaganSAS’04: Type Inference Against Races1 Type Inference Against Races Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College.
Efficient dynamic race detection int x; void * t1(){ x = 2; } void * t2(){ x = 3; } main(){ pthread_create( t1 ); pthread_create( t2 ); printf( “x is %d\n”,
C. Flanagan1Atomicity for Reliable Concurrent Software - PLDI'05 Tutorial Atomicity for Reliable Concurrent Software Joint work with Stephen Freund Shaz.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
Parallelizing Data Race Detection Benjamin Wester Facebook David Devecsery, Peter Chen, Jason Flinn, Satish Narayanasamy University of Michigan.
Cormac Flanagan UC Santa Cruz Velodrome: A Sound and Complete Dynamic Atomicity Checker for Multithreaded Programs Jaeheon Yi UC Santa Cruz Stephen Freund.
A Parallel, Real-Time Garbage Collector Author: Perry Cheng, Guy E. Blelloch Presenter: Jun Tao.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Deterministic Replay of Java Multithreaded Applications Jong-Deok Choi and Harini Srinivasan slides made by Qing Zhang.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
TreadMarks Distributed Shared Memory on Standard Workstations and Operating Systems Pete Keleher, Alan Cox, Sandhya Dwarkadas, Willy Zwaenepoel.
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.
- 1 - Dongyoon Lee, Peter Chen, Jason Flinn, Satish Narayanasamy University of Michigan, Ann Arbor Chimera: Hybrid Program Analysis for Determinism * Chimera.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan.
Buffered dynamic run-time profiling of arbitrary data for Virtual Machines which employ interpreter and Just-In-Time (JIT) compiler Compiler workshop ’08.
CDP 2013 Based on “C++ Concurrency In Action” by Anthony Williams, The C++11 Memory Model and GCCThe C++11 Memory Model and GCC Wiki and Herb Sutter’s.
/ PSWLAB Type-Based Race Detection for J AVA by Cormac Flanagan, Stephen N. Freund 22 nd Feb 2008 presented by Hong,Shin Type-Based.
50.530: Software Engineering Sun Jun SUTD. Week 8: Race Detection.
DoubleChecker: Efficient Sound and Precise Atomicity Checking Swarnendu Biswas, Jipeng Huang, Aritra Sengupta, and Michael D. Bond The Ohio State University.
Ch 10 Shared memory via message passing Problems –Explicit user action needed –Address spaces are distinct –Small Granularity of Transfer Distributed Shared.
Dynamic Data Race Detection. Sources Eraser: A Dynamic Data Race Detector for Multithreaded Programs –Stefan Savage, Michael Burrows, Greg Nelson, Patric.
Drinking from Both Glasses: Adaptively Combining Pessimistic and Optimistic Synchronization for Efficient Parallel Runtime Support Man Cao Minjia Zhang.
Dataflow Analysis for Concurrent Programs using Datarace Detection Ravi Chugh, Jan W. Voung, Ranjit Jhala, Sorin Lerner LBA Reading Group Michelle Goodstein.
Michael Bond Katherine Coons Kathryn McKinley University of Texas at Austin.
Detecting Atomicity Violations via Access Interleaving Invariants
HARD: Hardware-Assisted lockset- based Race Detection P.Zhou, R.Teodorescu, Y.Zhou. HPCA’07 Shimin Chen LBA Reading Group Presentation.
Aritra Sengupta, Man Cao, Michael D. Bond and Milind Kulkarni PPPJ 2015, Melbourne, Florida, USA Toward Efficient Strong Memory Model Support for the Java.
® July 21, 2004GC Summer School1 Cycles to Recycle: Copy GC Without Stopping the World The Sapphire Collector Richard L. Hudson J. Eliot B. Moss Originally.
Eraser: A dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson Presenter:
Correctness of parallel programs Shaz Qadeer Research in Software Engineering CSEP 506 Spring 2011.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
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.
1 Written By: Adi Omari (Revised and corrected in 2012 by others) Memory Models CDP
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
December 1, 2006©2006 Craig Zilles1 Threads & Atomic Operations in Hardware  Previously, we introduced multi-core parallelism & cache coherence —Today.
Presenter: Godmar Back
Atomic Operations in Hardware
Atomic Operations in Hardware
Store Recycling Function Experimental Results
Chapter 9: Virtual-Memory Management
Mark Claypool and Jonathan Tanner Computer Science Department
Jipeng Huang, Michael D. Bond Ohio State University
Dynamic Race Prediction in Linear Time
Eraser: A dynamic data race detector for multithreaded programs
Presentation transcript:

Cormac Flanagan and Stephen Freund PLDI 2009 Slides by Michelle Goodstein 07/26/10

Eraser/LockSet algorithms are fast but imprecise Suffer from false positives Vector-clock (VC) data race detectors are precise but slow Want: Fast and precise FastTrack

Don’t always need full power of VCs Majority of data: Thread local Lock protected Read shared Common cases: O(1) fast path General case: No loss of precision/correctness

Epoch: (VC, t), t  Tid, x  Var, m  Lock Operations: rd(t,x), wr(t,x), aq(t,m), rel(t,m), fork(t,t’), join(t,t’) Trace of operations: α sequence of ops performed by threads Happens before < α : smallest transitively closed relation such that a < α b holds when a occurs before b in α because of: Program order Locking Fork-join

V 1 < V 2 if V 1 (t) ≤ V 2 (t) for all t (happens-before rltn) Each thread, lock has own vector clock C t Increment own clock on lock release Lock VCs are updated on acquire/release ops Thread t releases lock m: Copy C t to C m Thread t’ acquires lock m: C t’ = max t (C t’ (t), C m (t))  t Each location x gets 2VCs – 1 for reads, 1 for writes R x (t), W x (t) record last read, write to x by thread t Read from x by thread t is race-free if W x ≤ C t All writes happen-before current read

Observation: writes are totally ordered until a data race detected Only guarantee to detect first data race on loc x Detect: Write-Write race No race detected on x so far? Only need clock c and thread t of writer Epoch: : O(1) space for epochs ≤ V iff c ≤ V(t) : O(1) comparison time Detect: Write-Read race Check W x ≤ C t

Detect: Read-Write race Reads not guaranteed ordered in race-free program In practice: thread-local, lock-protected reads ordered Typically, reads only unordered when read-shared Adaptive representation: If read is ordered, record epoch of last read If read not ordered, store entire VC Can still perform epoch-VC comparison in O(1) time

Read-Same-Epoch: x already read this epoch  no work Read-Exclusive: current read happens-after prior read epoch  update read epoch Read-Share: current read may be concurrent with prior read  allocate VC to record epochs of both reads Read-Shared: x already shared (already tracking VC)  update VC

Read-Same-Epoch: (63.4% of reads) x already read this epoch  no work Read-Exclusive: (15.7% of reads) current read happens-after prior read epoch  update read epoch Read-Share: (0.1% of reads) current read may be concurrent with prior read  allocate VC to record epochs of both reads Read-Shared: (20.8% of reads) x already shared (already tracking VC)  update VC

Write-Same-Epoch: x already written this epoch  no change Write-Exclusive: If R x is an epoch, R x,W x ≤ C t  update write epoch Write-Shared: R x is a VC, R x,W x ≤ C t  update write epoch, set R x to “empty” epoch

Write-Same-Epoch: (71% of writes) x already written this epoch  no change Write-Exclusive: (28.9% of writes) If R x is an epoch, R x,W x ≤ C t  update write epoch Write-Shared: (0.1% of writes) R x is a VC, R x,W x ≤ C t  update write epoch, set R x to “empty” epoch

Acquire, Release, Fork, Join: Rare Use full VCs Correct/Precise: FastTrack reports data races iff detects concurrent conflicting accesses

RoadRunner Like DBI but for Java Instruments bytecode at runtime 32 bit epochs 8 bit tid 24 bit clock could also use 64-bit

7 dynamic analyses: Empty RoadRunner overhead FastTrack Eraser (+ barrier synch) DJIT + MultiRace DJIT + lock set Update lock set for locn on first access in epoch Full VC comparisons after lockset empty Imprecision/unsoundness from eraser GoldiLocks Precise race detector Tracks synch devices & threads Requires tight integration with VM, garbage collector BasicVC Read, Write VCs per mem location All implemented on RoadRunner

Benchmarks: 16 Apple Mac Pro Dual-3Ghz quad-core Pentium Xeon Processors 12 GB memory OSX , Java Hotspot 64-bit Server VM v1.6.0 JVM startup time excluded Report at most one race per field in a class or array access in program source

Interesting potential lifeguard Performance of eraser, precision of VC-based algorithm Unclear how will perform on non-Java platform?

Init: empty (bottom) epochs Write-exclusive Read-Exclusive due to fork Read-Share Write-Shared happens-after b/c of join Read-Exclusive