Analysis of Concurrent Software Models Using Partial Order Views Qiang Sun, Yuting Chen,

Slides:



Advertisements
Similar presentations
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Advertisements

Seyedehmehrnaz Mireslami, Mohammad Moshirpour, Behrouz H. Far Department of Electrical and Computer Engineering University of Calgary, Canada {smiresla,
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Concurrency: introduction1 ©Magee/Kramer 2 nd Edition Concurrency State Models and Java Programs Jeff Magee and Jeff Kramer.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
An Automata-based Approach to Testing Properties in Event Traces H. Hallal, S. Boroday, A. Ulrich, A. Petrenko Sophia Antipolis, France, May 2003.
Chapter 6 Concurrency: Deadlock and Starvation
Chapter 6 Concurrency: Deadlock and Starvation
An Case for an Interleaving Constrained Shared-Memory Multi- Processor CS6260 Biao xiong, Srikanth Bala.
Vertically Integrated Analysis and Transformation for Embedded Software John Regehr University of Utah.
Complexity Analysis (Part I)
Resolution of Encoding Conflicts by Signal Insertion and Concurrency Reduction based on STG Unfoldings V. Khomenko, A. Madalinski and A. Yakovlev University.
Aho-Corasick String Matching An Efficient String Matching.
Models of Computation for Embedded System Design Alvise Bonivento.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
1 Concurrency: Deadlock and Starvation Chapter 6.
Utah Verifier Group Research Overview Robert Palmer.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.
1 Compression Techniques to Simplify the Analysis of Large Execution Traces Abdelwahab Hamou-Lhadj and Dr. Timothy C. Lethbridge {ahamou,
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Exceptions and Mistakes CSE788 John Eisenlohr. Big Question How can we improve the quality of concurrent software?
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Pthread (continue) General pthread program structure –Encapsulate parallel parts (can be almost the whole program) in functions. –Use function arguments.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Concurrency: introduction1 ©Magee/Kramer Concurrency State Models and Java Programs Jeff Magee and Jeff Kramer.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Yang Liu, Jun Sun and Jin Song Dong School of Computing National University of Singapore.
Survey on Trace Analyzer (2) Hong, Shin /34Survey on Trace Analyzer (2) KAIST.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
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.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Process Synchronization.  Whenever processes share things, there is a chance for screwing up things  For example ◦ Two processes sharing one printer.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Basic Concepts of Component- Based Software Development (CBSD) Model-Based Programming and Verification.
Chapter 7 -1 CHAPTER 7 PROCESS SYNCHRONIZATION CGS Operating System Concepts UCF, Spring 2004.
Formal Methods for Software Engineering Part II: Modelling & Analysis of System Behaviour.
1 Interprocess Communication (IPC) - Outline Problem: Race condition Solution: Mutual exclusion –Disabling interrupts; –Lock variables; –Strict alternation.
Deadlock Analysis with Fewer False Positives Thread T1: sync(G){ sync(L1){ sync(L2){} } }; T3 = new T3(); j3.start(); J3.join(); sync(L2){ sync(L1){} }
1 Deadlock. 2 Concurrency Issues Past lectures:  Problem: Safely coordinate access to shared resource  Solutions:  Use semaphores, monitors, locks,
Background Concurrent access to shared data may result in data inconsistency Maintaining data consistency requires mechanisms to ensure the orderly execution.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Open Incremental Model Checking (OIMC) and the Role of Contracts Model-Based Programming and Verification.
Deadlock Operating Systems: Internals and Design Principles.
Parallel and Distributed Systems Laboratory Paradise: A Toolkit for Building Reliable Concurrent Systems Trace Verification for Parallel Systems Vijay.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Execution Replay and Debugging. Contents Introduction Parallel program: set of co-operating processes Co-operation using –shared variables –message passing.
ICDCS 2006 Efficient Incremental Optimal Chain Partition of Distributed Program Traces Selma Ikiz Vijay K. Garg Parallel and Distributed Systems Laboratory.
Reachability Testing of Concurrent Programs1 Reachability Testing of Concurrent Programs Richard Carver, GMU Yu Lei, UTA.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
CMPT 438 Algorithms.
Background on the need for Synchronization
Concurrent Processes.
INTER-PROCESS COMMUNICATION
Setac: A Phased Deterministic Testing Framework for Scala Actors
The Extensible Tool-chain for Evaluation of Architectural Models
Concurrent Graph Exploration with Multiple Robots
Background and Motivation
Predictability Verification with Petri Net Unfoldings
Presentation transcript:

Analysis of Concurrent Software Models Using Partial Order Views Qiang Sun, Yuting Chen, Jianjun Zhao, Shanghai Jiaotong University 25-Oct-15

Outline Motivation An approach to analysis of concurrent software models using partial order views Some simple examples

Motivation Checking and analyzing the software design model become crucial Analysis of concurrent software behavioural models still faces challenges – Data races, atomicity violations, bugs A number of analyses are on the basis of state models – A process can be modeled as a state machine in which the transitions are atomic or indivisible actions executed by the process. – LTS: Labeled Transition Systems – FSP (Finite State Processes), CCS, CSP

Analyzing a state model usually faces difficulties – Combination of state models leads to state space explosion

Solution? Modeling concurrency using partial orders Modeling concurrency using partial orders – Partial order view Extraction of partial orders of interest events from state machines – Partial orders can also be extracted from partial behavioral models. BiG provides the mechanism of the model transformation and synchronization. – State machine ↔ Pomset model

Labeled Partial Order (LPO) – A partial order is a pair (E, <), where < is an irreflexive transitive binary relation on the vertex set E. – A labeled partial order (lpo) is a structure (E, ∑, μ, <), where (E, <) is a partial order, and μ : E→∑ labels the vertices of E with elements of the set ∑. – (E, ∑, μ, <) and (E’, ∑’, μ’, <’) over the same set of labels ∑ are isomorphic if – there exists a bijection τ: E→E’ such that for all u, v ∈ E, μ(u)= μ’(τ(u)), and u < v iff τ(u) <’ τ(v).

Partial Order Multi-Set (Pomset) A pomset [E, ∑, μ, <] is the isomorphism class of an lpo (E, ∑, μ, <). – A pomset [E, ∑, μ, <] is finite if E is finite. – Two pomsets [E, ∑, μ, <] and [E’, ∑’, μ’, <’] are isomorphic if there exist bijections τ : E→E’ and ν: ∑ → ∑’, such that for all u, v ∈ E and for all a ∈ ∑, μ(u) = a iff μ’ ( μ (u)) = ν(a), and u < v iff τ(u) <’τ(v).

Two Operations Let – p = [E, ∑, <, μ] – p' = [E’, ∑, <’, μ’] – E ∩ E' = Φ. Series operation – p;p’ = [E ∪ E’, ∑, (< ∪ <’ ∪ (E×E’)), μ ∪ μ’] Parallel operation – p||p’ = [E ∪ E’, ∑, (< ∪ <’), μ ∪ μ’]

Pomset Model – Actions & events An action may occur more than once. ∑ An occurrence of an action is an event. E Pomset model helps analyze and understand the behaviors of concurrent software better. – Happens-before relationship for the events of interest – Calculating the possible traces – Pomset model can avoid state space explosion; the increment of the events is linear. AB

Analysis of Concurrent Software Models Using Partial Order Views To extract pomset model – Computing the partial order of events within one process. – Merging partial orders of different processes through parallel operation. To analyze pomset model and check event traces To revisit state model whether we detect abnormal event traces Bidirectional Graph Transformation technique provides with support in transforming state model to pomset model and keeping model synchronization. – The result can be easily mapped back to the original LTS.

SMALL EXAMPLES

Semaphore Semaphore LTS Loop 0 1 up down up down critical up down critical 2

Begin up critical 1down critical 2down End

Elevator System Outer request – FLOOR × {UP, DOWN} Inner request – FLOOR TO GO TO Controller of elevators – Out requests: accessing request queue – Inner requests: message passing 5 floors and 2 elevators

0 send Outer request queue 013 send receive send 2 receive User in elevator Inner request buffer getREQ receive response receive elevator

getREQ send receive send receive send receive Begin responseEnd

get send receive send receive send receive Begin responseEnd remove

0 send Outer request queue send receive send 2 receive User in elevator Inner request buffer response 1’ receive getremove elevator

getREQ receive response receive getREQ send receive send receive send receive Begin responseEnd get send receive send receive send receive Begin responseEnd remove response 1’ receive getremove

Two elevators Outer request queue response 1’ receive getremove Elevator response 1’ receive getremove Elevator 2

Begin get1get2 remove1remove2 get1 → get2 → remove1 → remove2

Lock & Unlock Begin lock get1get2 remove1 remove2 unlock Begin lock get1get2 remove1 remove2 unlock

Outer request queue response 1’ receive getremove Elevator 1 1’’1’’’ unlock lock response 1’ receive getremove Elevator 2 1’’1’’’ unlock lock

Partial order event model provides engineers with – A different view about the events occurring in the concurrent software system and their order. – Bidirectional model transformation technique helps transform state model to partial order event model Detection of potential errors is possible from taking advantage of information about partial order event model – To detect data races by associating the events to accessing the shared memory – To detect atomicity violations by associating actions to accessing resources – Determination of the real bugs usually relies on human judgements – Bidirectional model transformation technique helps reveal the bugs in the state model if any abnormal event traces are found

Conclusions State model is widely used in practice Pomset model can avoid state space explosion An approach to checking and analyzing state model using pomset model BiG provides the mechanism of model transformation and bug elimination

Future Work A systematic approach Correctness of the approach – Case studies and experiments Tool Support