Task stack overflow detection method and system

A technology of overflow detection and task stack, applied in the fields of instrumentation, digital data processing, platform integrity maintenance, etc., can solve the problems of not having too much FLASH and RAM, unable to insert additional code, not having, etc., to save limited resources Effect

Inactive Publication Date: 2020-06-05
BEIJING YUANXIN SCI & TECH
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Correspondingly, the IOT device processor is usually simple, the device resources are limited, and the hardware does not have memory management devices such as MPU or MMU or d

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
  • Task stack overflow detection method and system
  • Task stack overflow detection method and system
  • Task stack overflow detection method and system

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0024] The embodiments and embodiments of the present invention will be described in detail below with reference to the drawings.

[0025] The scope of application of the present invention will be apparent from the detailed description given below. However, it should be understood that while the detailed description and specific examples illustrate preferred embodiments of the present invention, they are given for illustrative purposes only.

[0026] The tasks of the operating system are created, ready, running, waiting, suspended, and terminated. When the system is running, tasks will switch between each state, such as figure 1 Shown. After the system starts to schedule operation, the CPU (Central Processing Unit) is either performing a certain task or performing interrupt processing. During interrupt processing, the CPU uses the specific stack space allocated in interrupt mode, which is generally large enough to prevent stack overflow. Moreover, for the nesting and real-time na...

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 task stack overflow detection method and system, and the method comprises the steps: responding to task creation, determining the position of a stack bottom according to thedistributed task stack information, and carrying out the assignment of the last n bytes of the stack bottom; in response to system scheduling, enabling the task to be switched among all states, irregularly checking whether the last n bytes at the stack bottom of the task stack space are equal to pre-assigned values or not, wherein the task states include the creating state, the ready state, the running state, the waiting state, the hanging state and the stopping state; and determining that task stack overflow exists in response to the fact that the last n bytes of the stack bottom of the taskstack space are not equal to a pre-assigned value. According to the method, a processor does not need to be supported by MMU/MPU hardware, extra codes are not added to the function, the size of a compiled mirror image is not increased, and the method is particularly suitable for an operating system of the Internet of Things equipment.

Description

technical field [0001] The present application relates to the field of electrical digital data processing, in particular to a task stack overflow detection method and system. Background technique [0002] The size of the operating system task stack is usually pre-set and determined when the task is created. During the running process, the stack overflows due to excessive stack space occupied by local variables or too deep nested function levels during function calls. When the stack overflows, the stack pointer exceeds the range of the pre-allocated stack space, causing other memory adjacent to the stack space to be overwritten or illegally accessed. Other memory may be the range of memory used by other tasks. After being overwritten, it will cause fatal abnormal phenomena in the system, such as task crash and crash. [0003] At present, two methods are usually used to detect task stack overflow. One is to take advantage of the hardware characteristics of the processor, use...

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): G06F21/52G06F21/55
CPCG06F21/52G06F21/554
Inventor 王艳伟邹仕洪朱睿李翔
Owner BEIJING YUANXIN SCI & TECH
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