Ali Kheradmand, Baris Kasikci, George Candea Lockout: Efficient Testing for Deadlock Bugs 1.

Slides:



Advertisements
Similar presentations
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Pallavi Joshi  Chang-Seo Park  Koushik Sen  Mayur Naik ‡  Par Lab, EECS, UC Berkeley‡
Advertisements

CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
1 Deadlock Solutions: Avoidance, Detection, and Recovery CS 241 March 30, 2012 University of Illinois.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Runtime Verification Ali Akkaya Boğaziçi University.
An Case for an Interleaving Constrained Shared-Memory Multi-Processor Jie Yu and Satish Narayanasamy University of Michigan.
Deadlocks Today Resources & deadlocks Dealing with deadlocks Other issues Next Time Memory management.
Race Directed Random Testing of Concurrent Programs KOUSHIK SEN - UNIVERSITY OF CALIFORNIA, BERKELEY PRESENTED BY – ARTHUR KIYANOVSKI – TECHNION, ISRAEL.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
CHESS: A Systematic Testing Tool for Concurrent Software CSCI6900 George.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Tanenbaum Ch 6 Silberschatz Ch 7
Avishai Wool lecture Introduction to Systems Programming Lecture 5 Deadlocks.
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
Deadlock CSCI 444/544 Operating Systems Fall 2008.
Microsoft Research Faculty Summit Yuanyuan(YY) Zhou Associate Professor University of Illinois, Urbana-Champaign.
Lock Inference for Systems Software John Regehr Alastair Reid University of Utah March 17, 2003.
1 Concurrency: Deadlock and Starvation Chapter 6.
Chapter 6 Deadlocks Resources Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
DETECTION OF POTENTIAL DEADLOCKS AND DATARACES ROZA GHAMARI Bogazici UniversityMarch 2009.
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.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
LOOM: Bypassing Races in Live Applications with Execution Filters Jingyue Wu, Heming Cui, Junfeng Yang Columbia University 1.
Eraser: A Dynamic Data Race Detector for Multithreaded Programs STEFAN SAVAGE, MICHAEL BURROWS, GREG NELSON, PATRICK SOBALVARRO, and THOMAS ANDERSON Ethan.
Deadlock Questions answered in this lecture: What are the four necessary conditions for deadlock? How can deadlock be prevented? How can deadlock be avoided?
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance 3.6. Deadlock prevention.
1 Deadlocks 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order Suppose.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Operating Systems 软件学院 高海昌 Operating Systems Gao Haichang, Software School, Xidian University 22 Contents  1. Introduction** 
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Kernel Locking Techniques by Robert Love presented by Scott Price.
1 MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
…and region serializability for all JESSICA OUYANG, PETER CHEN, JASON FLINN & SATISH NARAYANASAMY UNIVERSITY OF MICHIGAN.
Deadlock Operating Systems: Internals and Design Principles.
Deadlocks. What is a Deadlock “A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set.
Using Datalog for deadlock detection Mentor: Yannis Smaragdakis Oleg Nabiullin Sergey Fedorov
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.
Eraser: A dynamic Data Race Detector for Multithreaded Programs Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, Thomas Anderson Presenter:
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
RaceMob : Crowd-sourced Data Race Detection
Healing Data Races On-The-Fly
MODERN OPERATING SYSTEMS Third Edition ANDREW S
CS703 - Advanced Operating Systems
Lazy Diagnosis of In-Production Concurrency Bugs
Chapter 7 – Deadlock and Indefinite Postponement
Real-time Software Design
Lecture 19: Deadlock: Conditions, Detection and Avoidance
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Conditions for Deadlock
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
DEADLOCK.
Operating System Introduction.
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Introduction to Deadlocks
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
CSE 542: Operating Systems
CSE 542: Operating Systems
MODERN OPERATING SYSTEMS Third Edition ANDREW S
CS444/544 Operating Systems II Scheduler
Presentation transcript:

