Active Testing for Concurrent Programs

Size: px
Start display at page:

Download "Active Testing for Concurrent Programs"

Transcription

1 Active Testing for Concurrent Programs Pallavi Joshi Mayur Naik Chang-Seo Park Koushik Sen 1/8/2009 ParLab Retreat ParLab, UC Berkeley Intel Research

2 Overview Checking correctness of concurrent programs Active testing directed by Data races Atomicity violations Deadlocks Programmer directed active testing Breakpoints for parallel programs Conclusion

3 Correctness Personal Health Image Retrieval Hearing, Music Dwarfs Speech Parallel Browser Composition & Coordination Language (C&CL) C&CL Compiler/Interpreter Static Verification Parallel Libraries Parallel Frameworks Type Systems Efficiency Sketching Languages Autotuners Legacy Communication & Schedulers Code Synch. Primitives Efficiency Language Compilers OS Libraries & Services Legacy OS Hypervisor Intel Multicore/GPGPU RAMP Manycore Directed Testing Dynamic Checking Debugging with Replay

4 Checking Correctness of Concurrent Programs Multiple threads of execution with shared memory Want correctness for All executions All inputs need to be checked Interference among threads introduces non deterministic bugs All schedules need to be checked

5 Checking All Schedules Model checking Check all schedules systematically Does not scale to large programs Focus on potentially buggy schedules Schedules that may expose bugs Boundary case schedules What are those potentially buggy schedules?

6 Checking All Schedules Model checking Check all schedules systematically Does not scale to large programs Focus on potentially buggy schedules Schedules that may expose bugs Boundary case schedules What are those potentially buggy schedules? Schedules exhibiting data races, atomicity violations, deadlocks

7 Active Testing Check the potentially buggy schedules Practical and efficient Find many bugs quickly Create an actual execution showing a bug How?

8 Active Testing Check the potentially buggy schedules Practical and efficient Find many bugs quickly Create an actual execution showing a bug Actively control scheduler Explore schedules systematically or randomly

9 Active Testing Check the potentially buggy schedules Practical and efficient Find many bugs quickly Create an actual execution showing a bug Actively control scheduler Explore schedules systematically or randomly But, preempt threads at appropriate states so that buggy schedules get created Observe execution for any abnormal behavior (e.g. uncaught exceptions, assertion failures)

10 Race Directed X = 1; if(x == 0) ERROR; [Sen; PLDI 08]

11 Race Directed X = 1; In race if(x == 0) ERROR; [Sen; PLDI 08]

12 Race Directed X = 1; State to preempt State to preempt if(x == 0) ERROR; [Sen; PLDI 08]

13 Race Directed X = 1; if(x == 0) ERROR; [Sen; PLDI 08]

14 Race Directed X = 1; Paused if(x == 0) ERROR; [Sen; PLDI 08]

15 Race Directed X = 1; Paused if(x == 0) ERROR; [Sen; PLDI 08]

16 Race Directed X = 1; Paused if(x == 0) ERROR; Paused [Sen; PLDI 08]

17 Race Directed X = 1; Paused if(x == 0) ERROR; Paused [Sen; PLDI 08]

18 Race Directed X = 1; Paused if(x == 0) ERROR; [Sen; PLDI 08]

19 lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

20 lock(l1) Deadlock Directed lock(l2) lock(l2) lock(l1) unlock(l2) unlock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

21 lock(l1) Deadlock Directed lock(l2) lock(l2) lock(l1) unlock(l2) unlock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

22 lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

23 lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

24 lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

25 Paused lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

26 Paused lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

27 Paused lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

28 Paused lock(l1) lock(l2) unlock(l2) Deadlock Directed unlock(l1) lock(l2) lock(l1) unlock(l1) Paused unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

29 lock(l1) Deadlock Directed Paused lock(l2) unlock(l2) unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) Paused [Joshi, Park, Sen, Naik; Under submission]

30 lock(l1) Deadlock Directed lock(l2) unlock(l2) unlock(l1) lock(l2) lock(l1) unlock(l1) unlock(l2) Paused [Joshi, Park, Sen, Naik; Under submission]

31 lock(l1) Deadlock Directed lock(l2) lock(l2) unlock(l2) unlock(l1) lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

32 lock(l1) Deadlock Directed lock(l2) lock(l2) unlock(l2) unlock(l1) Deadlock! lock(l1) unlock(l1) unlock(l2) [Joshi, Park, Sen, Naik; Under submission]

33 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

34 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

35 Atomicity Violation Directed t = x; atomic Atomicity Violation! t = 0; x = t + 1; [Park, Sen; FSE 08]

36 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

37 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

38 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

39 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

40 atomic Atomicity Violation Directed t = x; x = t + 1; Paused t = 0; [Park, Sen; FSE 08]

41 atomic Atomicity Violation Directed t = x; x = t + 1; Paused t = 0; Paused [Park, Sen; FSE 08]

42 atomic Atomicity Violation Directed t = x; x = t + 1; Paused t = 0; Paused [Park, Sen; FSE 08]

43 atomic Atomicity Violation Directed t = x; x = t + 1; Paused t = 0; [Park, Sen; FSE 08]

