Tasks stack overflow real-time detection method and apparatus

A stack overflow and real-time detection technology, applied in the direction of multi-programming device, resource allocation, etc., can solve problems such as system failure, data destruction, and difficulty in locating

Inactive Publication Date: 2008-10-22
ZTE CORP
View PDF0 Cites 21 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The stack size of each task is specified by the creator, which requires the programmer to have a clear understanding of the stack size of the task when creating the task. If the specified stack size is relatively small, and the task itself has been related Recursive operations or the definition of relatively large local variables will cause the actual stack size used by the task to exceed the stack size allocated by the programmer, which is what we usually call stack overflow
Since the address space used by the task that generated the stack overflow shares the address space with other tasks in the same process, the stack overflow of this task will destroy the data of other tasks, resulting in the crash of the entire process
[0003] In a common embedded system, the entire system

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
  • Tasks stack overflow real-time detection method and apparatus
  • Tasks stack overflow real-time detection method and apparatus
  • Tasks stack overflow real-time detection method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0027] The main idea of ​​the present invention is to allocate one or several isolated stack memory blocks adjacent to the stack top of the task stack on the basis of the size of the task stack specified by the user by modifying the stack allocation strategy in the system call of the operating system to create a task. area, and use the memory management unit (MMU, Memory Manage Unit) write protection function of the microprocessor to modify the MMU attribute of the isolated area to be non-writable. In this way, when the task stack overflows and the push operation is performed, the write operation will be performed on the isolation area of ​​the memory adjacent to the top of the stack. However, since the memory in the isolation area has been set as non-writable by the MMU unit of the microprocessor, the An exception of MMU write protection will be generated, triggering the execution of the exception handling function, and suspending the task. At this time, the standard stack pro...

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 invention discloses a method and a device for the real-time detection of task stack overflow, relating to the computer operating system field. The method comprises the following steps that: when task stack is allocated, memories in the part adjacent to the top of task stack are set to be an isolation region, and the attribute of the isolation region is set to be non-writable; in the process of pressing the task stack, if stack pressing operation carries out write operation to the isolation region, the task stack is judged to be overflowing. The invention also discloses a device for the real-time detection of task stack overflow. A technical proposal of the invention positions tasks generating stack overflow, and can position concrete positions causing stack overflow by analyzing the stack of the tasks.

Description

technical field [0001] The invention relates to the field of computer operating systems, in particular to a real-time detection method and device for task stack overflow. Background technique [0002] In computer operating systems, the detection and processing of task stack overflow is a very important technology. In existing operating system technologies, the task refers to a thread commonly referred to in operating system books, and a process may consist of one or more tasks, and these tasks share the address space of the process. The stack size of each task is specified by the creator, which requires the programmer to have a clear understanding of the stack size of the task when creating the task. If the specified stack size is relatively small, and the task itself has been related Recursive operations or the definition of relatively large local variables will cause the actual stack size used by the task to exceed the stack size allocated by the programmer, which is what...

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
IPC IPC(8): G06F9/50
Inventor 曾照恒
Owner ZTE CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products