Ali Kheradmand, Baris Kasikci, George Candea Lockout: Efficient Testing for Deadlock Bugs 1

Deadlock Set of threads Each holding a lock needed by another thread Waiting for another lock to be released by some other thread 2

Why Do Deadlocks Matter? Common in modern software Hard to detect manually Occur rarely during execution 3 ChromeApache Eclipse LimeWire

Deadlock Detection Traditional testing – Deadlocks manifest rarely ✗ Static detection – Fast (run offline) ✓ – Few false negatives ✓ – Many false positives ✗ Dynamic detection – Slow (high runtime overhead) ✗ – Many false negatives ✗ – Few false positives ✓ 4

5 Best of Two Worlds Normal tests can’t discover enough deadlocks Deadlock avoidance or fixing tools tools (Dimmunix [OSDI’08]) take a long time Need to find the schedules that lead to a deadlock How to increase the probability of encountering a deadlock? Steer the program towards schedules that are likely to cause a deadlock

Lockout Systematic deadlock testing Increases deadlock probability By steering the scheduling Leverages past program executions 6 Trigger more deadlocks with the same test suite

7 Outline Lockout architecture Deadlock triggering algorithm Preliminary results Summary and future work

Lockout Architecture cout << “Hello, World!\n”; Instrumentation Static Phase Source Code Instrumented Binary 8 Static Analysis RaceMob [SOSP’13]

Lockout Architecture Dynamic Phase Runtime Previous executions info Subsequent executions Instrumented Program 9 End of execution Schedule perturbation Events DeadlockFuzzer [PLDI’09]

10 Outline Lockout architecture Deadlock triggering algorithm Preliminary results Summary and future work

Runtime Lock Order Graph (RLG) a b c lock lock(a) … lock(b) … lock(c) 11 Potential deadlock Thread 1 Lock acquisition order

Deadlock Triggering Selects a directed cycle in RLG Delays threads accordingly Improves simple preemption (CHESS [OSDI’08]) Preemption before each lock 12 da bc lock(a) lock(b)

Runtime Deadlock Triggering Thread 1 lock(a) lock(b) … unlock(b) unlock(a) Thread 2 lock(b) lock(c) … unlock(c) unlock(b) Time 13 Thread 3 lock(c) lock(a) … unlock(a) unlock(c) a cb

RT() lock(b) RT() lock(c) RT() lock(c) RT() lock(a) Before lock (a) Thread 1 RT() lock(a) RT() lock(b) Thread 2TimeThread 3 a cb Runtime Before lock (a) Continue Before lock (b) Delay Before lock (c) Continue Delay Deadlock Triggering 14 Before lock (b) Continue Before lock (c) Delay

Race Dependent Deadlocks Preempt before memory accesses Ideally only shared memory accesses Can be approximated by preempting after locks Can be improved using static analysis Can be improved using data race detection 15

16 Outline Lockout architecture Deadlock triggering algorithm Preliminary results Summary and future work

Lockout Effectiveness 17 ProgramFraction of executions resulting in deadlock (%) NativeSimple preemption + Post-lock preemption Deadlock triggering + Pre-memory access preemption Deadlock triggering + Post-lock preemption Microbench %0.5 %50 % SQLite %4 %50 % HawkNL 1.6b323 %64 %50 % Pbzip % Httpd % Fraction of executions with deadlocks increased up to three orders of magnitude

18 Outline Lockout architecture Deadlock triggering algorithm Preliminary results Summary and future work

Lockout Increases deadlock probability Leverages past program executions Effective Up to 3 orders of magnitude more deadlock prone Open source: 19

Future Work Increasing effectiveness with low overhead Static analysis (data races, shared variables) Lockout + Automatic failure fixing/avoidance (Dimmunix [OSDI’08], CFix [OSDI’12], Aviso [ASPLOS’13]) In production For testing Crowdsourcing (Aviso [ASPLOS’13], RaceMob [SOSP’13]) 20