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

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 does not have sufficient system resources to use hardware protection, nor does it have too much FLASH and RAM, so it cannot be used in each function. Insert extra code in both

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

Embodiment Construction

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

[0025] The scope of applicability of the present invention will become apparent from the detailed description given below. It should be understood, however, that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are given for purposes of illustration only.

[0026] The tasks of the operating system are created, ready, running, waiting, suspended, and terminated. When the system is running, the tasks will switch between each state, such as figure 1 shown. After the system starts scheduling and running, the CPU (Central Processing Unit) is either executing a certain task or executing interrupt processing. When 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 n...

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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products