44 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

45 atomic Atomicity Violation Directed t = x; x = t + 1; t = 0; [Park, Sen; FSE 08]

46 Bugs Found Tool implemented for Java Races, deadlocks, atomicity violations in Java Collections Framework Deadlocks found and reproduced in Jigsaw web server Java Swing GUI framework Java Database Connectivity (JDBC) Atomicity violations in Apache Commons Collections

47 Lessons Learned Controlling scheduler makes testing effective Focus on potentially buggy schedules Reproduce bugs with high probability Need the right preemption points Directed preemption uncovered many bugs Why not let the programmer choose the preemption points? Breakpoints for concurrent programs Language for describing schedules

48 Schedule Exploration Language Facility to specify thread schedules User specifies breakpoints Preempt a thread at a user specified state User specifies ordering constraints on events Control schedule to meet constraints Testing for logical (semantic) bugs Schedules are given as input to program Either generated automatically (directed) or programmer specified Inputs to unit tests but on schedules

49 Example Usage foo(l) { 1: lock(l) 2: f() 3: unlock(l) 4:... 5: lock(l) 6: g() 7: unlock(l) } foo(l1) foo(l2) foo(l3) T1 T2 T3 T4 foo(l2) foo(l1) foo(l1)

50 Example Usage foo(l) { 1: lock(l) 2: f() 3: unlock(l) 4:... 5: lock(l) 6: g() 7: unlock(l) } foo(l1) foo(l2) foo(l3) T1 T2 T3 T4 foo(l2) foo(l1) foo(l1) break 5

51 Example Usage foo(l) { 1: lock(l) 2: f() 3: unlock(l) 4:... 5: lock(l) 6: g() 7: unlock(l) } foo(l1) foo(l2) foo(l3) T1 T2 T3 T4 foo(l2) foo(l1) foo(l1) break lock(l2)

52 Example Usage foo(l) { 1: lock(l) 2: f() 3: unlock(l) 4:... 5: lock(l) 6: g() 7: unlock(l) } foo(l1) foo(l2) foo(l3) T1 T2 T3 T4 foo(l2) foo(l1) foo(l1) break lock(l2),5

53 Example Usage foo(l) { 1: lock(l) 2: f() 3: unlock(l) 4:... 5: lock(l) 6: g() 7: unlock(l) } foo(l1) foo(l2) foo(l3) T1 T2 T3 T4 foo(l2) foo(l1) foo(l1) break lock(l2), 5, T1

54 Abstraction: Naming Runtime Objects Threads and locks are runtime objects Address changes across runs Need to identify consistently with only static information An abstraction based on object creation site Line number (PC) of where object allocated

55 Abstraction Example main { 1: Lock L1 = new Lock(); 2: Lock L2 = new Lock(); 3: Thread T1 = new MyThread(L1); 4: Thread T2 = new MyThread(L2); 5:... } MyThread(L) { 6: foo(l); } main T1 T2 foo(l1) foo(l2)

56 Abstraction Example main { 1: Lock L1 = new Lock(); 2: Lock L2 = new Lock(); 3: Thread T1 = new MyThread(L1); 4: Thread T2 = new MyThread(L2); 5:... } MyThread(L) { 6: foo(l); } main [3] [4] foo([1]) foo([2])

57 Abstraction: Naming Runtime Objects Threads and locks are runtime objects Address changes across runs Need to name consistently and statically Abstraction based on object creation site Line number (PC) of where object allocated Use and combine richer abstractions for increased separation Objects created in loops Objects created in different contexts

58 Another Example Usage T1 T2 T3 T4 wait(o) notify(o) before (notify(abs(o)),abs(t3)-> wait(abs(o)), abs(t1))

59 Conclusion Practical and efficient testing of concurrent programs Find and reproduce bugs to lessen burden of manual inspection Input language for user specified schedules

Active Testing for Concurrent Programs

Active Testing for Concurrent Programs Active Testing for Concurrent Programs Pallavi Joshi, Mayur Naik, Chang-Seo Park, Koushik Sen 12/30/2008 ROPAS Seminar ParLab, UC Berkeley Intel Research Overview ParLab The Parallel Computing Laboratory

More information

CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1

CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1 CalFuzzer: An Extensible Active Testing Framework for Concurrent Programs Pallavi Joshi 1, Mayur Naik 2, Chang-Seo Park 1, and Koushik Sen 1 1 University of California, Berkeley, USA {pallavi,parkcs,ksen}@eecs.berkeley.edu

More information

Integrating the Par Lab Stack Running Damascene on SEJITS/ROS/RAMP Gold

Integrating the Par Lab Stack Running Damascene on SEJITS/ROS/RAMP Gold Integrating the Par Lab Stack Running on /ROS/RAMP Gold Kevin Klues, Yunsup Lee, Andrew Waterman Par Lab Winter Retreat 2010 Overall Goal of the Par Lab: Create Productive, Efficient, Correct, Portable

More information

Parallel Webpage Layout

