Patent US3175556A successfully refreshed from Google Patents.
← Back to Patent Explorer
US5581697A Expired / Lapsed US ⏱️ 0.0 years remaining

Method and apparatus for run-time error checking using dynamic patching

Assignee: Sun Microsystems Inc
•
Filing: 1994-01-28
•
Granted: 1996-12-03
•
Expires: 2014-01-28
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract The invention provides a method and apparatus for dynamic patching for run-time error checking. With the present invention, a program to be error checked is read into memory where a debugging module resides. Such in-memory copy of the program is scanned for load objects. The load objects comprise libraries used by the program being error checked, as well as the main routines of such program. Next, a list of patch sites in the load objects is created and these patch sites corresponds to address locations in the load objects to be patched. Address space is then allocated for sections of the patch area where calls to real checking code resides. Finally, patches are written out to the in-memory copy of the program to be error checked. The original instruction in a patch site is replaced with branch to patch area instruction and the original instruction displaced is stored in the patch site's corresponding section of the patch area. The call to real checking code in this section of the patch area calls an error checking code. After the error checking is complete, the process transfers from the patch area to the next instruction in the segment of load object that was patched. In addition, the present invention is able to load new load objects. Such new load objects are scanned and the aforementioned patching process is repeated for patching the new load objects.

Inventors

  • 👤 Wayne C. Gramlich
  • 👤 Achut Reddy
  • 👤 Shyam Desirazu

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-29 11:56
CPC Classifications
G; G06; G06F; G06F11/00; G06F11/36; G06F11/362; G06F11/3644

Claims Analysis

