System for memory error checking in an executable
First Claim
1. For an executing target process run on a computer with a computer memory address space allocated for the process which has already initialized a heap and stored in a memory location a preexisting heap allocation, a method for replacing original instructions of a heap management function for acting on a heap memory comprising:
- (a) loading into said address space of the target process replacement instructions for said heap management function;
(b) reading said preexisting heap allocation and saving it in a second memory location;
(c) redirecting to said replacement instructions a transfer of control originally directed to said original instructions, which transfer is accompanied by a specification of a portion of the heap;
(d) upon said transfer of control to said replacement instructions, reading said second memory location and determining whether the specified portion of the heap is part of the preexisting allocation; and
(e) returning from said replacement instructions to the point in the target process to which said original instructions would have returned, such that said original instructions are bypassed.
6 Assignments
0 Petitions
Accused Products
Abstract
The invention modifies an executing instance (target process) of an arbitrary computer program by replacing the heap manager in the target process. All functions in the process that manipulate dynamic memory are patched with replacement functions that implement improved heap management. The invention is applicable to any computer program that makes use of dynamic (heap) memory. In a second aspect of the invention, the improved heap implementation performs heap error checking in addition to managing heap storage. Alternative embodiments use the invention to improve performance (speed) using fast allocation algorithms, improve space efficiency of the program, or implement tracing of heap activity for debugging purposes.
62 Citations
3 Claims
-
1. For an executing target process run on a computer with a computer memory address space allocated for the process which has already initialized a heap and stored in a memory location a preexisting heap allocation, a method for replacing original instructions of a heap management function for acting on a heap memory comprising:
-
(a) loading into said address space of the target process replacement instructions for said heap management function; (b) reading said preexisting heap allocation and saving it in a second memory location; (c) redirecting to said replacement instructions a transfer of control originally directed to said original instructions, which transfer is accompanied by a specification of a portion of the heap; (d) upon said transfer of control to said replacement instructions, reading said second memory location and determining whether the specified portion of the heap is part of the preexisting allocation; and (e) returning from said replacement instructions to the point in the target process to which said original instructions would have returned, such that said original instructions are bypassed.
-
-
2. For an executing target process run on a computer with a computer memory address space allocated for the process which has already initialized a heap and stored in a memory location a preexisting heap allocation, a computer readable medium containing a set of computer executable instructions for replacing original instructions of a heap management function for acting on a heap memory, which executable instructions cause a computer to perform the following steps:
-
(a) loading into said address space of the target process replacement instructions for said heap management function; (b) reading said preexisting heap allocation and saving it in a second memory location; (c) directing to said replacement instructions a transfer of control originally directed to said original instructions, which transfer is accompanied by a specification of a portion of the heap; (d) upon said transfer of control to said replacement instructions, reading said second memory location and determining whether the specified portion of the heap is part of the preexisting allocation; and (e) returning from said replacement instructions to the point in the target process to which said original instructions would have returned, such that said original instructions are bypassed.
-
-
3. A computer system for use with an executing target process run on a computer with a computer memory address space allocated for the process, which has already initialized a heap and stored in a memory location a preexisting heap allocation, with means for replacing original instructions of a heap management function for acting on a heap memory, comprising:
-
(a) means for loading into said address space of the target process replacement instructions for said heap management function; (b) means for reading said preexisting heap allocation and saving it in a second memory location; (c) means for directing to said replacement instructions a transfer of control directed to said original instructions, which transfer is accompanied by a specification of a portion of the heap; (d) means for, upon said transfer of control to said replacement instructions, reading said second memory location and determining whether the specified portion is part of the preexisting allocation; and (e) means for returning from said replacement instructions to the point in the target process to which said original instructions would have returned, such that said original instructions are bypassed.
-
Specification