Parallel Webpage Layout Parallel Webpage Layout Leo Meyerovich, Chan Siu Man, Chan Siu On, Heidi Pan Krste Asanovic, Rastislav Bodik and many others from the UPCRC Berkeley project UC Berkeley Par Lab Research Overview Diagnosing

More information

Hardware Acceleration for Tagging

Hardware Acceleration for Tagging Parallel Hardware Parallel Applications IT industry (Silicon Valley) Parallel Software Users Hardware Acceleration for Tagging Sarah Bird, David McGrogan, John Kubiatowicz, Krste Asanovic June 5, 2008

More information

Code Generators for Stencil Auto-tuning

Code Generators for Stencil Auto-tuning Code Generators for Stencil Auto-tuning Shoaib Kamil with Cy Chan, Sam Williams, Kaushik Datta, John Shalf, Katherine Yelick, Jim Demmel, Leonid Oliker Diagnosing Power/Performance Correctness Where this

More information

Efficient Data Race Detection for Unified Parallel C

Efficient Data Race Detection for Unified Parallel C P A R A L L E L C O M P U T I N G L A B O R A T O R Y Efficient Data Race Detection for Unified Parallel C ParLab Winter Retreat 1/14/2011" Costin Iancu, LBL" Nick Jalbert, UC Berkeley" Chang-Seo Park,

More information

Code Generators for Stencil Auto-tuning

Code Generators for Stencil Auto-tuning Code Generators for Stencil Auto-tuning Shoaib Kamil with Cy Chan, John Shalf, Sam Williams, Kaushik Datta, Katherine Yelick, Jim Demmel, Leonid Oliker Diagnosing Power/Performance Correctness Where this

More information

Making Performance Understandable: Towards a Standard for Performance Counters on Manycore Architectures

Making Performance Understandable: Towards a Standard for Performance Counters on Manycore Architectures Parallel Hardware Parallel Applications IT industry (Silicon Valley) Parallel Software Users Making Performance Understandable: Towards a Standard for Performance Counters on Manycore Architectures Sarah

More information

Third party names are the property of their owners.

Third party names are the property of their owners. Disclaimer READ THIS its very important The views expressed in this talk are those of the speaker and not his employer. This is an academic style talk and does not address details of any particular Intel

More information

Randomized Active Atomicity Violation Detection in Concurrent Programs

Randomized Active Atomicity Violation Detection in Concurrent Programs Randomized Active Atomicity Violation Detection in Concurrent Programs Chang-Seo Park EECS Department, UC Berkeley, CA, USA. parkcs@cs.berkeley.edu Koushik Sen EECS Department, UC Berkeley, CA, USA. ksen@cs.berkeley.edu

More information

SEJITS: High Performance for Productivity Applications

SEJITS: High Performance for Productivity Applications SEJITS: High Performance for Productivity Applications Shoaib Kamil & many others Parlab End of Project Celebration May 30, 2013 Correctness Where Did We Start? Personal Health Image Retrieval Hearing,

More information

Contour Detection on Mobile Platforms

Contour Detection on Mobile Platforms Contour Detection on Mobile Platforms Bor-Yiing Su, subrian@eecs.berkeley.edu Prof. Kurt Keutzer, keutzer@eecs.berkeley.edu Parallel Computing Lab, University of California, Berkeley 1/26 Diagnosing Power/Performance

More information

BERKELEY PAR LAB. UPC-THRILLE Demo. Chang-Seo Park

BERKELEY PAR LAB. UPC-THRILLE Demo. Chang-Seo Park BERKELEY PAR LAB UPC-THRILLE Demo Chang-Seo Park 1 Correctness Group Highlights Active Testing for Java, C, and UPC Practical, easy-to-use tools for finding bugs, with sophisticated program analysis internally

More information

Chimera: Hybrid Program Analysis for Determinism

Chimera: Hybrid Program Analysis for Determinism Chimera: Hybrid Program Analysis for Determinism Dongyoon Lee, Peter Chen, Jason Flinn, Satish Narayanasamy University of Michigan, Ann Arbor - 1 - * Chimera image from http://superpunch.blogspot.com/2009/02/chimera-sketch.html

More information

End of Parlab talk. May 29, 2013 Gans Srinivasa Intel Corp

End of Parlab talk. May 29, 2013 Gans Srinivasa Intel Corp End of Parlab talk May 29, 2013 Gans Srinivasa Intel Corp 1 A Journey: Year 2005; 2008; 2011; Potential Parallel Speedup 1000 100 MIMD*SIMD (32 b) MIMD*SIMD (64 b) SIMD (32b) SIMD (64b) MIMD 10 To Multicore

More information

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007 CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Threads and Synchronization May 8, 2007 Computation Abstractions t1 t1 t4 t2 t1 t2 t5 t3 p1 p2 p3 p4 CPU 1 CPU 2 A computer Processes

More information

Semantic Atomicity for Multithreaded Programs!

Semantic Atomicity for Multithreaded Programs! P A R A L L E L C O M P U T I N G L A B O R A T O R Y Semantic Atomicity for Multithreaded Programs! Jacob Burnim, George Necula, Koushik Sen! Parallel Computing Laboratory! University of California, Berkeley!

