Method for detecting program errors
First Claim
1. A method of automatically detecting operational errors in execution of commands of a computer program in a computer by monitoring memory allocations, such commands being of the type that allocate memory for a variable, each variable having a name location, a name, and a size, comprising the steps of:
- a. generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size;
b. defining a set of allocation test conditions;
c. during execution in the computer of a command allocating a variable, comparing in the computer the variable name location, variable name, and variable size of the variable to the set of allocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table;
d. if the variable fails any one of the set of allocation test conditions, then generating an error indication to the computer;
e. otherwise,(1) storing the variable name location, variable name, and variable size of the variable as an entry in the logical table; and
(2) allocating the variable in the computer.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of automatically detecting errors in computer program caused by erroneous memory allocations and deallocations, flawed logic structure, and/or hardware malfunctions. The inventive method uses a pre-defined first table structure to monitor all data storage allocations and deallocations of a computer program. Another aspect of the invention is the use of a second table to track existing memory allocations that are not properly deallocated at the end of a program. The invention also includes a method for detecting program errors that inadvertently overwrite memory locations whose values should remain constant during the execution of a program.
-
Citations
9 Claims
-
1. A method of automatically detecting operational errors in execution of commands of a computer program in a computer by monitoring memory allocations, such commands being of the type that allocate memory for a variable, each variable having a name location, a name, and a size, comprising the steps of:
-
a. generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. defining a set of allocation test conditions; c. during execution in the computer of a command allocating a variable, comparing in the computer the variable name location, variable name, and variable size of the variable to the set of allocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; d. if the variable fails any one of the set of allocation test conditions, then generating an error indication to the computer; e. otherwise, (1) storing the variable name location, variable name, and variable size of the variable as an entry in the logical table; and (2) allocating the variable in the computer.
-
-
2. A method of automatically detecting operational errors in execution of commands of a computer program in a computer by monitoring memory deallocations, such commands being of the type that deallocate memory for a variable, each variable having a name location, a name, and a size, comprising the steps of:
-
a. generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. storing entries in the logical table for allocated variables; c. defining a set of deallocation test conditions; d. during execution in the computer of a command deallocating a variable, comparing in the computer the variable name location and variable name of the variable to the set of deallocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; e. if the variable fails any one of the set of deallocation test conditions, then generating an error indication to the computer; f. otherwise, (1) deleting the entry in the logical table having a variable name location matching the variable name location of the variable; and (2) deallocating the variable in the computer.
-
-
3. A method of automatically detecting operational errors in execution of commands of a computer program in a computer by monitoring memory allocations and deallocations, such commands being of the type that allocate or deallocate memory for a variable, each variable having a name location, a name, and a size, comprising the steps of:
-
a. generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. storing entries in the logical table for allocated variables; c. deleting corresponding entries in the logical table for deallocated variables; d. upon termination of a selected group of commands of the computer program, examining the logical table for any undeleted entries of allocated variables and storing the variable name location for such undeleted entries as hanging names for future recall; e. before a subsequent execution of the computer program, entering selected ones of the hanging names into the logical table; f. during subsequent execution of the computer program, upon execution of a command in the computer allocating a variable, comparing the variable name location of the variable to the hanging names in the logical table; g. if the variable name location of the variable matches any of the hanging names in the logical table, then generating an error indication to the computer.
-
-
4. A programmed digital computer for automatically detecting operational errors in execution of commands of a computer program in the computer by monitoring memory allocations, such commands being of the type that allocate memory for a variable, each variable having a name location, a name, and a size, comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for comparing in the computer, during execution of a command allocating a variable, the variable name location, variable name, and variable size of the variable to a set of allocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; c. means for generating an error indication to the computer if the variable fails any one of the set of allocation test conditions, and for otherwise storing the variable name location, variable name, and variable size of the variable as an entry in the logical table, and allocating the variable in the computer.
-
-
5. A programmed digital computer for automatically detecting operational errors in execution of commands of a computer program in the computer by monitoring memory deallocations, such commands being of the type that deallocate memory for a variable, each variable having a name location, a name, and a size, comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for storing entries in the logical table for allocated variables; c. means for comparing in the computer, during execution of a command deallocating a variable, the variable name location and variable name of the variable to a set of deallocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; d. means for generating an error indication to the computer if the variable fails any one of the set or deallocation test conditions, and for otherwise deleting the entry in the logical table having a variable name location matching the variable name location of the variable, and deallocating the variable.
-
-
6. A programmed digital computer for automatically detecting operational errors in execution of commands of a computer program in the computer by monitoring memory allocations and deallocations, such commands being of the type that allocate or deallocate memory for a variable, each variable having a name location, a name, and a size, comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for storing entries in the logical table for allocated variables; c. means for deleting corresponding entries in the logical table for deallocated variables; d. means for examining in the computer, upon termination of a selected group of commands of the computer program, the logical table for any undeleted entries of allocated variables and for storing the variable name location for such undeleted entries as hanging names for future recall; e. means for entering selected ones of the hanging names into the logical table before a subsequent execution of the program; f. means for comparing in the computer the variable name location of the variable to the hanging names in the logical table during subsequent execution of the program and upon execution of a command allocating a variable; g. means for generating an error indication to the computer if the variable name location of the variable matches any of the hanging names in the logical table.
-
-
7. An error control system, used in conjunction with a digital computer, of automatically detecting operational errors in execution of commands of a second computer program in the computer by monitoring memory allocations, such commands being of the type that allocate memory for a variable, each variable having a name location, a name, and a size, the system comprising a computer program storage medium having a computer program stored thereon for execution by said digital computer, the program comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for comparing in the computer, during execution of a command allocating a variable, the variable name location, variable name, and variable size of the variable to a set of allocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; c. means for generating an error indication to the computer if the variable fails any one of the set of allocation test conditions, and for otherwise storing the variable name location, variable name, and variable size of the variable as an entry in the logical table, and allocating the variable in the computer.
-
-
8. An error control system, used in conjunction with a digital computer, of automatically detecting operational errors in execution of commands of a second computer program in the computer by monitoring memory deallocations, such commands being of the type that deallocate memory for a variable, each variable having a name location, a name, and a size, the system comprising a computer program storage medium having a computer program stored thereon for execution by said digital computer, the program comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for storing entries in the logical table for allocated variables; c. means for comparing in the computer, during execution of a command deallocating a variable, the variable name location and variable name of the variable to a set of deallocation test conditions, including comparison of the variable name location of the variable to the variable name location value of the at least one entry of the logical table; d. means for generating an error indication to the computer if the variable fails any one of the set of deallocation test conditions, and for otherwise deleting the entry in the logical table having a variable name location matching the variable name location of the variable, and deallocating the variable in the computer.
-
-
9. An error control system, used in conjunction with a digital computer, of automatically detecting operational errors in execution of commands of a second computer program in the computer by monitoring memory allocation and deallocations, such commands being of the type that deallocate memory for a variable, each variable having a name location, a name, and a size, the system comprising a computer program storage medium having a computer program stored thereon for execution by said digital computer, the program comprising:
-
a. means for generating a logical table in the computer structured to store at least one entry comprising values for a variable name location, variable name, and variable size; b. means for storing entries in the logical table for allocated variables; c. means for deleting corresponding entries in the logical table for deallocated variables; d. means for examining in the computer, upon termination of a selected group of commands of the second computer program, the logical table for any undeleted entries of allocated variables and for storing the variable name location for such undeleted entries as hanging names for future recall; e. means for entering selected ones of the hanging names into the logical table before a subsequent execution of the second computer program; f. means for comparing in the computer the variable name location of the variable to the hanging names in the logical table during subsequent execution of the second computer program and upon execution of a command allocating a variable; g. means for generating an error indication to the computer if the variable name location of the variable matches any of the hanging names in the logical table.
-
Specification