US2011173505A1PendingUtilityA1

Method for detecting memory error

Assignee: BAE HYUN SEOPPriority: Apr 30, 2007Filed: Mar 22, 2011Published: Jul 14, 2011
Est. expiryApr 30, 2027(~0.7 yrs left)· nominal 20-yr term from priority
G11C 29/76G06F 11/0751G11C 29/44G11C 2029/0409G06F 12/00G06F 12/16
27
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

A method for easily detecting a memory error that may occur when a memory is accessed or an allocated memory is freed in the process of developing software is disclosed. The memory error detecting method includes: (a) generating an original block indication variable for indicating a starting memory block of a memory region allocated with respect to a variable included in a computer program; (b) detecting a memory error that may occur when the allocated memory region is accessed, by performing a certain operation (computing or arithmetic operation), before the allocated memory region is accessed, using a target block indication variable indicating memory block to be accessed in the allocated memory region and/or the original block indication variable; and (c) outputting information about a detected memory error.

Claims

exact text as granted — not AI-modified
1 . A method for detecting a memory error within source code of a computer program comprising:
 (a) generating an original block indication variable for indicating a starting memory block in a memory region allocated with respect to variables included in a computer program;   (b) detecting if a memory error will occur when the allocated memory region is freed, before the allocated memory region is freed, using at least one of a target block indication variable indicating a memory block to be accessed in the allocated memory region and the original block indication variable; and   (c) outputting information about a detected memory error.   
     
     
         2 . The method of  claim 1 , wherein the step (b) comprises:
 (b1) checking whether or not a value of the target block indication variable is identical to a null value; and   (b2) determining a memory error when the value of the target block indication variable is identical to the null value.   
     
     
         3 . The method of  claim 1 , wherein the step (b) comprises:
 (b1) checking whether or not a value of the original block indication variable has been initialized; and   (b2) determining a memory error if the original block indication variable has not been initialized.   
     
     
         4 . The method of  claim 1 , wherein the step (b) comprises:
 (b1) checking whether or not the target block indication variable indicates a memory block which is at the outside of a heap memory to which the allocated memory region belongs; and   (b2) determining a memory error when the target block indication variable indicates a memory block which is at the outside of the heap memory to which the allocated memory region belongs.   
     
     
         5 . The method of  claim 1 , wherein the step (b) comprises:
 (b1) checking whether or not a value of the original block indication variable is a null value; and   (b2) determining a memory error when the value of the original block indication variable is the null value.   
     
     
         6 . The method of  claim 1 , wherein the step (b) comprises:
 (b1) checking whether or not the target block indication variable indicates a starting memory block in the allocated memory region; and   (b2) determining a memory error if the target block indication variable does not indicate the starting memory block in the allocated memory region.   
     
     
         7 . The method of  claim 6 , further comprising:
 (d) allocating an identification code to each memory block of the allocated memory region before step (b), and it is checked whether or not the starting memory block in the allocated memory region is indicated by using the identification codes in step (b1).   
     
     
         8 . The method of  claim 7 , wherein the identification codes corresponding to the respective memory blocks included in a single allocated memory region are successively stored in an identification code map region of a computer memory to form a single identification code group, and in step (d), the identification codes are allocated such that identification codes of a single identification code group are the same and identification codes of adjacent identification code groups in the identification code map region are different, and step (b1) comprises:
 (b1-1) checking whether or not an identification code corresponding to a memory block indicated by the target block indication variable is identical to an identification code that immediately precedes in the identification code map region; and   (b1-2) determining that the target block indication variable does not indicate the starting memory block in the allocated memory region, if the identification codes are identical.   
     
     
         9 - 10 . (canceled) 
     
     
         11 . A method for detecting a memory error within source code of a computer program comprising:
 (a) generating an original block indication variable for indicating a starting memory block in an allocated memory region;   (b) adding an error check source code to the source code of the computer program that performs a computing operation, wherein the error check source code is added before portions of the source code of the computer program where freeing memory will occur, and wherein the computing operation checks for memory errors;   (c) detecting if a memory error will occur when the allocated memory region is freed before the allocated memory region is freed by executing the error check source code to perform the computing operation, wherein the computing operation uses at least one of a target block indication variable and the original block indication variable, wherein the target block indication variable indicates a memory block to be accessed in the allocated memory region; and   (d) outputting information about a detected memory error.   
     
     
         12 . The method of  claim 11 , wherein the computing operation comprises:
 checking whether or not a value of the target block indication variable is identical to a null value; and   determining a memory error when the value of the target block indication variable is identical to the null value.   
     
     
         13 . The method of  claim 1 , wherein the computing operation comprises:
 checking whether or not a value of the original block indication variable has been initialized; and   determining a memory error if the original block indication variable has not been initialized.   
     
     
         14 . The method of  claim 11 , wherein the computing operation comprises:
 checking whether or not the target block indication variable indicates a memory block which is at the outside of a heap memory to which the allocated memory region belongs; and   determining a memory error when the target block indication variable indicates a memory block which is at the outside of the heap memory to which the allocated memory region belongs.   
     
     
         15 . The method of  claim 11 , wherein the computing operation comprises:
 checking whether or not the value of the original block indication variable is the null value; and   determining a memory error when the value of the original block indication variable is the null value.   
     
     
         16 . The method of  claim 11 , wherein the computing operation comprises:
 checking whether or not the target block indication variable indicates the starting memory block in the allocated memory region; and   determining a memory error if the target block indication variable does not indicate the starting memory block in the allocated memory region.   
     
     
         17 . The method of  claim 16 , further comprising:
 (e) allocating an identification code to each memory block of the allocated memory region before step (b), and   checking whether or not the starting memory block in the allocated memory region is indicated by using the identification codes.   
     
     
         18 . The method of  claim 17 , wherein the identification codes corresponding to the respective memory blocks included in a single allocated memory region are successively stored in an identification code map region or a computer memory to form a single identification code group, and
 in step (e), the identification codes are allocated such that identification codes of a single identification code group are the same and identification codes of adjacent identification code groups in the identification code map region are different, and   the computing operation comprises:
 checking whether or not an identification code corresponding to a memory block indicated by the target block indication variable is identical to an identification code that immediately precedes in the identification code map region; and 
 determining that the target block indication variable does not indicate the starting memory block in the allocated memory region, if the identification codes are identical. 
   
     
     
         19 . The method of  claim 18 , wherein the identification codes of the identification code group are one of first to third bit values, and a fourth bit value is stored at a portion where the identification code groups are not formed in the identification code map region. 
     
     
         20 . A computer-readable recording medium that stores a program which, when executed by a computer, causes the computer to execute the method described as in  claim 11 . 
     
     
         21 . A method for detecting a memory error within source code of a computer program comprising:
 (a) generating an original block indication variable for indicating a starting memory block in an allocated memory region;   (b) detecting if a memory error will occur when the allocated memory region is freed before the allocated memory region is freed by executing error check source code to perform a computing operation, wherein the computing operation uses at least one of a target block indication variable and the original block indication variable, wherein the target block indication variable indicates a memory block to be accessed in the allocated memory region; and   (c) outputting information about a detected memory error.   
     
     
         22 . The method of  claim 21 , wherein the step (b) comprises:
 (b1) checking whether or not a value of the target block indication variable is identical to a null value; and   (b2) determining a memory error when the value of the target block indication variable is identical to the null value.

Join the waitlist — get patent alerts

Track US2011173505A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.