More information

TERN: Stable Deterministic Multithreading through Schedule Memoization

TERN: Stable Deterministic Multithreading through Schedule Memoization TERN: Stable Deterministic Multithreading through Schedule Memoization Heming Cui, Jingyue Wu, Chia-che Tsai, Junfeng Yang Columbia University Appeared in OSDI 10 Nondeterministic Execution One input many

More information

CHESS: Analysis and Testing of Concurrent Programs

CHESS: Analysis and Testing of Concurrent Programs CHESS: Analysis and Testing of Concurrent Programs Sebastian Burckhardt, Madan Musuvathi, Shaz Qadeer Microsoft Research Joint work with Tom Ball, Peli de Halleux, and interns Gerard Basler (ETH Zurich),

More information

Typed Assembly Language for Implementing OS Kernels in SMP/Multi-Core Environments with Interrupts

Typed Assembly Language for Implementing OS Kernels in SMP/Multi-Core Environments with Interrupts Typed Assembly Language for Implementing OS Kernels in SMP/Multi-Core Environments with Interrupts Toshiyuki Maeda and Akinori Yonezawa University of Tokyo Quiz [Environment] CPU: Intel Xeon X5570 (2.93GHz)

More information

Concurrency. Glossary

Concurrency. Glossary Glossary atomic Executing as a single unit or block of computation. An atomic section of code is said to have transactional semantics. No intermediate state for the code unit is visible outside of the

More information

Static and Dynamic Program Analysis: Synergies and Applications

Static and Dynamic Program Analysis: Synergies and Applications Static and Dynamic Program Analysis: Synergies and Applications Mayur Naik Intel Labs, Berkeley CS 243, Stanford University March 9, 2011 Today s Computing Platforms Trends: parallel cloud mobile Traits:

More information

Debugging Applications in Pervasive Computing

Debugging Applications in Pervasive Computing Debugging Applications in Pervasive Computing Larry May 1, 2006 SMA 5508; MIT 6.883 1 Outline Video of Speech Controlled Animation Survey of approaches to debugging Turning bugs into features Speech recognition

More information

An Effective Dynamic Analysis for Detecting Generalized Deadlocks

An Effective Dynamic Analysis for Detecting Generalized Deadlocks An Effective Dynamic Analysis for Detecting Generalized Deadlocks Pallavi Joshi EECS, UC Berkeley, CA, USA pallavi@cs.berkeley.edu Mayur Naik Intel Labs Berkeley, CA, USA mayur.naik@intel.com David Gay

More information

Advanced Memory Management

Advanced Memory Management Advanced Memory Management Main Points Applications of memory management What can we do with ability to trap on memory references to individual pages? File systems and persistent storage Goals Abstractions

More information

Fully Automatic and Precise Detection of Thread Safety Violations

Fully Automatic and Precise Detection of Thread Safety Violations Fully Automatic and Precise Detection of Thread Safety Violations Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation Thread-safe classes: Building blocks for concurrent

More information

Parallelism Marco Serafini

Parallelism Marco Serafini Parallelism Marco Serafini COMPSCI 590S Lecture 3 Announcements Reviews First paper posted on website Review due by this Wednesday 11 PM (hard deadline) Data Science Career Mixer (save the date!) November

More information

Do you have to reproduce the bug on the first replay attempt?

Do you have to reproduce the bug on the first replay attempt? Do you have to reproduce the bug on the first replay attempt? PRES: Probabilistic Replay with Execution Sketching on Multiprocessors Soyeon Park, Yuanyuan Zhou University of California, San Diego Weiwei

More information

Concurrency, Mutual Exclusion and Synchronization C H A P T E R 5

Concurrency, Mutual Exclusion and Synchronization C H A P T E R 5 Concurrency, Mutual Exclusion and Synchronization C H A P T E R 5 Multiple Processes OS design is concerned with the management of processes and threads: Multiprogramming Multiprocessing Distributed processing

More information

1. Introduction to Concurrent Programming

1. Introduction to Concurrent Programming 1. Introduction to Concurrent Programming A concurrent program contains two or more threads that execute concurrently and work together to perform some task. When a program is executed, the operating system

More information

Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion

Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion Michaelmas 2017 Dr Robert N. M. Watson (With thanks to Dr Steven Hand) 1 Concurrent and distributed systems One

More information

Transaction Memory for Existing Programs Michael M. Swift Haris Volos, Andres Tack, Shan Lu, Adam Welc * University of Wisconsin-Madison, *Intel

Transaction Memory for Existing Programs Michael M. Swift Haris Volos, Andres Tack, Shan Lu, Adam Welc * University of Wisconsin-Madison, *Intel Transaction Memory for Existing Programs Michael M. Swift Haris Volos, Andres Tack, Shan Lu, Adam Welc * University of Wisconsin-Madison, *Intel Where do TM programs ome from?! Parallel benchmarks replacing

More information

Concurrency Analysis of Asynchronous APIs

Concurrency Analysis of Asynchronous APIs Concurrency Analysis of Asynchronous APIs Anirudh Santhiar and Aditya Kanade April 2, 2016 Computer Science and Automation, IISc Introduction Asynchronous Programming Model1 A way to organize programs

