IP Library Granted Patent US 7,263,690
Granted Patent B1
US 7,263,690 · App. 10/713,651 · Granted Aug 28, 2007

Mechanism for safe byte code in a tracing framework

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,263,690
App. No.
10/713,651
Granted
Aug 28, 2007
Kind
B1
Abstract

A method for evaluating safety of a tracing program involves loading a byte code in a tracing framework, where the byte code includes instructions of the tracing program, validating the instructions when loading the byte code, performing one or more safety checks on the instructions while performing virtual machine emulation of the instructions, reporting an error condition and aborting virtual machine emulation of an unsafe instruction in the instructions when the safety check(s) detect(s) the unsafe instruction, and completing virtual machine emulation of a safe instruction in the instructions when the safety check(s) detect(s) the safe instruction, after aborting virtual machine emulation of the unsafe instruction.

Claims (78)

1. A method for evaluating safety of a tracing program, comprising:

loading a byte code in a tracing framework, wherein the byte code comprises a plurality of instructions of the tracing program;

validating the plurality of instructions when loading the byte code;

performing at least one safety check on the plurality of instructions while performing virtual machine emulation of the plurality of instructions;

reporting an error condition and aborting virtual machine emulation of an unsafe instruction in the plurality of instructions when the at least one safety check detects the unsafe instruction; and

completing virtual machine emulation of a safe instruction in the plurality of instructions when the at least one safety check detects the safe instruction, after aborting virtual machine emulation of the unsafe instruction.

2. The method of claim 1 , wherein the validating the plurality of instructions comprises:

verifying that opcode bits for the plurality of instructions identify valid operations.

3. The method of claim 1 , wherein the validating the plurality of instructions comprises:

evaluating whether an operand name referenced in the plurality of instructions does not refer to a valid operand provided by the virtual machine emulation.

4. The method of claim 1 , wherein the validating the plurality of instructions comprises:

computing a destination location within an instruction stream from one of the plurality of instructions; and

evaluating whether the destination location is invalid.

5. The method of claim 1 , wherein the validating the plurality of instructions comprises:

determining whether a subroutine name is valid, when one of the plurality of instructions invokes a named subroutine.

6. The method of claim 1 , wherein the validating the plurality of instructions comprises:

evaluating whether a total number of the plurality of instructions in the byte code exceeds a user-configurable limit.

7. The method of claim 1 , wherein the validating occurs during a single pass over the plurality of instructions.

8. The method of claim 1 , wherein the byte code comprises an instruction set of a virtual machine.

9. The method of claim 8 , wherein the instruction set comprises at least one selected from the group consisting of an arithmetic operation, a logical operation, a load operation, a store operation, and a control transfer operation.

10. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating whether the arithmetic operation results in a processor exception.

11. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating an effective address of the load operation before issuing underlying instructions;

determining an appropriate alignment for the effective address; and

determining whether the effective address is improperly aligned based on the appropriate alignment.

12. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating an effective address of the store operation before issuing underlying instructions;

determining an appropriate alignment for the effective address; and

determining whether the effective address is improperly aligned based on the appropriate alignment.

13. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating an effective address of an operation for validity prior to executing the operation, wherein the operation is one selected from the group consisting of the load operation and the store operation.

14. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating whether an effective address of an operation falls outside a list of pre-computed address ranges assigned to a memory-mapped device hardware state, wherein the operation is one selected from the group consisting of the load operation and the store operation.

15. The method of claim 9 , wherein the performing the at least one safety check comprises:

evaluating whether an effective address of the store operation falls outside a list of pre-computed address ranges assigned by the virtual machine to the tracing program.

16. A tracing framework, stored on a computer readable memory, comprising:

an instruction validator configured to:

load a byte code comprising a plurality of instructions of a tracing program, and

validate the plurality of instructions when loading the byte code; and

a safety check facility configured to:

perform at least one safety check on the plurality of instructions while performing virtual machine emulation of the plurality of instructions,

report an error condition and abort virtual machine emulation of an unsafe instruction in the plurality of instructions when the at least one safety check detects the unsafe instruction, and

complete virtual machine emulation of a safe instruction in the plurality of instructions when the at least one safety check detects the safe instruction, after aborting virtual machine emulation of the unsafe instruction.

17. The tracing framework of claim 16 , wherein the instruction validator is configured to validate the plurality of instructions by:

verifying that opcode bits for the plurality of instructions identify valid operations.

18. The tracing framework of claim 16 , wherein the instruction validator is configured to validate the plurality of instructions by:

evaluating whether an operand name referenced in the plurality of instructions does not refer to a valid operand provided by the virtual machine emulation.

19. The tracing framework of claim 16 , wherein the instruction validator is configured to validate the plurality of instructions by:

computing a destination location within an instruction stream from one of the plurality of instructions; and

evaluating whether the destination location is invalid.

20. The tracing framework of claim 16 , wherein the instruction validator is configured to validate the plurality of instructions by:

determining whether a subroutine name is valid, when one of the plurality of instructions invokes a named subroutine.

21. The tracing framework of claim 16 , wherein the instruction validator is configured to validate the plurality of instructions by:

evaluating whether a total number of the plurality of instructions in the byte code exceeds a user-configurable limit.

22. The tracing framework of claim 16 , wherein the instruction validator is configured to validate during a single pass over the plurality of instructions.

23. The tracing framework of claim 16 , wherein the byte code comprises an instruction set of a virtual machine.

24. The tracing framework of claim 16 , wherein the instruction set comprises at least one selected from the group consisting of an arithmetic operation, a logical operation, a load operation, a store operation, and a control transfer operation.

25. The tracing framework of claim 24 , wherein the safety check facility is configured to perform the at least one safety check by:

evaluating whether the arithmetic operation results in a processor exception.

26. The tracing framework of claim 24 , wherein the safety check facility is configured to perform the at least one safety check by:

evaluating an effective address of the load operation before issuing underlying instructions;

determining an appropriate alignment for the effective address; and

determining whether the effective address is improperly aligned based on the appropriate alignment.

27. The tracing framework of claim 24 , wherein the safety check facility is configured to perform the at least one safety check by:

evaluating an effective address of the store operation before issuing underlying instructions;

determining an appropriate alignment for the effective address; and

determining whether the effective address is improperly aligned based on the appropriate alignment.

28. A computer system for evaluating safety of a tracing program, comprising:

a processor;

a memory;

a storage device; and

software instructions stored in the memory for enabling the computer system to:

load a byte code in a tracing framework, wherein the byte code comprises a plurality of instructions of the tracing program;

validate the plurality of instructions when loading the byte code;

perform at least one safety check on the plurality of instructions while performing virtual machine emulation of the plurality of instructions; and

report an error condition and abort virtual machine emulation of an unsafe instruction in the plurality of instructions when the at least one safety check detects the unsafe instruction, and

complete virtual machine emulation of a safe instruction in the plurality of instructions when the at least one safety check detects the safe instruction, after aborting virtual machine emulation of the unsafe instruction.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037302/0843 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2003
From: SHAPIRO, MICHAEL W.
To: SUN MICROSYSTEMS INC.
Reel/Frame 014767/0975 →