Static Analysis of Object References in RMI-based Java Software

Slides:



Advertisements
Similar presentations
Uncovering Performance Problems in Java Applications with Reference Propagation Profiling PRESTO: Program Analyses and Software Tools Research Group, Ohio.
Advertisements

ASSUMPTION HIERARCHY FOR A CHA CALL GRAPH CONSTRUCTION ALGORITHM JASON SAWIN & ATANAS ROUNTEV.
COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
Analysis of programs with pointers. Simple example What are the dependences in this program? Problem: just looking at variable names will not give you.
Program Representations. Representing programs Goals.
1 Practical Object-sensitive Points-to Analysis for Java Ana Milanova Atanas Rountev Barbara Ryder Rutgers University.
Remote Method Invocation
Company LOGO Remote Method Invocation Georgi Cholakov, Emil Doychev, University of Plovdiv “Paisii.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas.
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Precision Going back to constant prop, in what cases would we lose precision?
Static Control-Flow Analysis for Reverse Engineering of UML Sequence Diagrams Atanas (Nasko) Rountev Ohio State University with Olga Volgin and Miriam.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University STATIC ANALYSES FOR JAVA IN THE PRESENCE OF DISTRIBUTED COMPONENTS AND.
PRESTO Research Group, Ohio State University Interprocedural Dataflow Analysis in the Presence of Large Libraries Atanas (Nasko) Rountev Scott Kagan Ohio.
Understanding Parallelism-Inhibiting Dependences in Sequential Java Programs Atanas (Nasko) Rountev Kevin Van Valkenburgh Dacong Yan P. Sadayappan Ohio.
Information Management NTU Interprocess Communication and Middleware.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
CBSE'051 Component-Level Dataflow Analysis Atanas (Nasko) Rountev Ohio State University.
Li Tak Sing COMPS311F. RMI callbacks In previous example, only the client can initiate a communication with the server. The server can only response to.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Efficient Checkpointing of Java Software using Context-Sensitive Capture.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
5/7/03ICSE Fragment Class Analysis for Testing of Polymorphism in Java Software Atanas (Nasko) Rountev Ohio State University Ana Milanova Barbara.
Sept 12ICSM'041 Precise Identification of Side-Effect-Free Methods in Java Atanas (Nasko) Rountev Ohio State University.
Remote Method Invocation A Client Server Approach.
Object Naming Analysis for Reverse- Engineered Sequence Diagrams Atanas (Nasko) Rountev Beth Harkness Connell Ohio State University.
1PLDI 2000 Off-line Variable Substitution for Scaling Points-to Analysis Atanas (Nasko) Rountev PROLANGS Group Rutgers University Satish Chandra Bell Labs.
09/03/2003Parrallel Computing Conference JToe : a Java API for Object Exchange Serge Chaumette, Pascal Grange, Benoit Métrot, Pierre Vignéras LaBRI,
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Code Optimization More Optimization Techniques. More Optimization Techniques  Loop optimization  Code motion  Strength reduction for induction variables.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Java Distributed Computing
Compositional Pointer and Escape Analysis for Java programs
Code Optimization Overview and Examples
Paul Ammann & Jeff Offutt
Principles of Software Development
Distributed Computing
Atanas (Nasko) Rountev Ohio State University
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Java Distributed Computing
Remote Method Invocation
Compositional Pointer and Escape Analysis for Java Programs
Chapter 3: Using Methods, Classes, and Objects
Atanas (Nasko) Rountev Barbara G. Ryder Rutgers University
Building a Whole-Program Type Analysis in Eclipse
Points-to Analysis for Java Using Annotated Constraints
Remote Method Invocation
Programming Models for Distributed Application
Program Slicing Baishakhi Ray University of Virginia
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
The command invocation protocol
Demand-Driven Context-Sensitive Alias Analysis for Java
자바 언어를 위한 정적 분석 (Static Analyses for Java) ‘99 한국정보과학회 가을학술발표회 튜토리얼
Chapter 4: Threads.
Interactive Exploration of Reverse-Engineered UML Sequence Diagrams
Java Remote Method Invocation
Lecture 7: RPC (exercises/questions)
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Static Analysis of Object References in RMI-based Java Software Mariana Sharp Atanas (Nasko) Rountev Ohio State University

Reference Analysis for Java Which objects may variable x refer to? Builds a points-to graph x = new A(); y = new B(); x.f = y; x o1 o2 y f Nasko Rountev - ICSM'05

Uses of Reference Information Clients: SE tools and compilers Object read-write information Side-effect analysis, dependence analysis Call graph construction For interprocedural static analyses De-virtualization and inlining Escape analysis Object lifetime for dependence analysis; synchronization removal; stack allocation Nasko Rountev - ICSM'05

RMI-Based Distributed Java Applications Java Remote Method Invocation (RMI) Object references that cross JVM boundaries Invocations of remote methods Parameter passing for entire object graphs Open questions Correct semantic definition of reference analysis for RMI-based Java applications Practical analysis algorithms Nasko Rountev - ICSM'05

Static analyses for program understanding Contributions Theoretical definition of reference analysis for distributed RMI-based Java applications Foundation for many other analyses Analysis algorithm Generalizes an algorithm for non-distributed Java programs Static analyses for program understanding Inter-component dependencies Reducing the cost of serialization at RMI calls Analysis implementation and evaluation Nasko Rountev - ICSM'05