More information

Efficient, Deterministic, and Deadlock-free Concurrency

Efficient, Deterministic, and Deadlock-free Concurrency Efficient, Deterministic Concurrency p. 1/31 Efficient, Deterministic, and Deadlock-free Concurrency Nalini Vasudevan Columbia University Efficient, Deterministic Concurrency p. 2/31 Data Races int x;

More information

2 Introduction to Java. Introduction to Programming 1 1

2 Introduction to Java. Introduction to Programming 1 1 2 Introduction to Java Introduction to Programming 1 1 Objectives At the end of the lesson, the student should be able to: Describe the features of Java technology such as the Java virtual machine, garbage

More information

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 6 Concurrency: Deadlock and Starvation Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Deadlock

More information

11/19/2013. Imperative programs

11/19/2013. Imperative programs if (flag) 1 2 From my perspective, parallelism is the biggest challenge since high level programming languages. It s the biggest thing in 50 years because industry is betting its future that parallel programming

More information

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability Main concepts to be covered Testing and Debugging Testing Debugging Test automation Writing for maintainability 4.0 Code snippet of the day public void test() { int sum = 1; for (int i = 0; i

More information

Memory Consistency Models: Convergence At Last!

Memory Consistency Models: Convergence At Last! Memory Consistency Models: Convergence At Last! Sarita Adve Department of Computer Science University of Illinois at Urbana-Champaign sadve@cs.uiuc.edu Acks: Co-authors: Mark Hill, Kourosh Gharachorloo,

More information

CS153: Deadlock. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

CS153: Deadlock. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian 1 CS153: Deadlock Chengyu Song Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian 2 Administrivia Lab Lab1 is due this Sunday Demo sessions next week Little book of semaphores First

More information

Deterministic Parallel Programming

Deterministic Parallel Programming Deterministic Parallel Programming Concepts and Practices 04/2011 1 How hard is parallel programming What s the result of this program? What is data race? Should data races be allowed? Initially x = 0

More information

Race Directed Random Testing of Concurrent Programs

Race Directed Random Testing of Concurrent Programs Race Directed Random Testing of Concurrent Programs Koushik Sen EECS Department, UC Berkeley, CA, USA. ksen@cs.berkeley.edu Abstract Bugs in multi-threaded programs often arise due to data races. Numerous

More information

A Retrospective on Par Lab Architecture Research

A Retrospective on Par Lab Architecture Research A Retrospective on Par Lab Architecture Research Par Lab SIGARCH Krste Asanovic, Rimas Avizienis, Jonathan Bachrach, Scott Beamer, Sarah Bird, Alex Bishara, Chris Celio, Henry Cook, Ben Keller, Yunsup

More information

Deterministic Replay and Data Race Detection for Multithreaded Programs

Deterministic Replay and Data Race Detection for Multithreaded Programs Deterministic Replay and Data Race Detection for Multithreaded Programs Dongyoon Lee Computer Science Department - 1 - The Shift to Multicore Systems 100+ cores Desktop/Server 8+ cores Smartphones 2+ cores

More information

Lightweight Fault Detection in Parallelized Programs

Lightweight Fault Detection in Parallelized Programs Lightweight Fault Detection in Parallelized Programs Li Tan UC Riverside Min Feng NEC Labs Rajiv Gupta UC Riverside CGO 13, Shenzhen, China Feb. 25, 2013 Program Parallelization Parallelism can be achieved

More information

Java Memory Model. Jian Cao. Department of Electrical and Computer Engineering Rice University. Sep 22, 2016

Java Memory Model. Jian Cao. Department of Electrical and Computer Engineering Rice University. Sep 22, 2016 Java Memory Model Jian Cao Department of Electrical and Computer Engineering Rice University Sep 22, 2016 Content Introduction Java synchronization mechanism Double-checked locking Out-of-Thin-Air violation

More information

Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion

Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion Michaelmas 2016 Dr Robert N. M. Watson (With thanks to Dr Steven Hand) 1 Concurrent and distributed systems One

More information

DDT: A visual, parallel debugger on Ra

DDT: A visual, parallel debugger on Ra DDT: A visual, parallel debugger on Ra David M. Larue dlarue@mines.edu High Performance & Research Computing Campus Computing, Communications, and Information Technologies Colorado School of Mines March,

More information

Symbolic Execution, Dynamic Analysis

Symbolic Execution, Dynamic Analysis Symbolic Execution, Dynamic Analysis http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Symbolic execution Pavel Parízek Symbolic Execution, Dynamic Analysis

More information

A Serializability Violation Detector for Shared-Memory Server Programs

A Serializability Violation Detector for Shared-Memory Server Programs A Serializability Violation Detector for Shared-Memory Server Programs Min Xu Rastislav Bodík Mark Hill University of Wisconsin Madison University of California, Berkeley Serializability Violation Detector:

More information

DART: Directed Automated Random Testing. CUTE: Concolic Unit Testing Engine. Slide Source: Koushik Sen from Berkeley

DART: Directed Automated Random Testing. CUTE: Concolic Unit Testing Engine. Slide Source: Koushik Sen from Berkeley DAR: Directed Automated Random esting CUE: Concolic Unit esting Engine Slide Source: Koushik Sen from Berkeley Verification and esting We would like to prove programs correct Verification and esting We

More information

Automatically Classifying Benign and Harmful Data Races Using Replay Analysis

Automatically Classifying Benign and Harmful Data Races Using Replay Analysis Automatically Classifying Benign and Harmful Data Races Using Replay Analysis Satish Narayanasamy, Zhenghao Wang, Jordan Tigani, Andrew Edwards, Brad Calder Microsoft University of California, San Diego

More information

A Trace Simplification Technique for Effective Debugging of Concurrent Programs

A Trace Simplification Technique for Effective Debugging of Concurrent Programs A Trace Simplification Technique for Effective Debugging of Concurrent Programs Nicholas Jalbert EECS Department, UC Berkeley, CA, USA jalbert@cs.berkeley.edu Koushik Sen EECS Department, UC Berkeley,

More information

DMP Deterministic Shared Memory Multiprocessing

DMP Deterministic Shared Memory Multiprocessing DMP Deterministic Shared Memory Multiprocessing University of Washington Joe Devietti, Brandon Lucia, Luis Ceze, Mark Oskin A multithreaded voting machine 2 thread 0 thread 1 while (more_votes) { load

More information

IT 540 Operating Systems ECE519 Advanced Operating Systems

IT 540 Operating Systems ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (5 th Week) (Advanced) Operating Systems 5. Concurrency: Mutual Exclusion and Synchronization 5. Outline Principles

More information

Introduction to Problem Solving and Programming in Python.

Introduction to Problem Solving and Programming in Python. Introduction to Problem Solving and Programming in Python http://cis-linux1.temple.edu/~tuf80213/courses/temple/cis1051/ Overview Types of errors Testing methods Debugging in Python 2 Errors An error in

More information

A Parameterized Type System for Race-Free Java Programs

A Parameterized Type System for Race-Free Java Programs A Parameterized Type System for Race-Free Java Programs Chandrasekhar Boyapati Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology {chandra, rinard@lcs.mit.edu Data races

More information

This guide will show you how to use Intel Inspector XE to identify and fix resource leak errors in your programs before they start causing problems.

This guide will show you how to use Intel Inspector XE to identify and fix resource leak errors in your programs before they start causing problems. Introduction A resource leak refers to a type of resource consumption in which the program cannot release resources it has acquired. Typically the result of a bug, common resource issues, such as memory

More information

SSC - Concurrency and Multi-threading Advanced topics about liveness

SSC - Concurrency and Multi-threading Advanced topics about liveness SSC - Concurrency and Multi-threading Advanced topics about liveness Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics Review what we learned

More information

Introduction to Automation. What is automation testing Advantages of Automation Testing How to learn any automation tool Types of Automation tools

Introduction to Automation. What is automation testing Advantages of Automation Testing How to learn any automation tool Types of Automation tools Introduction to Automation What is automation testing Advantages of Automation Testing How to learn any automation tool Types of Automation tools Introduction to Selenium What is Selenium Use of Selenium

More information

A Classification of Concurrency Bugs in Java Benchmarks by Developer Intent

A Classification of Concurrency Bugs in Java Benchmarks by Developer Intent A Classification of Concurrency Bugs in Java Benchmarks by Developer Intent M. Erkan Keremoglu, Serdar Tasiran, Tayfun Elmas Center for Advanced Design Technologies @ Koc University http://designtech.ku.edu.tr

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

Automatic Testing of Sequential and Concurrent Substitutability

Automatic Testing of Sequential and Concurrent Substitutability Automatic Testing of Sequential and Concurrent Substitutability Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation void bar(foo f) { f.m();... } bar() expects functionality

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Synchronization in Java Department of Computer Science University of Maryland, College Park Multithreading Overview Motivation & background Threads Creating Java

More information

Enforcing Textual Alignment of

Enforcing Textual Alignment of Parallel Hardware Parallel Applications IT industry (Silicon Valley) Parallel Software Users Enforcing Textual Alignment of Collectives using Dynamic Checks and Katherine Yelick UC Berkeley Parallel Computing

More information

Dealing with Issues for Interprocess Communication

Dealing with Issues for Interprocess Communication Dealing with Issues for Interprocess Communication Ref Section 2.3 Tanenbaum 7.1 Overview Processes frequently need to communicate with other processes. In a shell pipe the o/p of one process is passed

More information

C++ Memory Model. Don t believe everything you read (from shared memory)

C++ Memory Model. Don t believe everything you read (from shared memory) C++ Memory Model Don t believe everything you read (from shared memory) The Plan Why multithreading is hard Warm-up example Sequential Consistency Races and fences The happens-before relation The DRF guarantee

More information

Atom-Aid: Detecting and Surviving Atomicity Violations

Atom-Aid: Detecting and Surviving Atomicity Violations Atom-Aid: Detecting and Surviving Atomicity Violations Abstract Writing shared-memory parallel programs is an error-prone process. Atomicity violations are especially challenging concurrency errors. They

More information

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing? Testing ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 24: Introduction to Software Testing and Verification What is software testing? Running a program in order to find bugs (faults,

More information

Regression testing. Whenever you find a bug. Why is this a good idea?

Regression testing. Whenever you find a bug. Why is this a good idea? Regression testing Whenever you find a bug Reproduce it (before you fix it!) Store input that elicited that bug Store correct output Put into test suite Then, fix it and verify the fix Why is this a good

More information

Productive Design of Extensible Cache Coherence Protocols!

Productive Design of Extensible Cache Coherence Protocols! P A R A L L E L C O M P U T I N G L A B O R A T O R Y Productive Design of Extensible Cache Coherence Protocols!! Henry Cook, Jonathan Bachrach,! Krste Asanovic! Par Lab Summer Retreat, Santa Cruz June

More information

Automatically Repairing Concurrency Bugs with ARC MUSEPAT 2013 Saint Petersburg, Russia

Automatically Repairing Concurrency Bugs with ARC MUSEPAT 2013 Saint Petersburg, Russia Automatically Repairing Concurrency Bugs with ARC MUSEPAT 2013 Saint Petersburg, Russia David Kelk, Kevin Jalbert, Jeremy S. Bradbury Faculty of Science (Computer Science) University of Ontario Institute

More information

Fault Tolerant Java Virtual Machine. Roy Friedman and Alon Kama Technion Haifa, Israel

Fault Tolerant Java Virtual Machine. Roy Friedman and Alon Kama Technion Haifa, Israel Fault Tolerant Java Virtual Machine Roy Friedman and Alon Kama Technion Haifa, Israel Objective Create framework for transparent fault-tolerance Support legacy applications Intended for long-lived, highly

More information

Supplement: Visual C++ Debugging

Supplement: Visual C++ Debugging Supplement: Visual C++ Debugging For Introduction to C++ Programming By Y. Daniel Liang Note: The screen shots are taken from VC++ 2010. It is the same for the later version. 1 Introduction The debugger

More information

Resource management. Real-Time Systems. Resource management. Resource management

Resource management. Real-Time Systems. Resource management. Resource management Real-Time Systems Specification Implementation Verification Mutual exclusion is a general problem that exists at several levels in a real-time system. Shared resources internal to the the run-time system:

More information

Hybrid Static-Dynamic Analysis for Statically Bounded Region Serializability

Hybrid Static-Dynamic Analysis for Statically Bounded Region Serializability Hybrid Static-Dynamic Analysis for Statically Bounded Region Serializability Aritra Sengupta, Swarnendu Biswas, Minjia Zhang, Michael D. Bond and Milind Kulkarni ASPLOS 2015, ISTANBUL, TURKEY Programming

More information

Learning from Bad Examples. CSCI 5828: Foundations of Software Engineering Lecture 25 11/18/2014

Learning from Bad Examples. CSCI 5828: Foundations of Software Engineering Lecture 25 11/18/2014 Learning from Bad Examples CSCI 5828: Foundations of Software Engineering Lecture 25 11/18/2014 1 Goals Demonstrate techniques to design for shared mutability Build on an example where multiple threads

More information

Reminder from last time

Reminder from last time Concurrent systems Lecture 2: More mutual exclusion, semaphores, and producer-consumer relationships DrRobert N. M. Watson 1 Reminder from last time Definition of a concurrent system Origins of concurrency

More information

NDSeq: Runtime Checking for Nondeterministic Sequential Specs of Parallel Correctness

NDSeq: Runtime Checking for Nondeterministic Sequential Specs of Parallel Correctness EECS Electrical Engineering and Computer Sciences P A R A L L E L C O M P U T I N G L A B O R A T O R Y NDSeq: Runtime Checking for Nondeterministic Sequential Specs of Parallel Correctness Jacob Burnim,

More information

Slides by Y. Nir-Buchbinder, adapted by O. Agmon Ben-Yehuda 1/30

Slides by Y. Nir-Buchbinder, adapted by O. Agmon Ben-Yehuda 1/30 Application of Synchronization Coverage Arkady Bron, Eitan Farchi, Yonit Magid, Yarden Nir-Buchbinder, Shmuel Ur PPoPP 2005 Presented in the spring 2011 Seminar on Advanced Topics in Concurrent Programming

More information

the complexity of predicting atomicity violations

the complexity of predicting atomicity violations the complexity of predicting atomicity violations Azadeh Farzan Univ of Toronto P. Madhusudan Univ of Illinois at Urbana Champaign. Motivation: Interleaving explosion problem Testing is the main technique

More information

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent

More information

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):

More information

32. Common Concurrency Problems.

32. Common Concurrency Problems. 32. Common Concurrency Problems. Oerating System: Three Easy Pieces AOS@UC 1 Common Concurrency Problems More recent work focuses on studying other tyes of common concurrency bugs. w Take a brief look

More information

Effective Data-Race Detection for the Kernel

Effective Data-Race Detection for the Kernel Effective Data-Race Detection for the Kernel John Erickson, Madanlal Musuvathi, Sebastian Burckhardt, Kirk Olynyk Microsoft Research Presented by Thaddeus Czauski 06 Aug 2011 CS 5204 2 How do we prevent

More information

Oracle 1Z Oracle9i Forms Developer: New Features.

Oracle 1Z Oracle9i Forms Developer: New Features. Oracle 1Z0-140 Oracle9i Forms Developer: New Features http://killexams.com/exam-detail/1z0-140 F. Leave the form as it is because key triggers function as they did in Forms 6i. Answer: B, E QUESTION: 93

More information

Implementing Symmetric Multiprocessing in LispWorks

Implementing Symmetric Multiprocessing in LispWorks Implementing Symmetric Multiprocessing in LispWorks Making a multithreaded application more multithreaded Martin Simmons, LispWorks Ltd Copyright 2009 LispWorks Ltd Outline Introduction Changes in LispWorks

More information

Multi-Core Programming

Multi-Core Programming Multi-Core Programming Increasing Performance through Software Multi-threading Shameem Akhter Jason Roberts Intel PRESS Copyright 2006 Intel Corporation. All rights reserved. ISBN 0-9764832-4-6 No part

More information

Eliminate Threading Errors to Improve Program Stability

Eliminate Threading Errors to Improve Program Stability Introduction This guide will illustrate how the thread checking capabilities in Intel Parallel Studio XE can be used to find crucial threading defects early in the development cycle. It provides detailed

More information

Finding and Reproducing Heisenbugs in Concurrent Programs

Finding and Reproducing Heisenbugs in Concurrent Programs Finding and Reproducing Heisenbugs in Concurrent Programs Madanlal Musuvathi Microsoft Research Shaz Qadeer Microsoft Research Piramanayagam Arumuga Nainar University of Wisconsin, Madison Thomas Ball

More information

Eliminate Threading Errors to Improve Program Stability

Eliminate Threading Errors to Improve Program Stability Eliminate Threading Errors to Improve Program Stability This guide will illustrate how the thread checking capabilities in Parallel Studio can be used to find crucial threading defects early in the development

More information

UPCRC. Illiac. Gigascale System Research Center. Petascale computing. Cloud Computing Testbed (CCT) 2

UPCRC. Illiac. Gigascale System Research Center. Petascale computing. Cloud Computing Testbed (CCT) 2 Illiac UPCRC Petascale computing Gigascale System Research Center Cloud Computing Testbed (CCT) 2 www.parallel.illinois.edu Mul2 Core: All Computers Are Now Parallel We con'nue to have more transistors

More information

Type Systems for Concurrent Programs

Type Systems for Concurrent Programs Type Systems for Concurrent Programs Naoki Kobayashi Tokyo Institute of Technology Type Systems for Programming Languages Guarantee partial correctness of programs fun fact (n) = if n=0 then 1 else n fact(n-1);

More information

RaceMob: Crowdsourced Data Race Detec,on

RaceMob: Crowdsourced Data Race Detec,on RaceMob: Crowdsourced Data Race Detec,on Baris Kasikci, Cris,an Zamfir, and George Candea School of Computer & Communica3on Sciences Data Races to shared memory loca,on By mul3ple threads At least one

More information

Testing Concurrent Java Programs Using Randomized Scheduling

Testing Concurrent Java Programs Using Randomized Scheduling Testing Concurrent Java Programs Using Randomized Scheduling Scott D. Stoller Computer Science Department State University of New York at Stony Brook http://www.cs.sunysb.edu/ stoller/ 1 Goal Pillars of

More information

Concurrency problems. To do. q Non-deadlock bugs q Resources & deadlocks q Dealing with deadlocks q Other issues q Next Time: I/O and file systems

Concurrency problems. To do. q Non-deadlock bugs q Resources & deadlocks q Dealing with deadlocks q Other issues q Next Time: I/O and file systems Concurrency problems To do q Non-deadlock bugs q Resources & deadlocks q Dealing with deadlocks q Other issues q Next Time: I/O and file systems Bugs in some modern applications From some key apps, a summary

More information

Deadlock Prevention. CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han

Deadlock Prevention. CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han Deadlock Prevention CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han Announcements HW #3 is due Friday Feb. 25 extra office hours Thursday 1 pm - post this PA #2 assigned, due Thursday March 17 Midterm

More information

Advanced Synchronization and Deadlock

Advanced Synchronization and Deadlock Advanced Synchronization and Deadlock A house of cards? Locks + CV/signal a great way to regulate access to a single shared object......but general multi-threaded programs touch multiple shared objects

More information

Maximal Causality Reduction for TSO and PSO. Shiyou Huang Jeff Huang Parasol Lab, Texas A&M University

Maximal Causality Reduction for TSO and PSO. Shiyou Huang Jeff Huang Parasol Lab, Texas A&M University Maximal Causality Reduction for TSO and PSO Shiyou Huang Jeff Huang huangsy@tamu.edu Parasol Lab, Texas A&M University 1 A Real PSO Bug $12 million loss of equipment curpos = new Point(1,2); class Point

More information