Ensuring determinism during programmatic replay in a virtual machine

US9542210B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9542210-B2
Application numberUS-201414293923-A
CountryUS
Kind codeB2
Filing dateJun 2, 2014
Priority dateJun 29, 2010
Publication dateJan 10, 2017
Grant dateJan 10, 2017

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Aspects of an application program's execution which might be subject to non-determinism are performed in a deterministic manner while the application program's execution is being recorded in a virtual machine environment so that the application program's behavior, when played back in that virtual machine environment, will duplicate the behavior that the application program exhibited when originally executed and recorded. Techniques disclosed herein take advantage of the recognition that only minimal data needs to be recorded in relation to the execution of deterministic operations, which actually can be repeated “verbatim” during replay, and that more highly detailed data should be recorded only in relation to non-deterministic operations, so that those non-deterministic operations can be deterministically simulated (rather than attempting to re-execute those operations under circumstances where the outcome of the re-execution might differ) based on the detailed data during replay.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer-implemented method implemented with a replay core equipped with a processor and one or more memory devices having executable instructions stored thereon, which when executed by the processor, perform the method steps, comprising: during a record phase of a replay core recording instructions of an application that is executed by a virtual machine, the replay core intercepting an event that indicates that a particular class is being loaded by code that is executed by a virtual machine, wherein execution of objects instantiated from the particular class is potentially non-deterministic; in response to intercepting the event, modifying the particular class by injecting bytecodes into the particular class thereby producing a modified particular class, the injected bytecodes for causing values produced by objects instantiated from the particular class in a replay phase of the application executed by the virtual machine to be the same as the values produced by objects instantiated from the particular class during the record phase, wherein modifying the particular class comprises walking a class hierarchy to determine whether the particular class inherits from one or more other classes thereby causing other classes in the class hierarchy to be loaded; storing the modified particular class in memory prior to the replay phase; listening, by the replay core during the record phase, for invocations of original methods associated with the one or more other classes that load as a result of walking the class hierarchy; replacing the invocations of the original methods with invocations of proxy methods that cause data to be stored in a replay stream in memory that (a) identify class loaders that load the other classes, and (b) identify the other classes, wherein the replay stream identifies an order in which the other classes were loaded during the record phase; invoking, by the proxy methods during the record phase, each of the original methods and passing to the original methods the data that identifies the other class for the respective original method; during the replay phase, the replay core intercepting an event that indicates that the particular class is being loaded by code that is executed by the virtual machine; in response to intercepting the event during the replay phase, accessing the modified particular class from the memory instead of modifying the particular class by injecting bytecodes into the particular class as was done during the record phase, therefore the one or more other classes from which the particular class inherits are not caused to be loaded as a result of walking the class hierarchy to determine whether the particular class inherits from one or more other classes; in response to intercepting the event during the replay phase, accessing the replay stream that identifies the order in which the other classes were loaded during the record phase and, in accordance with the order in which the other classes were loaded during the record phase, for each of the other classes: i) invoking a proxy method instead of the original method for the other class; ii) passing the data to the proxy method that (a) identifies the class loader that loads the other class, and (b) identifies the other class; iii) invoking, by the proxy method, the original method and passing to the original method the data that identifies the other class; and causing the bytecode from the modified particular class to be executed by the virtual machine at the replay phase instead of the particular class to ensure deterministic replay. 2. The method of claim 1 , wherein the original methods associated with the one or more other classes that load as a result of walking the class hierarchy comprise a “getResourceAsStream” method. 3. The method of claim 1 , wherein the original methods associated with the one or more other classes that load as a result of examining the bytecodes comprise a method for reading a resource. 4. A non-transitory computer-readable storage medium storing instructions which, when executed by a processor, cause the processor to: intercept, by a replay core during a record time, an event that indicates that a particular class is being loaded by code that is executed by a virtual machine that executes an application for which the replay core records instructions during the record time; modify the particular class in response to the replay core intercepting the event, comprising instructions that cause the processor to inject bytecodes into the particular class thereby producing a modified particular class, wherein execution of the injected bytecodes by the processor causes values produced by objects instantiated from the particular class in a replay time of the application executed by the virtual machine to be the same as the values produced by objects instantiated from the particular class during the record time, wherein modifying the particular class the instructions causes the processor to walk a class hierarchy to determine whether the particular class inherits from one or more other classes thereby causing other classes in the class hierarchy to be loaded; store the modified particular class in memory before the replay time; listen, by the replay core, for invocations of original methods associated with the one or more other classes that load as a result of walking the class hierarchy during the record time; replace the invocations of the original methods with invocations of proxy methods that cause data to be stored in a replay stream in memory that (a) identify class loaders that load the other classes, and (b) identify the other classes, wherein the replay stream identifies an order in which the other classes were loaded during the record time; invoke, by the proxy methods during the record time, each of the original methods and passing to the original methods the data that identifies the other class for the respective original method; intercept, by the replay core during the replay time, an event that indicates that the particular class is being loaded by code that is executed by the virtual machine; in response to intercepting the event during the replay time, access the modified particular class from the memory instead of modifying the particular class by injecting bytecodes into the particular class as was done during the record time, therefore the one or more other classes from which the particular class inherits are not caused to be loaded as a result of walking the class hierarchy to determine whether the particular class inherits from one or more other classes; in response to intercepting the event during the replay time, access the replay stream that identifies the order in which the other classes were loaded during the record time and, in accordance with the order in which the other classes were loaded during the record time, for each of the other classes: i) invoke a proxy method instead of the original method for the other class; ii) pass the data to the proxy method that (a) identifies the class loader that loads the other class, and (b) identifies the other class; iii) invoke, by the proxy method, the original method and passing to the original method the data that identifies the other class; and cause the bytecode from the modified particular class to be executed by the virtual machine at the replay time instead of the particular class to ensure deterministic replay. 5. A computer-implemented method implemented with a replay core equipped with a processor and one or more memory devices having executable instructions stored thereon, which when executed by the processor, perform the method steps, comprising: recording, by a replay core, instructions of a program that is executed by a virtual machine during a record time; modifying, by the replay core,

Assignees

Inventors

Classifications

  • Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57) · CPC title

  • Instruction operation extension or modification · CPC title

  • Program code verification, e.g. Java bytecode verification, proof-carrying code (high-level semantic checks G06F8/43; prevention of errors by analysis, debugging or testing of software G06F11/36) · CPC title

  • Event management; Broadcasting; Multicasting; Notifications · CPC title

  • Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9542210B2 cover?
Aspects of an application program's execution which might be subject to non-determinism are performed in a deterministic manner while the application program's execution is being recorded in a virtual machine environment so that the application program's behavior, when played back in that virtual machine environment, will duplicate the behavior that the application program exhibited when origin…
Who is the assignee on this patent?
Ca Inc
What technology area does this patent fall under?
Primary CPC classification G06F9/44589. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jan 10 2017 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).