CS 263 Course Project1 Survey: Type Systems for Race Detection and Atomicity Feng Zhou, 12/3/2003.

Slides:



Advertisements
Similar presentations
Types for Atomicity Authors: Cormac Flanagan, UC Santa Cruz Stephen Freund, Marina Lifshin, Williams College Shaz Qadeer, Microsoft Research Presentation.
Advertisements

1 Chao Wang, Yu Yang*, Aarti Gupta, and Ganesh Gopalakrishnan* NEC Laboratories America, Princeton, NJ * University of Utah, Salt Lake City, UT Dynamic.
Reduction, abstraction, and atomicity: How much can we prove about concurrent programs using them? Serdar Tasiran Koç University Istanbul, Turkey Tayfun.
Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets Tayfun Elmas 1, Shaz Qadeer 2, Serdar Tasiran 1 1 Koç University, İstanbul,
Verification of Multithreaded Object- Oriented Programs with Invariants Bart Jacobs, K. Rustan M. Leino, Wolfram Schulte.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO and THOMAS ANDERSON.
Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs Stephen Freund Williams College Cormac Flanagan University of California, Santa Cruz.
Taming Win32 Threads with Static Analysis Jason Yang Program Analysis Group Center for Software Excellence (CSE) Microsoft Corporation.
CS 11 java track: lecture 7 This week: Web tutorial:
Types for Atomicity in Multithreaded Software Shaz Qadeer Microsoft Research (Joint work with Cormac Flanagan)
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
C. Flanagan1Types for Atomicity Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College Shaz Qadeer Microsoft Research Analysis of Concurrent.
/ PSWLAB Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs By Cormac Flanagan, Stephen N. Freund 24 th April, 2008 Hong,Shin.
CS444/CS544 Operating Systems Synchronization 2/16/2006 Prof. Searleman
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.
TaintCheck and LockSet LBA Reading Group Presentation by Shimin Chen.
Atomicity: A powerful concept for analyzing concurrent software Shaz Qadeer Microsoft Research.
C. FlanaganTypes for Race Freedom1 Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College Shaz Qadeer Microsoft Research Analysis of Concurrent.
CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads.
C. FlanaganAtomicity for Reliable Concurrent Software - PLDI'05 Tutorial1 Atomicity for Reliable Concurrent Software Part 3a: Types for Race-Freedom and.
C. FlanaganSAS’04: Type Inference Against Races1 Type Inference Against Races Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College.
Mayur Naik Alex Aiken John Whaley Stanford University Effective Static Race Detection for Java.
Modular Verification of Multithreaded Software Shaz Qadeer Compaq Systems Research Center Shaz Qadeer Compaq Systems Research Center Joint work with Cormac.
C. FlanaganDynamic Analysis for Atomicity1. C. Flanagan2Dynamic Analysis for Atomicity Atomicity The method inc() is atomic if concurrent threads do not.
C. Flanagan1Atomicity for Reliable Concurrent Software - PLDI'05 Tutorial Atomicity for Reliable Concurrent Software Joint work with Stephen Freund Shaz.
Runtime Atomicity Analysis of Multi-threaded Programs Focus is on the paper: “Atomizer: A Dynamic Atomicity Checker for Multithreaded Programs” by C. Flanagan.
Types for Atomicity in Multithreaded Software Cormac Flanagan Systems Research Center HP Labs.
1 RELAY: Static Race Detection on Millions of Lines of Code Jan Voung, Ranjit Jhala, and Sorin Lerner UC San Diego speaker.
CS533 Concepts of Operating Systems Class 3 Monitors.
1 Sharing Objects – Ch. 3 Visibility What is the source of the issue? Volatile Dekker’s algorithm Publication and Escape Thread Confinement Immutability.
1 A Modular Checker for Multithreaded Programs Cormac Flanagan HP Systems Research Center Joint work with Shaz Qadeer Sanjit A. Seshia.
Thread-Modular Verification Shaz Qadeer Joint work with Cormac Flanagan Stephen Freund Shaz Qadeer Joint work with Cormac Flanagan Stephen Freund.
Verifying Commit-Atomicity Using Model Checking Cormac Flanagan University of California, Santa Cruz.
Part II: Atomicity for Software Model Checking. Class Account { int balance; static int MIN = 0, MAX = 100; bool synchronized deposit(int n) { int t =
0wn3rship Types John Whaley CS343 Stanford University May 19, 2004.
Cormac Flanagan UC Santa Cruz Velodrome: A Sound and Complete Dynamic Atomicity Checker for Multithreaded Programs Jaeheon Yi UC Santa Cruz Stephen Freund.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
C. FlanaganType Systems for Multithreaded Software1 Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College Shaz Qadeer Microsoft Research.
50.003: Elements of Software Construction Week 8 Composing Thread-safe Objects.
/ PSWLAB Type-Based Race Detection for J AVA by Cormac Flanagan, Stephen N. Freund 22 nd Feb 2008 presented by Hong,Shin Type-Based.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
Reduction: A powerful technique for analyzing concurrent software Shaz Qadeer Microsoft Research Collaborators: Cormac Flanagan, UC Santa Cruz Stephen.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
Design Issues. How to parallelize  Task decomposition  Data decomposition  Dataflow decomposition Jaruloj Chongstitvatana 2 Parallel Programming: Parallelization.
Sharing Objects  Synchronization  Atomicity  Specifying critical sections  Memory visibility  One thread’s modification seen by the other  Visibility.
Concurrency Control 1 Fall 2014 CS7020: Game Design and Development.
Extended Static Checking for Java Cormac Flanagan Joint work with: Rustan Leino, Mark Lillibridge, Greg Nelson, Jim Saxe, and Raymie Stata.
Motivation  Parallel programming is difficult  Culprit: Non-determinism Interleaving of parallel threads But required to harness parallelism  Sequential.
/ 23 Concurrency Bug Detection through Improved Pattern Matching Using Semantic Information Slides taken from Shin Hong’s MS Thesis Defense Concurrency.
Detecting Atomicity Violations via Access Interleaving Invariants
Effective Static Deadlock Detection Mayur Naik* Chang-Seo Park +, Koushik Sen +, David Gay* *Intel Research, Berkeley + UC Berkeley.
Effective Static Deadlock Detection Mayur Naik (Intel Research) Chang-Seo Park and Koushik Sen (UC Berkeley) David Gay (Intel Research)
November 2005Scott Stoller, Stony Brook University1 Checking Atomicity in Concurrent Java Programs Scott D. Stoller Joint work with Rahul Agarwal, Amit.
/ PSWLAB Thread Modular Model Checking by Cormac Flanagan and Shaz Qadeer (published in Spin’03) Hong,Shin Thread Modular Model.
Eraser: A dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson Presenter:
Using Escape Analysis in Dynamic Data Race Detection Emma Harrington `15 Williams College
Synchronization Questions answered in this lecture: Why is synchronization necessary? What are race conditions, critical sections, and atomic operations?
Detecting Data Races in Multi-Threaded Programs
W4118 Operating Systems Instructor: Junfeng Yang.
Locking discipline inference and checking Michael D
University of Washington, USA Università di Verona, Italy NFM 2016
Lecture 25 More Synchronized Data and Producer/Consumer Relationship
Effective Data-Race Detection for the Kernel
Monitors.
runtime verification Brief Overview Grigore Rosu
Atomicity in Multithreaded Software
CSE 332: Concurrency and Locks
Eraser: A dynamic data race detector for multithreaded programs
Threads CSE451 Andrew Whitaker TODO: print handouts for AspectRatio.
Previous Lecture: Today’s Lecture: Reading (JV):
Presentation transcript:

CS 263 Course Project1 Survey: Type Systems for Race Detection and Atomicity Feng Zhou, 12/3/2003

CS 263 Course Project2 The Problem and Approaches Interleaved execution in multi-threaded applications may lead to wrong results Reasons: –Race condition: concurrent accesses to a shared variable with at least one write –Use of “stale” data Static tools –Warlock (93) – program analysis, ANSI C –Rccjava(00), atomicity types(03) – type systems –ESC/java(02) – more powerful automatic theorem proving –RacerX(03) – inter-procedural analysis Dynamic tools –Eraser – tracking locksets and intersections

CS 263 Course Project3 Rccjava: Type-Based Race Detector Cormac Flanagan, 2000 Supports lock-based synchronization discipline Basic annotations: “guarded_by” and “requires” class Account { private int balance = 0 /*# guarded_by this */; private void update(int x) /*# requires this */ { balance = x; } public void deposit(int n) { synchronized(this) { update(balance + n); }

CS 263 Course Project4 Type Checking by Tracking Locksets class Account { private int balance = 0 /*# guarded_by this */; private void update(int x) /*# requires this */ { balance = x; } public void deposit(int n) { synchronized(this) { update(balance + n); } lockset={this} this  lockset ? lockset={} lockset = {this} this  lockset ?

CS 263 Course Project5 More complex annotations and constructs Problems with this simple scheme, –There are complex locking schemes used in real apps –Requires too many annotations –Produces a lot of spurious race reports Features to solve these problems: Classes parameterized by locks –Allows fields to be protected by external locks. E.g elements of a list protected by a lock on the list –Implemented using “ghost” parameters to classes Thread-local objects –Enforced by the type system Mechanisms for escaping the type system –Unsound

CS 263 Course Project6 Assignment to a shared field Class Instantiation with ghost parameters Sample Typing Rules

CS 263 Course Project7 Beyond Race Detection: A Type and Effect System for Atomicity Flanagan03, based on rccjava Atomicity: a separate property of expressions/methods const < mover < atomic < cmpd < error Const: does not depend on or change any state Mover: operations that can commute with any concurrent operations from other threads –example: an access to field f guarded by lock l with l held Atomic: behaves exactly the same when running concurrently with other threads or in serial Cmpd: none of the previous ones Error: violates the locking discipline

CS 263 Course Project8 A Type and Effect System for Atomicity (2) Iterative closures and compositions –mover*  mover –atomic atomic  cmpd –mover* atomic mover*  atomic Typing rules,

CS 263 Course Project9 Example of atomicity checking atomic int readBalance() { int t; synchronized (this) { t = balance; } return t; } atomic int withdraw(int amt) { int b = readBalance(); synchronized (this) { balance = b – ant; } AA A A cmpd

CS 263 Course Project10 Reported Application Run on several standard JDK1.4 classes: StringBuffer, String,PrintWriter,Vector… Sized from 296 LOC to 2399 LOC Found one bug in StringBuffer