Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for detecting abnormal memory access

A memory access and detection method technology, applied in the field of compilation, can solve problems that affect program execution performance, cannot detect memory access exceptions efficiently, cannot handle stack overflow and other problems

Active Publication Date: 2017-10-24
AGRICULTURAL BANK OF CHINA
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, when the program is running, it needs to search the first and last glyphs every time the memory is accessed, and judge whether it is out of bounds, which will seriously affect the execution performance of the program. In addition, the existing technology cannot handle the stack overflow scenario
[0005] It can be seen that the existing technology cannot accurately and efficiently detect the problem of abnormal memory access

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for detecting abnormal memory access
  • Method and device for detecting abnormal memory access
  • Method and device for detecting abnormal memory access

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0060] Explanation of related terms:

[0061] Dynamic detection: For the dynamic detection method of memory access exception, dynamic detection code or assertion needs to be inserted into the program, and the buffer overflow vulnerability can be found in time during the execution of the program;

[0062] A control flow graph (CFG) is an abstract data structure used in compilers. It is an abstract representation of a procedure or program, maintained internally by the compiler. Each node in the control flow graph represents a basic block, ie, a basic block without any jumps or jump targets; jump targets start with a block, and end with a block. Each directed edge in the control flow graph is used to represent the jump direction in the control flow, or the jump relationship between basic blocks. Function call graph (Func Call Graph, FCG): The nodes in the CFG above usually refer to the basic blocks where branches occur, and the nodes in the FCG are independent functions;

[00...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present application discloses a method and device for detecting memory access exceptions, which perform troubleshooting, lexical analysis, grammatical analysis, and semantic analysis on source codes to generate control flow graphs, data dependency graphs, first list files, and second list files; according to The control flow graph builds the global function call graph of the source code, and checks the matching of the source code for dynamic memory allocation according to the global function call graph, the second list file and the data dependency graph; builds a virtual execution platform, and uses the first list file, The control flow graph and data dependency graph extract the execution path, and realize the detection operation of the memory leak caused by the dynamic memory allocation and the memory access out of bounds when the program is running. By analyzing the first list file, the second list file, control flow graph, data dependency graph, and global function call graph, and constructing a virtual execution platform to extract the execution path, it is possible to fully mine the memory access exceptions in the source code and efficiently implement the Detecting operations for memory access exceptions.

Description

technical field [0001] The present application relates to the field of compiling technology, in particular to a method and device for detecting memory access exceptions. Background technique [0002] Memory access exceptions usually manifest as memory leaks caused by dynamic memory allocation, and memory access out-of-bounds when the program is running. Specifically, a memory leak means that the program uses functions such as malloc to dynamically apply for memory space from the operating system at runtime. Because the program temporarily exits or the programmer does not call the free function in the source code to release it, the process occupies memory resources for a long time. Out-of-bounds memory access refers to out-of-bounds access due to abnormal program calculations, irregular code writing, or illegal tampering of memory. These problems may lead to difficult-to-predict results during the running of the program. Therefore, how to detect and judge possible loopholes ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36G06F21/52
Inventor 朱浩王淑静刘国兴曹新平
Owner AGRICULTURAL BANK OF CHINA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products