Exceptions and Mistakes CSE788 John Eisenlohr. Big Question How can we improve the quality of concurrent software?

Slides:



Advertisements
Similar presentations
1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Advertisements

Concurrency Issues Motivation, Problems, Directions Dennis Kafura - CS Operating Systems1.
Threads Cannot be Implemented As a Library Andrew Hobbs.
Regression Methodology Einat Ravid. Regression Testing - Definition  The selective retesting of a hardware system that has been modified to ensure that.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
CHESS: A Systematic Testing Tool for Concurrent Software CSCI6900 George.
/ PSWLAB Concurrent Bug Patterns and How to Test Them by Eitan Farchi, Yarden Nir, Shmuel Ur published in the proceedings of IPDPS’03 (PADTAD2003)
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
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.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
Software Quality Metrics
Memory consistency models Presented by: Gabriel Tanase.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
Microsoft Research Faculty Summit Yuanyuan(YY) Zhou Associate Professor University of Illinois, Urbana-Champaign.
Concurrency and Software Transactional Memories Satnam Singh, Microsoft Faculty Summit 2005.
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.
TERM PROJECT The Project usually consists of the following: Title
CS510 Concurrent Systems Class 5 Threads Cannot Be Implemented As a Library.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Meenaktchi Venkatachalam.
 QUALITY ASSURANCE:  QA is defined as a procedure or set of procedures intended to ensure that a product or service under development (before work is.
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.
Cooperative Task Management without Manual Stack Management Or, Event-driven Programming is not the Opposite of Thread Programming Atul Adya, John Howell,
1 Chapter Eight Exception Handling. 2 Objectives Learn about exceptions and the Exception class How to purposely generate a SystemException Learn about.
Accelerating Precise Race Detection Using Commercially-Available Hardware Transactional Memory Support Serdar Tasiran Koc University, Istanbul, Turkey.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Testing Vs. Inspection Research Paper Diala T. Gammoh, Ph.D. Student Dr. Damla Turgut, Ph.D. University of Central Florida, Orlando Florida
Java Software Solutions Lewis and Loftus Chapter 14 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Advanced Flow of Control --
What Change History Tells Us about Thread Synchronization RUI GU, GUOLIANG JIN, LINHAI SONG, LINJIE ZHU, SHAN LU UNIVERSITY OF WISCONSIN – MADISON, USA.
BIO Java 1 Exception Handling Aborting program not always a good idea – can’t lose messages – E-commerce: must ensure correct handling of private.
Software Reliability Research Pankaj Jalote Professor, CSE, IIT Kanpur, India.
Cache Coherence Protocols 1 Cache Coherence Protocols in Shared Memory Multiprocessors Mehmet Şenvar.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
Consider the program fragment below left. Assume that the program containing this fragment executes t1() and t2() on separate threads running on separate.
A Metrics Program. Advantages of Collecting Software Quality Metrics Objective assessments as to whether quality requirements are being met can be made.
Threads cannot be implemented as a library Hans-J. Boehm (presented by Max W Schwarz)
WERST – Methodology Group
Copyright © Curt Hill Concurrent Execution An Overview for Database.
ICFEM 2002, Shanghai Reasoning about Hardware and Software Memory Models Abhik Roychoudhury School of Computing National University of Singapore.
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.
TESTING FUNDAMENTALS BY K.KARTHIKEYAN.
Coding and processing time use Rachid Bouhia Social and Housing Statistics Section United Nations Statistics Division Time Use Statistics workshop for.
1 Types of Data Fundamental data type (atoms, primitive) –integers, characters Data structures- fundamental data types grouped in a particular way –Employee.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
Week 9, Class 3: Java’s Happens-Before Memory Model (Slides used and skipped in class) SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
Learning from Mistakes: A Comprehensive Study on Real-World Concurrency Bug Characteristics Ben Shelton.
Healing Data Races On-The-Fly
Effective Data-Race Detection for the Kernel
Specifying Multithreaded Java semantics for Program Verification
Threads and Memory Models Hal Perkins Autumn 2011
Chapter 15 Debugging.
Changing thread semantics
A Comprehensive Study on Real World Concurrency Bugs in Node.js
Threads and Memory Models Hal Perkins Autumn 2009
Chapter 15 Debugging.
Welcome to Corporate Training -1
Exception Handling Imran Rashid CTO at ManiWeber Technologies.
Coding and processing time use
Chapter 15 Debugging.
CSE 332: Concurrency and Locks
Chapter 15 Debugging.
Presentation transcript:

Exceptions and Mistakes CSE788 John Eisenlohr

Big Question How can we improve the quality of concurrent software?

Focus of this 788 Detecting concurrent program bugs automatically More Specific Question: How can we make this approach as effective as possible?

Two Answers 1)“Learning From Mistakes” : focus on the most common concurrency bugs. 2)“A Case for System Support”: Use Concurrency Exceptions to find more bugs and give more information when they are found.