Total Claims: 14
Claim 1
Independent Claim 233 words
A computer implemented method for providing dynamic patching of machine instructions for a target computer program process in order to provide run-time error checking of memory accesses made by said target computer program process, said method comprising the steps of: under control of a debugger program, reading a target computer program into a test and initiating an in-memory process representing said target computer program; scanning a designated portion of machine instructions of the in-memory process representing the target computer program and marking each machine instruction in the designated portion which contains a memory access command as a patch site; finding available memory-space in the test computer and designating a patch-area in such available memory-space corresponding to each patch site, wherein machine instructions are provided in the patch-area to call a memory-access status module for testing validity of the memory access command associated with each patch site; replacing the memory-access command in the machine instruction at each patch site with a transfer instruction to a corresponding patch-area associated with the memory-access command, wherein the replaced memory-access command will be executed after the memory-access status module has caused the memory access command to be tested for validity; and transferring operating control to the target computer program process which has been patched for memory-access checking, whereby each memory access will be checked for validity before the memory-access command is executed by the target computer program process.
Claim 2
Dependent Claim 233 words
A computer implemented method for providing dynamic patching of machine instructions for a target computer program process in order to provide run-time error checking of memory accesses made by said target computer program process, said method comprising the steps of: under control of a debugger program, reading a target computer program into a test and initiating an in-memory process representing said target computer program; scanning a designated portion of machine instructions of the in-memory process representing the target computer program and marking each machine instruction in the designated portion which contains a memory access command as a patch site; finding available memory-space in the test computer and designating a patch-area in such available memory-space corresponding to each patch site, wherein machine instructions are provided in the patch-area to call a memory-access status module for testing validity of the memory access command associated with each patch site; replacing the memory-access command in the machine instruction at each patch site with a transfer instruction to a corresponding patch-area associated with the memory-access command, wherein the replaced memory-access command will be executed after the memory-access status module has caused the memory access command to be tested for validity; and transferring operating control to the target computer program process which has been patched for memory-access checking, whereby each memory access will be checked for validity before the memory-access command is executed by the target computer program process.
Claim 3
Dependent Claim 15 words
The method of claim 1 further comprising the step of initializing patch tables and values.
Claim 4
Dependent Claim 31 words
The method of claim 1 further comprising the step of scanning said program for load objects, said load objects comprising libraries used by said program and main routines of said program.
Claim 5
Dependent Claim 60 words
The method of claim 3 further comprising the steps of: creating a list of patch sites corresponding to address locations to be patched in said load objects; allocating an address space for sections of patch area, said sections of patch area comprising calls to real checking code; and storing address locations for said sections of patch area in patch tables.
Claim 6
Dependent Claim 19 words
The method of claim 4 further comprising the step of creating a list of sizes of patch area sections.
Claim 7
Dependent Claim 34 words
The method of claim 5 wherein said step of allocating address space for said patch area further comprises the step of accepting said list of sizes of patch area sections for said load objects.
Claim 8
Dependent Claim 35 words
The method of claim 4 wherein said step of allocating address space for said sections of patch area further comprises the step of mapping said sections of patch area to empty address space in memory.
Claim 9
Dependent Claim 17 words
The method of claim 7 further comprising the step of identifying empty address locations in said memory.
Claim 10
Dependent Claim 37 words
The method of claim 4 wherein said step of storing address locations for said sections of patch area in said patch tables further comprises the step of updating said patch tables with new patch area section addresses.
Claim 11
Dependent Claim 86 words
The method of claim 4 further comprising the steps of: on completion of memory access checking and on command from the debugger program, unloading an original instruction from said sections of patch area, where said original instruction is a memory access command which was previously replaced with a transfer instruction and the memory access command moved to the patch area; replacing said transfer to patch area instruction in said patch site with said original instruction; deallocating unloaded patch area section space; and updating said patch tables.
Claim 12
Independent Claim 286 words
A system for providing dynamic patching of machine instructions for a target computer program process in order to provide run-time error checking of memory accesses made by said target computer program process, said system comprising: an input and output element for creating an in-memory copy of a target computer program; a debugging control mechanism coupled to said input and output element, for creating an in-memory process corresponding to the target computer program; a scanning element coupled to and controlled by said debugging control mechanism for scanning a designated portion of machine instructions of the in-memory process representing the target computer program and marking each machine instruction in the designated portion which contains a memory access command as a patch site; a memory management mechanism coupled to said debugging control mechanism for finding available memory-space in the test computer and designating a patch-area in such available memory-space corresponding to each patch site wherein machine instructions are provided in the patch-area to call a memory-access status module for testing validity of the memory access command associated with each patch site; a patching element coupled to said debugging control mechanism for replacing the memory-access command in the machine instruction at each patch site with a transfer instruction to a corresponding patch-area associated with the memory-access command, wherein the replaced memory-access command will be executed after the memory-access status module has caused the memory access command to be tested for validity; and an execution element under control of said debugging control mechanism for transferring operating control to the target computer program process which has been patched for memory-access checking, whereby each memory access will be checked for validity before the memory-access command is executed by the target computer program process.
Claim 13
Independent Claim 286 words
A system for providing dynamic patching of machine instructions for a target computer program process in order to provide run-time error checking of memory accesses made by said target computer program process, said system comprising: an input and output element for creating an in-memory copy of a target computer program; a debugging control mechanism coupled to said input and output element, for creating an in-memory process corresponding to the target computer program; a scanning element coupled to and controlled by said debugging control mechanism for scanning a designated portion of machine instructions of the in-memory process representing the target computer program and marking each machine instruction in the designated portion which contains a memory access command as a patch site; a memory management mechanism coupled to said debugging control mechanism for finding available memory-space in the test computer and designating a patch-area in such available memory-space corresponding to each patch site wherein machine instructions are provided in the patch-area to call a memory-access status module for testing validity of the memory access command associated with each patch site; a patching element coupled to said debugging control mechanism for replacing the memory-access command in the machine instruction at each patch site with a transfer instruction to a corresponding patch-area associated with the memory-access command, wherein the replaced memory-access command will be executed after the memory-access status module has caused the memory access command to be tested for validity; and an execution element under control of said debugging control mechanism for transferring operating control to the target computer program process which has been patched for memory-access checking, whereby each memory access will be checked for validity before the memory-access command is executed by the target computer program process.
Claim 14
Dependent Claim 70 words
The system of claim 11 wherein said memory management mechanism further comprises memory mechanisms for maintaining: patch tables and values; a patch area section of memory, said patch area section coupled to unique patch sites identified in the in-memory process representing the target computer program; and an error checking element, said error checking element coupled to each of said patch area sections for use in checking for memory access errors.

References Cited (Backward Citations)

US5029078A Cited
US5404499A Cited
US5243603A Cited
US5193180A Cited
US5335344A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1999-12-03 2000-06-03 2000-12-03 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2003-12-03 2004-06-03 2004-12-03 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2007-12-03 2008-06-03 2008-12-03 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag