Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.

Slides:



Advertisements
Similar presentations
CHESS : Systematic Testing of Concurrent Programs
Advertisements

Concurrency Issues Motivation, Problems, Directions Dennis Kafura - CS Operating Systems1.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Pallavi Joshi  Chang-Seo Park  Koushik Sen  Mayur Naik ‡  Par Lab, EECS, UC Berkeley‡
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.
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
Testing Concurrent/Distributed Systems Review of Final CEN 5076 Class 14 – 12/05.
Iterative Context Bounding for Systematic Testing of Multithreaded Programs Madan Musuvathi Shaz Qadeer Microsoft Research.
CHESS: A Systematic Testing Tool for Concurrent Software CSCI6900 George.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
An Case for an Interleaving Constrained Shared-Memory Multi- Processor CS6260 Biao xiong, Srikanth Bala.
Atomicity in Multi-Threaded Programs Prachi Tiwari University of California, Santa Cruz CMPS 203 Programming Languages, Fall 2004.
Big Picture Lab 4 Operating Systems Csaba Andras Moritz.
1 Concurrent and Distributed Systems Introduction 8 lectures on concurrency control in centralised systems - interaction of components in main memory -
Concurrency CS 510: Programming Languages David Walker.
Hierarchical Reconfiguration of Dataflow Graphs Stephen Neuendorffer UC Berkeley Poster Preview May 10, 2004.
Synchronization in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
29-Jun-15 Java Concurrency. Definitions Parallel processes—two or more Threads are running simultaneously, on different cores (processors), in the same.
Synchronization CSCI 444/544 Operating Systems Fall 2008.
Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings 1.
Threading and Concurrency Issues ● Creating Threads ● In Java ● Subclassing Thread ● Implementing Runnable ● Synchronization ● Immutable ● Synchronized.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
ABSTRACT The real world is concurrent. Several things may happen at the same time. Computer systems must increasingly contend with concurrent applications.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
HXY Debugging Made by Contents 目录 History of Java MT Sequential & Parallel Different types of bugs Debugging skills.
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.
Detecting Atomicity Violations via Access Interleaving Invariants
CAPP: Change-Aware Preemption Prioritization Vilas Jagannath, Qingzhou Luo, Darko Marinov Sep 6 th 2011.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
C H A P T E R E L E V E N Concurrent Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Comunication&Synchronization threads 1 Programación Concurrente Benemérita Universidad Autónoma de Puebla Facultad de Ciencias de la Computación Comunicación.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
Flashback : A Lightweight Extension for Rollback and Deterministic Replay for Software Debugging Sudarshan M. Srinivasan, Srikanth Kandula, Christopher.
Soyeon Park, Shan Lu, Yuanyuan Zhou UIUC Reading Group by Theo.
CHESS Finding and Reproducing Heisenbugs in Concurrent Programs
Agenda  Quick Review  Finish Introduction  Java Threads.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Big Picture Lab 4 Operating Systems C Andras Moritz
1 Active Random Testing of Parallel Programs Koushik Sen University of California, Berkeley.
Pitfalls: Time Dependent Behaviors CS433 Spring 2001 Laxmikant Kale.
Tutorial 2: Homework 1 and Project 1
Healing Data Races On-The-Fly
Chapter 8 – Software Testing
Multiple Writers and Races
Specifying Multithreaded Java semantics for Program Verification
Real-time Software Design
143a discussion session week 3
Setac: A Phased Deterministic Testing Framework for Scala Actors
References [1] LEAP:The Lightweight Deterministic Multi-processor Replay of Concurrent Java Programs [2] CLAP:Recording Local Executions to Reproduce.
Background and Motivation
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
Foundations and Definitions
Chapter 3: Process Concept
CS561 Computer Architecture Hye Yeon Kim
EECE.4810/EECE.5730 Operating Systems
CSE 542: Operating Systems
CSE 542: Operating Systems
Presentation transcript:

Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010

Problem Statement Survey tools for testing concurrent programs, with an emphasis on CHESS CTrigger CalFuzzer Use CalFuzzer to discover real data races in Scala’s concurrent programs that use Scala’s Actor concurrency model

Motivation Debugging concurrent programs is hard! Concurrent programs exhibit bugs not present in sequential programs, such as data races, deadlocks, and atomicity violations Traditional approach to testing concurrent programs is to repeatedly execute the program Problems with traditional approach Testing carried out in a particular environment fails to come up with interleavings that could happen in other environments Testing depends on the underlying scheduler and often ends up executing the same interleaving many times

Concurrency Bugs Data Race: A data race occurs when two threads access the same memory location without any intervening synchronization operations, and at least one of the accesses is a write Deadlock: A deadlock occurs when two or more threads cannot make progress because each thread is waiting for another thread to release a resource Atomicity Violation: An atomicity violation occurs when a particular code region intended to be atomic is violated, causing unintended results

CHESS A tool to discover “Heisenbugs” Uses model checking to generate all possible interleavings and then bounds the number of preemptive context switches to limit possible interleavings Provides wrappers for OS concurrency APIs and dynamically intercepts calls to these APIs during runtime Can successfully reproduce erroneous execution

CTrigger Detects atomicity violations by focusing on “unserializable interleavings,” i.e. interleavings which are not equivalent to any sequential execution Works in two phases Phase I: Identify unserializable interleavings Step 1: Profiling and identifying unserializable interleavings Step 2: Pruning infeasible interleavings Step 3: Ranking low-probability interleavings Phase II: Controlled testing of unserializable interleavings

CalFuzzer An extensible tool for active testing of concurrent Java programs Active testing is a dynamic analysis technique that works in two phases Phase 1: It uses a predictive static or dynamic analysis to compute potential concurrency bugs Phase II: It determines whether each reported bug is a real bug or a false positive by attempting to create an interleaving that exhibits the bug Active testing can find real data races, deadlocks, and atomicity violations

RaceFuzzer Active testing applied to finding real data races in concurrent programs The two phases Phase 1: It first uses an imprecise race detection technique, such as hybrid race detection, to compute a set of pairs of statements that could potentially race in some interleavings Phase II: For each pair, it executes the program as follows: It picks a random thread to execute at each state If the next statement of the thread is one of the statements in the pair, it pauses the thread If it comes across another statement also in the pair, it reports a real race if this statement races with the paused thread

Scala’s Actor Model Actors are active objects Objects: Actors encapsulate state and behavior Active: Actors run in separate threads Actors communicate through asynchronous message passing An actor normally sends a message to another actor by invoking the receiving actor’s ! method, which queues the message in the receiving actor’s mailbox and returns immediately (i.e., it is non-blocking) An actor dequeues messages from its mailbox by calling its receive method, which is blocking

RaceFuzzer on Scala Programs Two sources of race conditions One of the tenets of the Actor model is that actors shouldn’t share state, but Scala does not enforce this, so Scala’s Actor model suffers from the same problems as the traditional Thread model The order in which messages are delivered to an actor may be non-deterministic, and an unexpected order may lead to a failure Unfortunately, we haven’t made much progress with using RaceFuzzer to detect data races in Scala programs :(

Questions?