Java PathFinder. Pavel Parízek. CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

Size: px
Start display at page:

Download "Java PathFinder. Pavel Parízek. CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics"

Transcription

1 Java PathFinder Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

2 Java PathFinder (JPF) Verification framework for Java programs Explicit state space traversal (with POR) Highly customizable and extensible (API) Open source since April 2005 Maintainers: NASA Ames Research Center WWW: Pavel Parízek Java Pathfinder 2

3 What JPF really is... Special JVM Execution choices Backtracking State matching State space exploration assertions, deadlocks, races,... Pavel Parízek Java Pathfinder 3

4 Pavel Parízek Java Pathfinder 4 General usage pattern Picture taken from JPF wiki (

5 Pavel Parízek Java Pathfinder 5 Architecture Picture taken from JPF wiki (

6 Program state space in JPF States Full snapshot of JVM Dynamic heap Thread stacks Program counters Static data (classes) Locks and monitors Pavel Parízek Java Pathfinder 6

7 Program state space in JPF Transitions Non-empty sequences of bytecode instructions Terminates when JPF makes a new choice Pavel Parízek Java Pathfinder 7

8 Program state space in JPF Choices Thread scheduling Data (boolean, int) Pavel Parízek Java Pathfinder 8

9 Pavel Parízek Java Pathfinder 9 On-the-fly state space construction public Producer extends Thread { void run() { while (true) { d.buf = i; i++; d.count++; P public Consumer extends Thread { void run() { while (true) { C k = d.buf; print(k); public static void main(...) { Data d = new Data(); new Producer(d).start(); new Consumer(d).start(); P: buf = i P: i++ <start threads> C: k = buf C: print(k)

10 Pavel Parízek Java Pathfinder 10 On-the-fly state space construction public Producer extends Thread { void run() { while (true) { d.buf = i; i++; d.count++; P: buf = i P: i++ <start threads> C: k = buf C: print(k) public Consumer extends Thread { void run() { while (true) { k = d.buf; print(k); P: count ++ public static void main(...) { Data d = new Data(); new Producer(d).start(); new Consumer(d).start(); C: k = buf C: print(k)

11 Pavel Parízek Java Pathfinder 11 On-the-fly state space construction public Producer extends Thread { void run() { while (true) { d.buf = i; i++; d.count++; P: buf = i P: i++ <start threads> C: k = buf C: print(k) public Consumer extends Thread { void run() { while (true) { k = d.buf; print(k); P: count ++ P: buf = i P: i++ public static void main(...) { Data d = new Data(); new Producer(d).start(); new Consumer(d).start(); P: buf = i P: i++ C: k = buf C: print(k) C: k = buf C: print(k)

12 Properties Built-in Deadlock freedom Race conditions Uncaught exceptions Assertions Pavel Parízek Java Pathfinder 12

13 Features Partial order reduction Class loading symmetry Heap symmetry Selected heuristics Pavel Parízek Java Pathfinder 13

14 Running JPF Pavel Parízek Java Pathfinder 14

15 Running JPF Download JPF and unpack somewhere _verification/files/jpf.zip Example: Dining Philosophers Command: java -jar build\runjpf.jar src\examples\diningphil.jpf Output: application, error info, statistics Pavel Parízek Java Pathfinder 15

16 Error info Full error trace (counterexample) Snapshot of the error state Message from the property checker Command: java -jar build\runjpf.jar +report.console.property_violation =trace,error,snapshot src\examples\diningphil.jpf Pavel Parízek Java Pathfinder 16

17 Running JPF Examples BoundedBuffer Crossing oldclassic Racer Pavel Parízek Java Pathfinder 17

18 JPF API Pavel Parízek Java Pathfinder 18

19 Pavel Parízek Java Pathfinder 19 JPF API Listeners Inspecting current program state Custom properties Search driver Advanced Instruction factory (bytecode interpreter) Scheduler (sync policy, sharedness policy)

20 Listeners Observer design pattern Notified about specific events JVM: bytecode instruction executed, new heap object allocated, start of a new thread State space traversal: new state, backtrack, finish Inspecting current program state heap objects, local variables, thread call stacks,... Pavel Parízek Java Pathfinder 20

21 Listeners SearchListener VMListener ListenerAdapter Examples (source code) JPF/src/main/gov/nasa/jpf/listener Pavel Parízek Java Pathfinder 21

22 Custom properties Property GenericProperty PropertyListenerAdapter Common practice: decide property status based on listener notifications (and program state) Examples (source code) JPF/src/main/gov/nasa/jpf/vm Pavel Parízek Java Pathfinder 22

23 Registering listeners and properties listener=<class name 1>,...,<class N> search.listener=... search.properties=... Pavel Parízek Java Pathfinder 23

24 Pavel Parízek Java Pathfinder 24 Listeners: tracking bytecode instructions ExecTracker ObjectTracker

25 Pavel Parízek Java Pathfinder 25 Listeners: inspecting program state CallMonitor ObjectTracker

26 Pavel Parízek Java Pathfinder 26 Task 1 Write your own listener After every field write instruction, print the field name and new value Before every method call (invoke), print values of all parameters supplied by the caller Use existing classes as a basic template ListenerAdapter, VMListener, CallMonitor, ObjectTracker src/main/gov/nasa/jpf/listener/* src/main/gov/nasa/jpf/jvm/bytecode/* Ask questions!!

27 Pavel Parízek Java Pathfinder 27 Configuration properties File jpf.properties

28 JPF wiki User guide Internals (developer guide) Pavel Parízek Java Pathfinder 28

29 JPF source code tree src/main/gov/nasa/jpf the main class (JPF), interfaces vm: virtual machine, choices, built-in properties jvm: Java bytecode specific, instructions, class file search: search driver, heuristics util: custom data structures, utility classes report: reporting system (console, XML) listener: various listeners Pavel Parízek Java Pathfinder 29

30 JPF and native methods Pavel Parízek Java Pathfinder 30

31 JPF and native methods Support for all Java bytecode instructions but some library methods are native file I/O, GUI, networking,... Problem JPF cannot determine how execution of a native method changes the program state Solution: Model-Java Interface (MJI) Pavel Parízek Java Pathfinder 31

32 Pavel Parízek Java Pathfinder 32 Model-Java Interface (MJI) Executing native methods in the underlying JVM Similar mechanism to Java-Native Interface (JNI) Custom versions of some Java library classes Object, Thread, Class, java.util.concurrent.*,...

33 Environment construction Pavel Parízek Java Pathfinder 33

34 Environment construction Why: some programs do not contain main libraries, components, plug-ins Problem: JPF accepts only complete programs Solution: create artificial environment Program with multiple threads and data choices Also called test driver Pavel Parízek Java Pathfinder 34

35 Pavel Parízek Java Pathfinder 35 Example Program: java.util.hashmap public class PutTh extends Thread { Map m; public void run() { m.put( 1, abc ); m.put( 2, def ); public class GetTh extends Thread { Map m; public static void main(...) { Map m = new HashMap(); Thread th1 = new PutTh(m); Thread th2 = new GetTh(m); th1.start(); th2.start(); th1.join(); th2.join(); public void run() { m.get( 1 ); m.get( 0 );

36 Environment construction challenges Coverage Should trigger all (most) execution paths, thread interleavings, and error states Approach Different method call sequences Many combinations of parameter values Several concurrent threads State explosion Use the least possible number of concurrent threads (2) Reasonable number of parameter values (domain size) Pavel Parízek Java Pathfinder 36

37 Using the Verify class Pavel Parízek Java Pathfinder 37 JPF-aware test drivers (environments) Checking program behavior for different inputs Data choice import gov.nasa.jpf.vm.verify if (Verify.getBoolean()) int x = Verify.getInt(0,10) Search pruning Verify.ignoreIf(cond)

38 Task 2 Write reasonable environment for java.util.linkedlist java.util.concurrent.semaphore Run JPF on the complete program Enable search for data race conditions Use: gov.nasa.jpf.listener.preciseracedetector Try different workloads (threads, input data) Pavel Parízek Java Pathfinder 38

39 Time for questions about JPF Architecture Implementation How something works Public API Output Play with JPF (look into source code, try examples) Explore wiki: Ask questions Pavel Parízek Java Pathfinder 39

Java Pathfinder. State of Affairs. Pavel Parizek. School of Computer Science, University of Waterloo

Java Pathfinder. State of Affairs. Pavel Parizek. School of Computer Science, University of Waterloo Java Pathfinder General Overview and Current State of Affairs School of Computer Science, University of Waterloo Java Pathfinder Highly customizable and extensible platform for analysis and verification

More information

Symbolic PathFinder, Pex, RoadRunner

Symbolic PathFinder, Pex, RoadRunner Symbolic PathFinder, Pex, RoadRunner http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Pavel Parízek Symbolic Execution, Dynamic Analysis 2 JPF extensions

More information

EECS Mission Critical Systems

EECS Mission Critical Systems EECS 4315 3.0 Mission Critical Systems Midterm 9:00 10:15 on March 1, 2018 Last name: First name: EECS login: Instructions No questions are allowed during the test. If a question is not clear, then write

More information

Computing Approximate Happens-Before Order with Static and Dynamic Analysis

Computing Approximate Happens-Before Order with Static and Dynamic Analysis Department of Distributed and Dependable Systems Technical report no. D3S-TR-2013-06 May 7, 2018 Computing Approximate Happens-Before Order with Static and Dynamic Analysis Pavel Parízek, Pavel Jančík

More information

Hybrid POR with Under-Approximate Dynamic Points-To and Determinacy Information

Hybrid POR with Under-Approximate Dynamic Points-To and Determinacy Information Hybrid POR with Under-Approximate Dynamic Points-To and Determinacy Information http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics P. Parízek Hybrid POR

More information

Java PathFinder JPF 2 Second Generation of Java Model Checker

Java PathFinder JPF 2 Second Generation of Java Model Checker Java PathFinder JPF 2 Second Generation of Java Model Checker Guenther Brand Mat. Nr. 9430535 27. 06. 2003 Abstract This essay is based on the papers Java PathFinder, Second Generation of Java Model Checker

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

State Extensions for Java PathFinder

State Extensions for Java PathFinder State Extensions for Java PathFinder Darko Marinov University of Illinois at Urbana-Champaign JPF Workshop May 1, 2008 Broader Context: Work on JPF at UIUC Two lines of work Extend functionality Improve

More information

Hybrid Analysis for Partial Order Reduction of Programs with Arrays

Hybrid Analysis for Partial Order Reduction of Programs with Arrays Hybrid Analysis for Partial Order Reduction of Programs with Arrays Pavel Parízek Charles University in Prague, Faculty of Mathematics and Physics, Department of Distributed and Dependable Systems Abstract.

More information

Environment Modeling for Modular Software Analysis with Java PathFinder Part 1

Environment Modeling for Modular Software Analysis with Java PathFinder Part 1 Environment Modeling for Modular Software Analysis with Java PathFinder Part 1 Oksana Tkachuk SGT/NASA Ames oksana.tkachuk@nasa.gov Peter Mehlitz SGT/NASA Ames peter.c.mehlitz@nasa.gov Software Model Checking

More information

- Aditya Kapre, Graduate Student, CSE Department, University at Buffalo

- Aditya Kapre, Graduate Student, CSE Department, University at Buffalo 1. Project title: Visualization and Query-based Analysis of JPF Traces - Aditya Kapre, Graduate Student, CSE Department, University at Buffalo 2. Project description: The goal of this project is to facilitate

More information

i219 Software Design Methodology 11. Software model checking Kazuhiro Ogata (JAIST) Outline of lecture

i219 Software Design Methodology 11. Software model checking Kazuhiro Ogata (JAIST) Outline of lecture i219 Software Design Methodology 11. Software model checking Kazuhiro Ogata (JAIST) Outline of lecture 2 Concurrency Model checking Java Pathfinder (JPF) Detecting race condition Bounded buffer problem

More information

jpf-concurrent: An extension of Java PathFinder for java.util.concurrent

jpf-concurrent: An extension of Java PathFinder for java.util.concurrent jpf-concurrent: An extension of Java PathFinder for java.util.concurrent Mateusz Ujma Department of Computer Science, University of Oxford Oxford, United Kingdom Email: mateusz.ujma@cs.ox.ac.uk Nastaran

More information

Using Java Pathfinder to Reason about Agent Systems

Using Java Pathfinder to Reason about Agent Systems Using Java Pathfinder to Reason about Agent Systems Franco Raimondi f.raimondi@mdx.ac.uk Department of Computer Science Middlesex University http://www.rmnd.net Liverpool, 11th September 2015 Joint work

More information

Specification and Generation of Environment for Model Checking of Software Components *

Specification and Generation of Environment for Model Checking of Software Components * Specification and Generation of Environment for Model Checking of Software Components * Pavel Parizek 1, Frantisek Plasil 1,2 1 Charles University, Faculty of Mathematics and Physics, Department of Software

More information

Automatic On-demand Delegation of Calls in Java PathFinder

Automatic On-demand Delegation of Calls in Java PathFinder Automatic On-demand Delegation of Calls in Java PathFinder Nastaran Shafiei 1 and Franck van Breugel 1,2 1 Department of Computer Science and Engineering, York University, Canada 2 Department of Computer

More information

Program Analysis and Code Verification

Program Analysis and Code Verification Program Analysis and Code Verification http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Language Lectures: English Labs: English Homework: Czech/English

More information

Fex: A Model Checking Framework for Event Sequences. Xin Li

Fex: A Model Checking Framework for Event Sequences. Xin Li Fex: A Model Checking Framework for Event Sequences Xin Li 2 Table of Contents 1 Introduction 1 1.1 Statement of Research Problem.......................... 1 1.2 Overview of the Work...............................

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 26: Properties, Listener and Java Pathfinder Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Feb 03, 2012 Jochen Hoenicke (Software Engineering)

More information

JPF Lab Formal Methods Summer School 2011 Menlo College

JPF Lab Formal Methods Summer School 2011 Menlo College JPF Lab Formal Methods Summer School 2011 Menlo College Neha Rungta SGT / NASA Ames Research Center Peter C. Mehlitz SGT / NASA Ames Research Center

More information

JPF SE: A Symbolic Execution Extension to Java PathFinder

JPF SE: A Symbolic Execution Extension to Java PathFinder JPF SE: A Symbolic Execution Extension to Java PathFinder Saswat Anand 1,CorinaS.Păsăreanu 2, and Willem Visser 2 1 College of Computing, Georgia Institute of Technology saswat@cc.gatech.edu 2 QSS and

More information

Slice n Dice Algorithm Implementation in JPF

Slice n Dice Algorithm Implementation in JPF Brigham Young University BYU ScholarsArchive All Theses and Dissertations 2014-07-01 Slice n Dice Algorithm Implementation in JPF Eric S. Noonan Brigham Young University - Provo Follow this and additional

More information

Model Checking with Abstract State Matching

Model Checking with Abstract State Matching Model Checking with Abstract State Matching Corina Păsăreanu QSS, NASA Ames Research Center Joint work with Saswat Anand (Georgia Institute of Technology) Radek Pelánek (Masaryk University) Willem Visser

More information

JPF Report System and Model Classes EECS https://wiki.eecs.yorku.ca/course_archive/ /w/4315/

JPF Report System and Model Classes EECS https://wiki.eecs.yorku.ca/course_archive/ /w/4315/ JPF Report System and Model Classes EECS 4315 https://wiki.eecs.yorku.ca/course_archive/2016-17/w/4315/ Today s Plan XML JPF Report System Implementing a PublisherExtension Parameterizing a Listener Model

More information

Extraction of Component-Environment Interaction Model Using State Space Traversal

Extraction of Component-Environment Interaction Model Using State Space Traversal Extraction of Component-Environment Interaction Model Using State Space Traversal ABSTRACT Pavel Parizek Department of Software Engineering Faculty of Mathematics and Physics Charles University, Malostranske

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

Search EECS /57

Search EECS /57 1/57 Search EECS 4315 www.eecs.yorku.ca/course/4315/ Source: weknowyourdreams.com 2/57 Breadth first search 3/57 import gov.nasa.jpf.search.search; public class BFSearch extends Search {... Constructor

More information

Introducing Binary Decision Diagrams in the Explicit-State Verification of Java Code

Introducing Binary Decision Diagrams in the Explicit-State Verification of Java Code Introducing Binary Decision Diagrams in the Explicit-State Verification of Java Code Alexander von Rhein, Sven Apel University of Passau Passau, Germany e-mail: {rhein,apel@fim.uni-passau.de Franco Raimondi

More information

Platform-Specific Restrictions on Concurrency in Model Checking of Java Programs

Platform-Specific Restrictions on Concurrency in Model Checking of Java Programs Platform-Specific Restrictions on Concurrency in Model Checking of Java Programs Pavel Parizek and Tomas Kalibera Distributed Systems Research Group, Department of Software Engineering, Faculty of Mathematics

More information

Verification of Intelligent Software

Verification of Intelligent Software Verification of Intelligent Software Charles Pecheur (RIACS / NASA Ames) Charles Pecheur 2003 1 Contents Model Checking for Intelligent Software Why? Intelligent software, how to verify it? What? A bird's-eye

More information

JVM Independent Replay in Java

JVM Independent Replay in Java JVM Independent Replay in Java RV 04 April 3, 2004, Barcelona, Spain Viktor Schuppan, Marcel Baur, Armin Biere Computer Systems Institute, ETH Zürich http://www.inf.ethz.ch/ schuppan/ Introduction 1 How

More information

Cooperari A tool for cooperative testing of multithreaded Java programs

Cooperari A tool for cooperative testing of multithreaded Java programs Cooperari A tool for cooperative testing of multithreaded Java programs Eduardo R. B. Marques, Francisco Martins, Miguel Simões! LASIGE/Departamento de Informática Faculdade de Ciências da Universidade

More information

Specification and Generation of Environment for Model Checking of Software Components

Specification and Generation of Environment for Model Checking of Software Components Specification and Generation of Environment for Model Checking of Software Components Pavel Parizek a,1, Frantisek Plasil a,b,1 a Department of Software Engineering Charles University, Faculty of Mathematics

More information

Reachability testing for concurrent programs. Yu Lei and Richard Carver Presented by Thuan Huynh

Reachability testing for concurrent programs. Yu Lei and Richard Carver Presented by Thuan Huynh Reachability testing for concurrent programs Yu Lei and Richard Carver Presented by Thuan Huynh Introduction Some existing tools Reachability testing Concepts Algorithm Implementation Optimizations Results

More information

Carmen : Software Component Model Checker

Carmen : Software Component Model Checker Carmen : Software Component Model Checker Aleš Plšek 1 and Jiří Adámek 2,3 1 INRIA-Lille, Nord Europe, Project ADAM USTL-LIFL CNRS UMR 8022, France ales.plsek@inria.fr 2 Distributed Systems Research Group

More information

Deductive Methods, Bounded Model Checking

Deductive Methods, Bounded Model Checking Deductive Methods, Bounded Model Checking http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Deductive methods Pavel Parízek Deductive Methods, Bounded

More information

Introduction In Practice State Explosion Problem Infinity and Uncomputability Techniques References. Model Checking. Toryn Qwyllyn Klassen

Introduction In Practice State Explosion Problem Infinity and Uncomputability Techniques References. Model Checking. Toryn Qwyllyn Klassen Model Checking Toryn Qwyllyn Klassen April 13, 2010 Limitations of testing Testing cannot in general prove that a program works. Some program states are usually not covered. Concurrent systems are particularly

More information

Postprint. This is the accepted version of a paper presented at TOOLS EUROPE 2008.

Postprint.   This is the accepted version of a paper presented at TOOLS EUROPE 2008. http://www.diva-portal.org Postprint This is the accepted version of a paper presented at TOOLS EUROPE 2008. Citation for the original published paper: Artho, C., Leungwattanakit, W., Hagiya, M., Tanabe,

More information

Lecture 12: Software Verification Using Explicit State Model Checking, Java Path Finder, CMC

Lecture 12: Software Verification Using Explicit State Model Checking, Java Path Finder, CMC CS 267: Automated Verification Lecture 12: Software Verification Using Explicit State Model Checking, Java Path Finder, CMC Instructor: Tevfik Bultan Software s Chronic Crisis Large software systems often:

More information

A Quantitative Evaluation of the Contribution of Native Code to Java Workloads

A Quantitative Evaluation of the Contribution of Native Code to Java Workloads A Quantitative Evaluation of the Contribution of Native Code to Java Workloads Walter Binder University of Lugano Switzerland walter.binder@unisi.ch Jarle Hulaas, Philippe Moret EPFL Switzerland {jarle.hulaas,philippe.moret}@epfl.ch

More information

Efficient Solving of Structural Constraints

Efficient Solving of Structural Constraints Efficient Solving of Structural Constraints Bassem Elkarablieh University of Texas at Austin Austin, TX 78712 elkarabl@ece.utexas.edu Darko Marinov University of Illinois at Urbana Urbana, IL 61801 marinov@cs.uiuc.edu

More information

Concurrency EECS /36

Concurrency EECS /36 1/36 Concurrency EECS 4315 www.eecs.yorku.ca/course/4315/ Correct? 2/36 Question Is the developed class Database correct? Correct? 2/36 Question Is the developed class Database correct? Answer Maybe. Correct?

More information

Environment Modeling with JavaPathfinder (JPF) Part 3 - Lab

Environment Modeling with JavaPathfinder (JPF) Part 3 - Lab Environment Modeling with JavaPathfinder (JPF) Part 3 - Lab Oksana Tkachuk SGT / NASA Ames Research Center Peter C. Mehlitz SGT / NASA Ames Research Center

More information

Context-Switch-Directed Verification in DIVINE

Context-Switch-Directed Verification in DIVINE Context-Switch-Directed Verification in DIVINE MEMICS 2014 Vladimír Štill Petr Ročkai Jiří Barnat Faculty of Informatics Masaryk University, Brno October 18, 2014 Vladimír Štill et al. Context-Switch-Directed

More information

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder JAVA PERFORMANCE PR SW2 S18 Dr. Prähofer DI Leopoldseder OUTLINE 1. What is performance? 1. Benchmarking 2. What is Java performance? 1. Interpreter vs JIT 3. Tools to measure performance 4. Memory Performance

More information

BEAJRockit Mission Control. Monitoring Thread Activity with the JRockit Management Console

BEAJRockit Mission Control. Monitoring Thread Activity with the JRockit Management Console BEAJRockit Mission Control Monitoring Thread Activity with the JRockit Management Console ProductNameShort 3.0.2 Document Revised: June, 2008 Contents Introduction to Monitoring Threads Getting Familiar

More information

MultiJav: A Distributed Shared Memory System Based on Multiple Java Virtual Machines. MultiJav: Introduction

MultiJav: A Distributed Shared Memory System Based on Multiple Java Virtual Machines. MultiJav: Introduction : A Distributed Shared Memory System Based on Multiple Java Virtual Machines X. Chen and V.H. Allan Computer Science Department, Utah State University 1998 : Introduction Built on concurrency supported

More information

Model Checking Real-time Java

Model Checking Real-time Java Model Checking Real-time Java Pavel Parizek 1, Tomas Kalibera 1, and Jan Vitek 2 1 Department of Software Engineering, Charles University 2 Computer Science Department, Purdue University Abstract. The

More information

Shmuel Ur Shady Copty Software and Verification Technologies

Shmuel Ur Shady Copty Software and Verification Technologies Multi Threaded Testing with AOP is Easy And it Finds Bugs! Shmuel Ur (ur@il.ibm.com) Shady Copty (shady@il.ibm.com) Software and Verification Technologies IBM Labs in Haifa 2004 IBM Corporation Outline

More information

NUMA in High-Level Languages. Patrick Siegler Non-Uniform Memory Architectures Hasso-Plattner-Institut

NUMA in High-Level Languages. Patrick Siegler Non-Uniform Memory Architectures Hasso-Plattner-Institut NUMA in High-Level Languages Non-Uniform Memory Architectures Hasso-Plattner-Institut Agenda. Definition of High-Level Language 2. C# 3. Java 4. Summary High-Level Language Interpreter, no directly machine

More information

VyrdMC: Driving Runtime Refinement Checking with Model Checkers

VyrdMC: Driving Runtime Refinement Checking with Model Checkers Electronic Notes in Theoretical Computer Science 144 (2006) 41 56 www.elsevier.com/locate/entcs VyrdMC: Driving Runtime Refinement Checking with Model Checkers Tayfun Elmas 1 Serdar Tasiran 2 College of

More information

Mechanising a type-safe model of multithreaded Java with a verified compiler

Mechanising a type-safe model of multithreaded Java with a verified compiler Mechanising a type-safe model of multithreaded Java with a verified compiler Andreas Lochbihler Digital Asset (Switzerland) GmbH Andreas Lochbihler 2 = Isabelle λ β HOL α Andreas Lochbihler 3 Timeline

More information

Software Model Checking. Xiangyu Zhang

Software Model Checking. Xiangyu Zhang Software Model Checking Xiangyu Zhang Symbolic Software Model Checking CS510 S o f t w a r e E n g i n e e r i n g Symbolic analysis explicitly explores individual paths, encodes and resolves path conditions

More information

Deadlock Bug Detection Techniques

Deadlock Bug Detection Techniques CS492B Analysis of Concurrent Programs Deadlock Bug Detection Techniques Prof. Moonzoo Kim CS KAIST 1 Bug Detection Techniques for Concurrent Programs Verification Precision SPIN jcute Fusion Java PathFinder

More information

Programmazione Avanzata e Paradigmi Ingegneria e Scienze Informatiche - UNIBO a.a 2013/2014 Lecturer: Alessandro Ricci

Programmazione Avanzata e Paradigmi Ingegneria e Scienze Informatiche - UNIBO a.a 2013/2014 Lecturer: Alessandro Ricci v1.0 20130323 Programmazione Avanzata e Paradigmi Ingegneria e Scienze Informatiche - UNIBO a.a 2013/2014 Lecturer: Alessandro Ricci [module lab 2.1] CONCURRENT PROGRAMMING IN JAVA: INTRODUCTION 1 CONCURRENT

More information

Semaphores. A semaphore is an object that consists of a. methods (e.g., functions): signal and wait. semaphore. method signal. counter.

Semaphores. A semaphore is an object that consists of a. methods (e.g., functions): signal and wait. semaphore. method signal. counter. Semaphores 1 Semaphores A semaphore is an object that consists of a counter, a waiting list of processes, and two methods (e.g., functions): signal and wait. method signal method wait counter waiting list

More information

Charles University in Prague Faculty of Mathematics and Physics MASTER THESIS. Nodir Yuldashev

Charles University in Prague Faculty of Mathematics and Physics MASTER THESIS. Nodir Yuldashev Charles University in Prague Faculty of Mathematics and Physics MASTER THESIS Nodir Yuldashev Using Java PathFinder for Construction of Abstraction of Java Programs Department of Software Engineering Advisor:

More information

THREADS & CONCURRENCY

THREADS & CONCURRENCY 4/26/16 Announcements BRING YOUR CORNELL ID TO THE PRELIM. 2 You need it to get in THREADS & CONCURRENCY Prelim 2 is next Tonight BRING YOUR CORNELL ID! A7 is due Thursday. Our Heap.java: on Piazza (A7

More information

Predicate Abstraction of Java Programs with Collections. Pavel Parízek, Ondřej Lhoták

Predicate Abstraction of Java Programs with Collections. Pavel Parízek, Ondřej Lhoták Predicate Abstraction of Java Programs with Collections Pavel Parízek, Ondřej Lhoták Predicate abstraction void main() { int i = 0; int x = 1; while (i < 1) { x += i; i++; assert(x > 0); Predicates P_xle0:

More information

JIVE: Dynamic Analysis for Java

JIVE: Dynamic Analysis for Java JIVE: Dynamic Analysis for Java Overview, Architecture, and Implementation Demian Lessa Computer Science and Engineering State University of New York, Buffalo Dec. 01, 2010 Outline 1 Overview 2 Architecture

More information

Code Contracts. Pavel Parízek. CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

Code Contracts. Pavel Parízek.   CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Code Contracts http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Pavel Parízek Code Contracts 2 Assertions Typically used as internal checks in the program

More information

Chapter 4: Multithreaded

Chapter 4: Multithreaded Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating-System Examples 2009/10/19 2 4.1 Overview A thread is

More information

CMSC 132: Object-Oriented Programming II. Threads in Java

CMSC 132: Object-Oriented Programming II. Threads in Java CMSC 132: Object-Oriented Programming II Threads in Java 1 Problem Multiple tasks for computer Draw & display images on screen Check keyboard & mouse input Send & receive data on network Read & write files

More information

Verifying Android Applications using Java PathFinder

Verifying Android Applications using Java PathFinder Verifying Android Applications using Java PathFinder Heila van der Merwe, Brink van der Merwe and Willem Visser Dept. of Computer Science University of Stellenbosch Private Bag X1 Matieland South Africa,

More information

Multi-threaded programming in Java

Multi-threaded programming in Java Multi-threaded programming in Java Java allows program to specify multiple threads of execution Provides instructions to ensure mutual exclusion, and selective blocking/unblocking of threads What is a

More information

Synchronization COMPSCI 386

Synchronization COMPSCI 386 Synchronization COMPSCI 386 Obvious? // push an item onto the stack while (top == SIZE) ; stack[top++] = item; // pop an item off the stack while (top == 0) ; item = stack[top--]; PRODUCER CONSUMER Suppose

More information

THREADS & CONCURRENCY

THREADS & CONCURRENCY 27/04/2018 Sorry for the delay in getting slides for today 2 Another reason for the delay: Yesterday: 63 posts on the course Piazza yesterday. A7: If you received 100 for correctness (perhaps minus a late

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

Executive Summaries in Software Model Checking

Executive Summaries in Software Model Checking Executive Summaries in Software Model Checking LASSE BERGLUND Master in Computer Science Date: April 25, 2018 Supervisor: Cyrille Artho Examiner: Mads Dam Swedish title: Exekverbara sammanfattningar i

More information

Hardware Emulation and Virtual Machines

Hardware Emulation and Virtual Machines Hardware Emulation and Virtual Machines Overview Review of How Programs Run: Registers Execution Cycle Processor Emulation Types: Pure Translation Static Recompilation Dynamic Recompilation Direct Bytecode

More information

JavaPathFinder. Radek Mařík K333, FEE, CTU, Prague As a selection of slides from several JavaPathFinder tutorials 2013 November 26

JavaPathFinder. Radek Mařík K333, FEE, CTU, Prague As a selection of slides from several JavaPathFinder tutorials 2013 November 26 JavaPathFinder Radek Mařík K333, FEE, CTU, Prague As a selection of slides from several JavaPathFinder tutorials 2013 November 26 Outline What is JPF Usage examples Test case generation JPF architecture

More information

Symbolic and Concolic Execution of Programs

Symbolic and Concolic Execution of Programs Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015 Information Security, CS 526 1 Reading for this lecture Symbolic execution and program testing - James

More information

Complex, concurrent software. Precision (no false positives) Find real bugs in real executions

Complex, concurrent software. Precision (no false positives) Find real bugs in real executions Harry Xu May 2012 Complex, concurrent software Precision (no false positives) Find real bugs in real executions Need to modify JVM (e.g., object layout, GC, or ISA-level code) Need to demonstrate realism

More information

Overview of Java Threads (Part 2)

Overview of Java Threads (Part 2) Overview of Java Threads (Part 2) Douglas C. Schmidt d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee, USA Learning

More information

Kotlin/Native concurrency model. nikolay

Kotlin/Native concurrency model. nikolay Kotlin/Native concurrency model nikolay igotti@jetbrains What do we want from concurrency? Do many things concurrently Easily offload tasks Get notified once task a task is done Share state safely Mutate

More information

MASTER THESIS. Extending Java PathFinder with Behavior Protocols

MASTER THESIS. Extending Java PathFinder with Behavior Protocols Charles University in Prague Mathematical and Physical Faculty MASTER THESIS Aleš Plšek Extending Java PathFinder with Behavior Protocols Department of Software Engineering Advisor: RNDr. Jiří Adámek Study

More information

Advanced Object-Oriented Programming Introduction to OOP and Java

Advanced Object-Oriented Programming Introduction to OOP and Java Advanced Object-Oriented Programming Introduction to OOP and Java Dr. Kulwadee Somboonviwat International College, KMITL kskulwad@kmitl.ac.th Course Objectives Solidify object-oriented programming skills

More information

Java Internals. Frank Yellin Tim Lindholm JavaSoft

Java Internals. Frank Yellin Tim Lindholm JavaSoft Java Internals Frank Yellin Tim Lindholm JavaSoft About This Talk The JavaSoft implementation of the Java Virtual Machine (JDK 1.0.2) Some companies have tweaked our implementation Alternative implementations

More information

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler Hiroshi Inoue, Hiroshige Hayashizaki, Peng Wu and Toshio Nakatani IBM Research Tokyo IBM Research T.J. Watson Research Center April

More information

Model Checking Programs

Model Checking Programs Automated Software Engineering, 10, 203 232, 2003 c 2003 Kluwer Academic Publishers. Manufactured in The Netherlands. Model Checking Programs WILLEM VISSER RIACS/NASA Ames Research Center, Moffet Field,

More information

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7) Software Development & Education Center Java Platform, Standard Edition 7 (JSE 7) Detailed Curriculum Getting Started What Is the Java Technology? Primary Goals of the Java Technology The Java Virtual

More information

Exhaustive testing of safety critical Java

Exhaustive testing of safety critical Java Downloaded from orbit.dtu.dk on: Nov 04, 2018 Exhaustive testing of safety critical Java Kalibera, Tomas; Parizek, Pavel; Malohlava, Michal; Schoeberl, Martin Published in: Proceedings of the 8th International

More information

F. Tip and M. Weintraub CONCURRENCY

F. Tip and M. Weintraub CONCURRENCY F. Tip and M. Weintraub CONCURRENCY SHARED-MEMORY CONCURRENCY threads execute concurrently threads communicate values via shared memory synchronization using locks 2 PITFALLS data races atomicity violations

More information

Chronicler: Lightweight Recording to Reproduce Field Failures

Chronicler: Lightweight Recording to Reproduce Field Failures Chronicler: Lightweight Recording to Reproduce Field Failures Jonathan Bell, Nikhil Sarda and Gail Kaiser Columbia University, New York, NY USA What happens when software crashes? Stack Traces Aren

More information

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001 Research Collection Other Conference Item Formal background and algorithms Author(s): Biere, Armin Publication Date: 2001 Permanent Link: https://doi.org/10.3929/ethz-a-004239730 Rights / License: In Copyright

More information

CS420: Operating Systems

CS420: Operating Systems Threads James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Threads A thread is a basic unit of processing

More information

Managed runtimes & garbage collection. CSE 6341 Some slides by Kathryn McKinley

Managed runtimes & garbage collection. CSE 6341 Some slides by Kathryn McKinley Managed runtimes & garbage collection CSE 6341 Some slides by Kathryn McKinley 1 Managed runtimes Advantages? Disadvantages? 2 Managed runtimes Advantages? Reliability Security Portability Performance?

More information

CS 351 Design of Large Programs Threads and Concurrency

CS 351 Design of Large Programs Threads and Concurrency CS 351 Design of Large Programs Threads and Concurrency Brooke Chenoweth University of New Mexico Spring 2018 Concurrency in Java Java has basic concurrency support built into the language. Also has high-level

More information

Java Concurrency in practice

Java Concurrency in practice Java Concurrency in practice Chapter: 12 Bjørn Christian Sebak (bse069@student.uib.no) Karianne Berg (karianne@ii.uib.no) INF329 Spring 2007 Testing Concurrent Programs Conc. programs have a degree of

More information

High-Level Language VMs

High-Level Language VMs High-Level Language VMs Outline Motivation What is the need for HLL VMs? How are these different from System or Process VMs? Approach to HLL VMs Evolutionary history Pascal P-code Object oriented HLL VMs

More information

Just-In-Time Compilation

Just-In-Time Compilation Just-In-Time Compilation Thiemo Bucciarelli Institute for Software Engineering and Programming Languages 18. Januar 2016 T. Bucciarelli 18. Januar 2016 1/25 Agenda Definitions Just-In-Time Compilation

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Multithreading Multiprocessors Description Multiple processing units (multiprocessor) From single microprocessor to large compute clusters Can perform multiple

More information

Profilers and Debuggers. Introductory Material. One-Slide Summary

Profilers and Debuggers. Introductory Material. One-Slide Summary Profilers and Debuggers #1 Introductory Material First, who doesn t know assembly language? You ll get to answer all the assembly questions. Yes, really. Lecture Style: Sit on the table and pose questions.

More information

Process Description and Control

Process Description and Control Process Description and Control 1 Process:the concept Process = a program in execution Example processes: OS kernel OS shell Program executing after compilation www-browser Process management by OS : Allocate

More information

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013 Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013 Software Engineering Culture Three Guiding Visions Data-driven design Test-driven development

More information

Optimized Execution of Deterministic Blocks in Java PathFinder

Optimized Execution of Deterministic Blocks in Java PathFinder Optimized Execution of Deterministic Blocks in Java PathFinder Marcelo d Amorim, Ahmed Sobeih, and Darko Marinov Department of Computer Science University of Illinois at Urbana-Champaign 201 N. Goodwin

More information

THREADS AND CONCURRENCY

THREADS AND CONCURRENCY THREADS AND CONCURRENCY Lecture 22 CS2110 Spring 2013 Graphs summary 2 Dijkstra: given a vertex v, finds shortest path from v to x for each vertex x in the graph Key idea: maintain a 5-part invariant on

More information

Managed runtimes & garbage collection

Managed runtimes & garbage collection Managed runtimes Advantages? Managed runtimes & garbage collection CSE 631 Some slides by Kathryn McKinley Disadvantages? 1 2 Managed runtimes Portability (& performance) Advantages? Reliability Security

More information

An Empirical Study of Structural Constraint Solving Techniques

An Empirical Study of Structural Constraint Solving Techniques An Empirical Study of Structural Constraint Solving Techniques Junaid Haroon Siddiqui Sarfraz Khurshid University of Texas at Austin ICFEM, Rio de Janeiro 9 December 2009 Overview Structural constraint

More information

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points Name: CS520 Final Exam 11 May 2018, 120 minutes, 26 questions, 100 points The exam is closed book and notes. Please keep all electronic devices turned off and out of reach. Note that a question may require

More information