Code for a set of components C1, C2, …, Cn RMI Basics Code for a set of components C1, C2, …, Cn Each Ci executes on a different JVM Remote class: implements java.rmi.Remote Remote object: instance of a remote class Remote reference: pointer to a remote object Remote call: x.m( ), x is a remote reference interface Listener extends java.rmi.Remote { void update(Event b); } class MyListener implements Listener extends … { void update(Event b) { … } } Nasko Rountev - ICSM'05

interface Channel extends java.rmi.Remote { void add(Listener c); Component “Channel” interface Channel extends java.rmi.Remote { void add(Listener c); void notify(Event d); } class MyChannel implements Channel extends … { private Listener[ ] LST = new Listener[100]; void add(Listener c) { LST[n++] = c; } void notify(Event d) { … } static void main() { Channel e = new MyChannel(); Naming.bind(“foo”,e); … } Nasko Rountev - ICSM'05

Channel f = (Channel) Naming.lookup(“foo”); Adding a Listener Component C1 RMI Registry Component C2 “foo” f MyChannel LST g array MyListener c Channel f = (Channel) Naming.lookup(“foo”); Listener g = new MyListener(); f.add(g); LST[n++] = c; Nasko Rountev - ICSM'05

class Event implements Serializable { … private Date dt = new Date(); Component “Channel” class Event implements Serializable { … private Date dt = new Date(); } interface Listener extends java.rmi.Remote { void update(Event b); } class MyChannel implements Channel extends … { void notify(Event d) { for (…) LST[i].update(d); … } Nasko Rountev - ICSM'05

Announcing an Event Component C1 Component C2 MyChannel MyListener LST array Eventcopy Datecopy b dt Event d Date dt notify(new Event()); LST[i].update(d); Nasko Rountev - ICSM'05

Names for locals and formals: v 1, v 2, v 3, … Theoretical Model Names for locals and formals: v 1, v 2, v 3, … Label with the component id Names for site s “new X()” – s 1, s 2, s 3, … Names for de-serialized objects: s k,i Exists in the JVM of Ci, but the original object was created inside the JVM of Ck Local points-to edges in component Ci ( v i , s x )L or ( s1 y , fld, s2 x )L x = i or x = k,i ; y = i or y = k,i deserialized object: k could be I – in this case the object went around and came back – but it is not the original object a local points-to edge could be for an s^i that is a remote object. But this is still a regular local non-remote reference. Nasko Rountev - ICSM'05

Theoretical Model (cont) Remote points-to edges in component Ci ( v i , s x )R or ( s1 y , fld, s2 x )R the target object is a remote object Effects of v1 = v2 in Ci For ( v2 i , s y )L/R create ( v1 i , s y )L/R Effects of v1 = v2.fld in Ci For ( v2 i , s2 y )L and ( s2 y , fld, s1 x )L/R create ( v1 i , s1 x )L/R Nasko Rountev - ICSM'05

Theoretical Model (cont) Effects of v.m(w) in Ci for ( v i , s x )R Remote call to method m in Cx Create ( m.this x , s x )L For ( w i , s2 y )L/R if s2 y is a remote object Create ( p x , s2 y )R for formal p For ( w i , s2 y )L if s2 y is a non-remote serializable object Take the graph of serializable objects starting at s2 y and create a copy of the graph in Cx Create ( p x , s2 z )L for formal p Nasko Rountev - ICSM'05

Pointer Assignment Graph [LhotakHendrenCC03] Analysis Algorithm Pointer Assignment Graph [LhotakHendrenCC03] Nodes are variables and object fields Edges represent the flow of values Each node has a local points-to set PtL and a remote points-to set PtR v1 = v2 in Ci : edge node(v2 i )node(v1 i ) Represents the subset relationships PtL(v2 i )  PtL(v1 i ) and PtR(v2 i )  PtR(v1 i ) whenever some object is added to a set for v2, it must also be added to the corresponding set for v1 Nasko Rountev - ICSM'05

Analyses for Program Understanding Inter-component dependencies between a remote call from Ci to Ck some statement in Ck due to a memory location in Ck a remote call from Cj to Ck Specialized serialization at remote calls Acyclic object graph; unique types Nasko Rountev - ICSM'05

Analysis includes ~7000 library methods Experimental Study 11 RMI applications Between 12 and 125 methods Analysis includes ~7000 library methods Implementation: Soot 2.1 (McGill U.) Generalized the points-to analysis in Soot Analysis running time 2.8 GHz PC with 1 GB memory Time: ~ 5-6 minutes per application Special handling of libraries – no replication Open issue: pre-computed summary info Nasko Rountev - ICSM'05

Remote Call Sites Passing of remote references and serialization are common High precision of the call graph at remote calls All remote call sites with serialization: used acyclic and uniquely-typed object graphs Nasko Rountev - ICSM'05

Conclusions and Future Work Theoretical foundations for reference analysis Practical algorithm Needs more work on handling of the libraries Initial precision results are promising Open questions Theoretical definitions of other analyses for RMI software (e.g., for slicing) More experimental results Additional RMI applications Precision for other analyses (e.g., analysis of inter-component dependencies) Nasko Rountev - ICSM'05

Questions? Nasko Rountev - ICSM'05