Method for monitoring task stack overflow

A task stack and stack overflow technology, applied in the field of memory management, can solve the problems of memory space destruction, destruction, and inability to realize monitoring functions, so as to reduce the impact and enhance competitiveness.

Active Publication Date: 2008-04-02
DATANG MOBILE COMM EQUIP CO LTD
View PDF0 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0011] It can be seen that with the above monitoring method, when the task stack overflow is detected, an error has already occurred, and it is very likely that the memory space of other tasks has been damaged.
Secondly, whether it is detecting task stack overflow during task switching or timing detection of task stack overflow, there is no gu

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 for monitoring task stack overflow
  • Method for monitoring task stack overflow

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] The basic idea of ​​the present invention is to determine a section of memory area at the end area of ​​the task stack and set it as a read-only attribute, as an isolation area between the task stack and other memory areas; and utilize the following characteristics of the operating system: when the operating system finds that there is When "attempting" to write to the memory area of ​​the read-only attribute, an address access exception interrupt is generated, and the overflow of the task stack is monitored and processed accordingly.

[0038] As shown in Figure 2, a kind of monitoring method of task stack overflow of the present invention comprises the following steps:

[0039] Step 201, determine a memory space located at the end of the task stack, and set it as a read-only attribute.

[0040] The operating system allocates the memory space required by the task stack for the task from the system memory. In the prior art, the system memory of the real-time operating sy...

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 of monitoring the overflow of a task stack, comprising the steps as follows: a memory space positioned in the area of the tail end of the task stack is conformed and is set to have a read only attribute; the abnormal interrupt of address access of an operating system is monitored; when the abnormal interrupt of address access of the operating system is monitored, whether the task of the abnormal interrupt of address access stack overflows is judged. The method can monitor the overflow of the task stack real-time and avoid causing damage to other tasks because of the overflow of the task stack.

Description

technical field [0001] The invention relates to memory management, in particular to a monitoring method for task stack overflow. Background technique [0002] Generally speaking, each task or thread has its own independent stack (stack) space, which is used to allocate the memory occupied by the local variables in the task or thread, save the function call information when the task or thread is running, and the information when the task or thread is switched. contextual information. [0003] In some real-time operating systems, such as VxWorks, OSE, etc., in order to improve system efficiency, virtual memory management is usually not performed, and all tasks (including the kernel) share the same physical address space, and there is no address protection mechanism between tasks. In this way, there is no need to switch between virtual address spaces when switching tasks, variables can be shared directly between tasks, no need to copy data between different address spaces thro...

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): G06F11/34G06F9/46
Inventor 陈剑
Owner DATANG MOBILE COMM EQUIP CO LTD
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