“Learning” looks at three areas: 1)What should automatic bug detection systems be looking for? 2)How should we test concurrent software? 3)What are some features a good concurrent programming language should have?

“Learning” methodology Look at the bug report databases of four open source applications. Find the fixed concurrency bugs. Categorize them.

Generating the bug data Bug databases contain over 500,000 bugs.

Bug Sources Randomly selected 500 concurrency bug reports. Manually selected bugs that were caused by programmers' wrong assumptions about concurrent execution.

Categorizing the bugs Four Areas: Bug Pattern Manifestation Bug Fix Strategy Bug Avoidance

Bug Pattern Definitions

Atomicity Violation Example (CHECK THEN ACT)

Order Violation Example

Order Violation Example 2

Bug Patterns – results

Bug Patterns – findings

Bug Manifestation Definitions

Manifestation – Results 1

Manifestation – Results 2

Manifestation – Findings

Fix Strategy Definitions

Fix Strategy – Results

Fix Strategy – Findings

Bug Avoidance – Results

Bug Avoidance – Findings 1

Bug Avoidance – Findings 2

“Concurrency Exceptions” Concurrency errors should be treated as exceptions, like divide-by-zero. Make non-determinism in multi-threaded execution more manageable Improve the debugging process  During development  In the field

“Concurrency Exceptions” Propose to throw exceptions for three types of concurrency errors: 1)Sequential Consistency Violation 2)Locking Discipline Violation 3)Atomicity Violation

Sequential Consistenency Exception

Locking Discipline Exception

Atomicity Exception

Required Support for Concurrent Exceptions

Programming Language Support Sequential Consistency: Convey information about synchronization operations to the violation detection mechanism. Detection mechanism can determine whether the execution is guaranteed to be SC.

Programming Language Support Locking Language declares locks, shared data and the associations between them Exception is raised if data is accessed but thread does not hold appropriate lock.

Programming Language Support Atomicity Programmer specifies atomic sections of code. System determines if an execution violates this specification and throws exception

Delivering Exceptions Which thread should receive the exception? What are the guarantees of process state when exception is thrown?

Which thread? The one that is about to issue the memory operation that triggers the exception

State Guarantees Make multiprocessor execution fully deterministic Guarantee the state of only the thread which receives the exception

Did the authors of “A Case” make a convincing case? What are the advantages of throwing an exception in response to a concurrency bug

In “A Case”, how useful is the atomicity detection? Requires programmer to specify atomic sections of code, then checks whether the locking mechanism respects atomicity.

Does the proposal in “A Case” detect the most common programming errors? How about ordering violations? Should there be more effort put into automatically detecting ordering violations?

How useful are the results from “Learning” given the number and type of applications and the number of bugs? Should different types of applications be analyzed? More bugs? The bug database had over half a million entries, and they analyzed 105.

Does the bug fix in Figure 8 of “Learning” make sense?

Is there anything special about bugs that have been found and fixed; i.e., is this study biased towards a certain type of bug? Can you think of a better way to generate bug data? Automatic bug finders? Concurrency Exceptions?

Do you think the conclusions drawn by the authors of “Learning” make sense? Focus on atomicity violation and order violation. New bug-detection techniques to find order violation? Test pairs of threads instead of groups?

Was anything in “Learning” surprising? Most bugs are not fixed by adding or changing locks? The percentage of bugs that can be addressed by TM?

Of the following four categories, where should most effort be put? Automatic Bug Detection Testing techniques Concurrent Language Design Software Engineering Disciplines for Concurrent Programming

Should we strive for Deterministic Shared Memory Processing? How would that affect the conclusions drawn by “Learning”?