Method for detecting computer memory access errors
First Claim
1. A method for detecting memory access errors which occur while executing a computer program, wherein the computer program includes a pointer to a data object, said method comprising the steps of:
- providing a spatial attribute for said data object, said spatial attribute defining an address space within which valid accesses may be made to said data object;
associating said spatial attribute with said pointer;
providing a temporal attribute for said data object, said temporal attribute defining a period of time within which valid accesses may be made to said data object, wherein the step of providing said temporal attribute comprises the steps of;
providing a temporal validity number having a temporal validity number location; and
providing a temporal capability number;
associating said temporal capability number with said pointer;
providing a dereference to said pointer;
determining if said dereference falls outside said address space;
if said dereference falls outside said address space, flagging a spatial error;
determining from said temporal capability number and said temporal validity number whether a temporal error has occurred; and
if a temporal error has occurred, flagging said temporal error.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for detecting memory access errors which occur while executing a computer program. Spatial and temporal attributes are provided for a data object and these attributes are associated with each pointer to that data object. On a dereference to a pointer, a memory access check is performed which determines (a) whether the dereference falls outside the address range within which valid accesses may be made to the data object, and (b) whether the dereference falls outside the time period within which valid accesses may be made to the data object. If the dereference falls outside the valid address range, a spatial error is flagged. If the dereference falls outside the valid time period, a temporal error is flagged. In addition, a method is described for converting a preexisting source-language program file into a safe program and a method is described for optimizing memory-access checks.
138 Citations
20 Claims
-
1. A method for detecting memory access errors which occur while executing a computer program, wherein the computer program includes a pointer to a data object, said method comprising the steps of:
-
providing a spatial attribute for said data object, said spatial attribute defining an address space within which valid accesses may be made to said data object; associating said spatial attribute with said pointer; providing a temporal attribute for said data object, said temporal attribute defining a period of time within which valid accesses may be made to said data object, wherein the step of providing said temporal attribute comprises the steps of; providing a temporal validity number having a temporal validity number location; and providing a temporal capability number; associating said temporal capability number with said pointer; providing a dereference to said pointer; determining if said dereference falls outside said address space; if said dereference falls outside said address space, flagging a spatial error; determining from said temporal capability number and said temporal validity number whether a temporal error has occurred; and if a temporal error has occurred, flagging said temporal error. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A method of detecting a memory access error encountered when executing program code including a pointer pointing to a variable, the method comprising the steps of:
-
assigning temporal attributes defining temporal status for said pointer, wherein the step of assigning temporal attributes comprises the steps of; providing a temporal validity number associated with said variable; providing a temporal capability number; and associating said temporal capability number with said pointer; assigning spatial attributes defining an address space valid for said pointer; executing a memory access check on a memory access, wherein the step of executing a memory access check comprises the steps of; determining from said temporal capability number and said temporal validity number whether a temporal error has occurred; and determining whether said memory access is to an address within said valid address space; if a temporal status has occurred, flagging said temporal error; and if said memory access is to an address outside said valid address space, flagging a spatial error. - View Dependent Claims (11, 12)
-
-
13. A method for detecting memory access errors which occur while executing a computer program, wherein the computer program includes a pointer to a data object, the method comprising the steps of:
-
providing a counter having a count for tracking memory deallocations; providing a spatial attribute for said data object, said spatial attribute defining an address space within which valid accesses may be made to said data object; associating said spatial attribute with said pointer; associating said temporal attribute with said pointer; providing a temporal attribute for said data object, wherein the step of providing said temporal attribute comprises the steps of; providing a temporal validity number having a temporal validity number location; and providing a temporal capability number; associating said temporal capability number with said pointer; providing a first dereference and a second dereference to said pointer wherein said first dereference occurs prior to said second dereference; determining if said second dereference falls outside said address space; if said second dereference falls outside said address space, flagging a spatial error; determining if said count has changed since said fast dereference; and if said count has changed since said first dereference, verifying said temporal attributes, wherein the step of verifying said temporal attributes comprises the steps of; determining from said temporal capability number and said temporal validity number whether a temporal error has occurred; and if a temporal error has occurred, flagging said temporal error. - View Dependent Claims (14)
-
-
15. A system for detecting a memory access error in a computer program executing on a computer, the system comprising:
-
means for assigning object attributes to a pointer, wherein said object attributes comprise; a temporal capability number; and a spatial attribute defining an address space valid for said pointer; means for assigning a temporal validity number; means for adding memory access check instructions to said computer program, wherein said memory access check instructions comprise; instructions which determine from said temporal capability number and said temporal validity number whether a temporal error has occurred; and instructions which determine whether a memory access made within said computer program is to an address within said valid address space. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification