Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter: M. Amin Alipour Software Design Laboratory

Slides:



Advertisements
Similar presentations
Topic Reviews For Unit ET156 – Introduction to C Programming Topic Reviews For Unit
Advertisements

Dataflow Analysis for Datarace-Free Programs (ESOP 11) Arnab De Joint work with Deepak DSouza and Rupesh Nasre Indian Institute of Science, Bangalore.
Advanced programming tools at Microsoft
Overview Structural Testing Introduction – General Concepts
Effective Static Deadlock Detection
1 Chao Wang, Yu Yang*, Aarti Gupta, and Ganesh Gopalakrishnan* NEC Laboratories America, Princeton, NJ * University of Utah, Salt Lake City, UT Dynamic.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Conditional Must Not Aliasing for Static Race Detection Mayur Naik Alex Aiken Stanford University.
CS412/413 Introduction to Compilers Radu Rugina Lecture 37: DU Chains and SSA Form 29 Apr 02.
Some Properties of SSA Mooly Sagiv. Outline Why is it called Static Single Assignment form What does it buy us? How much does it cost us? Open questions.
Goldilocks: Efficiently Computing the Happens-Before Relation Using Locksets Tayfun Elmas 1, Shaz Qadeer 2, Serdar Tasiran 1 1 Koç University, İstanbul,
Lecture 5 Concurrency and Process/Thread Synchronization     Mutual Exclusion         Dekker's Algorithm         Lamport's Bakery Algorithm.
Chapter 6: Process Synchronization
Introduction to Program Slicing Presenter: M. Amin Alipour Software Design Laboratory
Scaling Model Checking of Dataraces Using Dynamic Information Ohad Shacham Tel Aviv University IBM Haifa Lab Mooly Sagiv Tel Aviv University Assaf Schuster.
Today’s Agenda  Midterm: Nov 3 or 10  Finish Message Passing  Race Analysis Advanced Topics in Software Engineering 1.
/ PSWLAB Atomizer: A Dynamic Atomicity Checker For Multithreaded Programs By Cormac Flanagan, Stephen N. Freund 24 th April, 2008 Hong,Shin.
Summarizing Procedures in Concurrent Programs Shaz Qadeer Sriram K. Rajamani Jakob Rehof Microsoft Research.
Concurrency.
Interprocedural analysis © Marcelo d’Amorim 2010.
CS533 Concepts of Operating Systems Class 3 Data Races and the Case Against Threads.
Scalable Error Detection using Boolean Satisfiability 1 Yichen Xie and Alex Aiken Stanford University.
Aliases in a bug finding tool Benjamin Chelf Seth Hallem June 5 th, 2002.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Context-Sensitive Flow Analysis Using Instantiation Constraints CS 343, Spring 01/02 John Whaley Based on a presentation by Chris Unkel.
Efficient dynamic race detection int x; void * t1(){ x = 2; } void * t2(){ x = 3; } main(){ pthread_create( t1 ); pthread_create( t2 ); printf( “x is %d\n”,
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
1 Control Flow Analysis Mooly Sagiv Tel Aviv University Textbook Chapter 3
Compositional Pointer and Escape Analysis for Java Programs Martin Rinard Laboratory for Computer Science MIT John Whaley IBM Tokyo Research Laboratory.
Range Analysis. Intraprocedural Points-to Analysis Want to compute may-points-to information Lattice:
1 Refinement-Based Context-Sensitive Points-To Analysis for Java Manu Sridharan, Rastislav Bodík UC Berkeley PLDI 2006.
A Context-Sensitive Pointer Analysis Phase in Open64 Compiler Tianwei Sheng, Wenguang Chen, Weimin Zheng Tsinghua University.
Intraprocedural Points-to Analysis Flow functions:
1 RELAY: Static Race Detection on Millions of Lines of Code Jan Voung, Ranjit Jhala, and Sorin Lerner UC San Diego speaker.
Pointer and Shape Analysis Seminar Mooly Sagiv Schriber 317 Office Hours Thursday
Reps Horwitz and Sagiv 95 (RHS) Another approach to context-sensitive interprocedural analysis Express the problem as a graph reachability query Works.
A. Frank - P. Weisberg Operating Systems Introduction to Cooperating Processes.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Part 2: Reachability analysis of stack-based systems.
Looper: Lightweight Detection of Infinite Loops at Runtime Presenter: M. Amin Alipour Software Design Laboratory
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Points-to Analysis in Almost Linear Time paper by Bjarne Steensgaard 23rd ACM Symposium on Principles of Programming Languages (POPL'96) Microsoft Research.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Procedure Optimizations and Interprocedural Analysis Chapter 15, 19 Mooly Sagiv.
Objective - To graph linear equations using x-y charts. One Variable Equations Two Variable Equations 2x - 3 = x = 14 x = 7 One Solution.
CUTE: A Concolic Unit Testing Engine for C Technical Report Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
50.530: Software Engineering Sun Jun SUTD. Week 8: Race Detection.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
“Software” Esterel Execution (work in progress) Dumitru POTOP-BUTUCARU Ecole des Mines de Paris
Fast Points-to Analysis for Languages with Structured Types Michael Jung and Sorin A. Huss Integrated Circuits and Systems Lab. Department of Computer.
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
Dataflow Analysis for Concurrent Programs using Datarace Detection Ravi Chugh, Jan W. Voung, Ranjit Jhala, Sorin Lerner LBA Reading Group Michelle Goodstein.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
Points-To Analysis in Almost Linear Time Josh Bauman Jason Bartkowiak CSCI 3294 OCTOBER 9, 2001.
Synchronicity Introduction to Operating Systems: Module 5.
Lecture 3 Concurrency and Thread Synchronization     Mutual Exclusion         Dekker's Algorithm         Lamport's Bakery Algorithm.
Effective Static Deadlock Detection Mayur Naik (Intel Research) Chang-Seo Park and Koushik Sen (UC Berkeley) David Gay (Intel Research)
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Points-to Analysis as a System of Linear Equations Rupesh Nasre. Computer Science and Automation Indian Institute of Science Advisor: Prof. R. Govindarajan.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Interprocedural Analysis Chapter 19
Performance Optimization for Embedded Software
Pointer analysis.
When a function is called...
Pointer Analysis Jeff Da Silva Sept 20, 2004 CARG.
Pointer analysis John Rollinson & Kaiyuan Li
Presentation transcript:

Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter: M. Amin Alipour Software Design Laboratory

Outline Introduction Problem Statement Main Contribution Solution Experimental Results

Introduction Data Race: – When there is multiple threads access a shared data and at least one of them write.

Static Data Race Detection Given source code of a program determine the possible places that race may occur.

Detection Criteria – Soundness Preserving every real data race – Accuracy Keeping the bogus warning low – Scalability Being efficient in large programs

Subtleties with Static Detection Asynchronous Function Call Recursion Accuracy int h1 (int x) { return x * x; } int h2 (int y) { return y + y;} struct funcType { int (*func) (int); } void f (int x, funcType *g, int *z) { l2: if ( x > 0) { *z = *(g->func) (x); } l3: else { *z = *(g->func) (-x); } } int main () { struct funcType ft; int a, b, p1, p2, z; struct thread t1, t2;.... if (p1) { ft.func = &h1; l0: fork (t1, f, a, ft, &z); join (t1); }... if (p2) { ft.func = &h2; l1: fork (t2, f, b, ft, &z); join (t2);

Main Contribution An improvement to – Emami, M., Ghiya, R., and Hendren, L. J. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation.

Classical Approach 1- Identify shared variables 2- Enumerate control location 3- Determine lockset ( set of locks held on all accesses to data at the location ) 4- Determine possible race locations, by lockset analysis ( Empty lockset indicates possible data races ) 5- Prune results in Step 4

Concurrent Control Flow Graph

Example Emami and et al’s CCFG Unrolled CCFG

Strategy to explore CCFG Unroll CCFG until no new data flow tuple D=(A,L) visited. – A is set of aliases – L is Lockset Would CCFG be finite? – Yes, the worst case is O(|F||P|2 |P| 2 |L| ) |F| number of functions |P| number of functions cardinality of Steensgaard’s pointers set |L| set of locks

Assumptions The algorithm uses Steensgard’s algorithm for points-to analysis, which results possible pointers that may point to same objects (variable or function) The algorithm assumes that number of statements affecting locks,functions and threads are small.

Pruning the result It uses a thread order analysis to remove any warning wherein the program location pairs that do not occur.

Pruning algorithm

Concurrent call graph int h1 (int x) { return x * x; } int h2 (int y) { return y + y;} struct funcType { int (*func) (int); } void f (int x, funcType *g, int *z) { l2: if ( x > 0) { *z = *(g->func) (x); } l3: else { *z = *(g->func) (-x); } } int main () { struct funcType ft; int a, b, p1, p2, z; struct thread t1, t2;.... if (p1) { ft.func = &h1; l0: fork (t1, f, a, ft, &z); join (t1); }... if (p2) { ft.func = &h2; l1: fork (t2, f, b, ft, &z); join (t2);

Experimental Results

References . V. Kahlon, N, Sinha, Y. Zhang and E. Kruus. “Static Data Race Detection for Concurrent Programs Asynchronous Calls” The 7th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE), Amsterdam, The Netherlands. August 2009.