WO2019001334A1 - 一种栈溢出处理的方法及装置 - Google Patents
一种栈溢出处理的方法及装置 Download PDFInfo
- Publication number
- WO2019001334A1 WO2019001334A1 PCT/CN2018/092153 CN2018092153W WO2019001334A1 WO 2019001334 A1 WO2019001334 A1 WO 2019001334A1 CN 2018092153 W CN2018092153 W CN 2018092153W WO 2019001334 A1 WO2019001334 A1 WO 2019001334A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- stack
- specified
- overflow
- memory management
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/073—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1668—Details of memory controller
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0751—Error or fault detection not based on redundancy
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0793—Remedial or corrective actions
Definitions
- the present application relates to the field of memory processing technologies, and in particular, to a method for stack overflow processing and a device for stack overflow processing.
- Stack overflow is an important cause of operating system instability during the operation of the operating system. Due to the occasional nature of stack overflow, it is often difficult to find the cause of the problem, leading to uncertainty in the product development cycle.
- stack overflow detection is usually performed as follows:
- the stack elements are initialized in turn by a specific magic number (such as 0x9527) according to the preset byte alignment; when the system is running, the daemons are sequentially traversed by the daemon process, and the detection is performed. Whether the value of the stack element is equal to the initialized magic number, and the ratio of the number of the contaminated elements to the stack size is obtained, that is, the stack usage amount, and whether the stack overflow occurs according to the stack usage amount.
- a specific magic number such as 0x9527
- embodiments of the present application have been made in order to provide a method for stack overflow processing and a corresponding apparatus for stack overflow processing that overcome the above problems or at least partially solve the above problems.
- the embodiment of the present application discloses a method for stack overflow processing, where the method includes:
- a memory access interrupt is triggered by the memory management device when a stack overflow is detected on the specified stack.
- the method further includes:
- stack information of the specified stack where the stack information includes a start address and a stack size of the specified stack
- the access management authority of the stack bottom address is set by using the memory management device.
- the specified stack includes a task stack
- the step of acquiring stack information of the specified stack includes:
- the stack information of the task stack is acquired.
- the specified stack includes an interrupt stack
- the step of acquiring stack information of the specified stack includes:
- the stack information of the interrupt stack is obtained from the compiled link script.
- the step of detecting, by the memory management device, whether a stack overflow occurs on the specified stack comprises:
- the method further includes:
- the memory management device comprises a memory protection unit MPU or a memory management unit MMU.
- the embodiment of the present application further discloses a device for stack overflow processing, and the device includes:
- a stack overflow detection module for detecting whether a stack overflow occurs on a specified stack by using a memory management device
- an interrupt processing module configured to trigger a memory access interrupt by the memory management device when detecting a stack overflow of the specified stack.
- the device further comprises:
- a stack information obtaining module configured to acquire stack information of the specified stack, where the stack information includes a start address and a stack size of the specified stack;
- a stack bottom address determining module configured to determine a stack bottom address of the specified stack based on a starting address of the specified stack and a stack size
- An access permission setting module is configured to set access rights of the stack bottom address by using the memory management device.
- the specified stack includes a task stack
- the stack information obtaining module is further configured to:
- the stack information of the task stack is acquired.
- the specified stack includes an interrupt stack
- the stack information obtaining module is further configured to:
- the stack information of the interrupt stack is obtained from the compiled link script.
- the stack overflow detection module is further configured to:
- the device further comprises:
- a context information obtaining module configured to acquire context information corresponding to the stack overflow
- a troubleshooting module is configured to perform a stack overflow problem based on the context information.
- the memory management device comprises a memory protection unit MPU or a memory management unit MMU.
- the embodiment of the present application also discloses an apparatus, including:
- One or more processors are One or more processors.
- One or more machine-readable media having stored thereon instructions that, when executed by the one or more processors, cause the apparatus to perform the methods described above.
- Embodiments of the present application also disclose one or more machine readable medium having stored thereon instructions that, when executed by one or more processors, cause the apparatus to perform the methods described above.
- the embodiment of the present application can detect whether the task stack or the interrupt stack overflows through the memory management device.
- the memory management device detects that the task stack or the interrupt stack overflows, the memory management device immediately triggers a memory access interrupt, and the memory management device detects the stack overflow by means of the hardware, thereby effectively improving the timeliness of the stack overflow detection and timely discovering Intermittent problems such as stack overflow, shorten the stack overflow problem troubleshooting time.
- Embodiment 1 is a flow chart showing the steps of Embodiment 1 of a method for stack overflow processing according to the present application;
- FIG. 2 is a flow chart of steps of a second embodiment of a method for stack overflow processing according to the present application
- FIG. 3 is a structural block diagram of an apparatus for stack overflow processing according to the present application.
- FIG. 4 is a structural block diagram of an embodiment of a smart terminal according to the present application.
- the embodiment of the present application may be applied to a computing device installed with an operating system, where the computing device may include a terminal or a server, and the computing device may include a memory management device.
- the memory management device can be used to manage the memory of the computing device, such as setting memory access rights, detecting whether the memory overflows, triggering a memory access abnormal interrupt, and performing memory exception processing.
- the memory management device may include a hardware device and/or a software program.
- the memory management device may include an MPU (Memory Protection Unit).
- MPU Memory Protection Unit
- a domain in the MPU is a set of attribute values and a corresponding piece of memory, including: start address, length, read and write permissions, and cache. .
- the memory management device may include an MMU (Memory Management Unit), which is a control circuit used to manage virtual memory and physical memory in the CPU of the central processing unit, and is also responsible for mapping virtual addresses to physical addresses, and Provides memory access authorization for hardware mechanisms, multi-user multi-process operating system.
- MMU Memory Management Unit
- the memory management may include management of a stack, wherein the stack is an advanced memory area abstracted from the operating system, and is mainly used for automatic access of local variables and interface call parameters.
- a stack can include a task stack and an interrupt stack.
- the task stack can be used to save context information when a task is switched.
- the interrupt stack can be used to save context information when an interrupt is generated.
- the embodiment of the present application can be applied to memory management in the Internet, and can also be applied to memory management in the Internet of Things (IoT).
- IoT Internet of Things
- FIG. 1 a flow chart of a first embodiment of a method for stack overflow processing of the present application is shown.
- the embodiment of the present application may specifically include the following steps:
- Step 101 The memory management device is used to detect whether a stack overflow occurs on the specified stack.
- the operating system used by the computing device may include an RTOS (Real Time Operating System).
- RTOS Real Time Operating System
- the specified stack in the embodiment of the present application may include a task stack or an interrupt stack in the RTOS system.
- Step 102 When it is detected that a stack overflow occurs on the specified stack, the memory management device triggers a memory access interrupt.
- the embodiment of the present application can detect whether the task stack or the interrupt stack overflows through the memory management device.
- the memory management device detects that the task stack or the interrupt stack overflows, the memory management device immediately triggers a memory access interrupt, and the memory management device detects the stack overflow by means of the hardware, thereby effectively improving the timeliness of the stack overflow detection and timely discovering Intermittent problems such as stack overflow, shorten the stack overflow problem troubleshooting time.
- FIG. 2 a flow chart of the second embodiment of the method for stack overflow processing of the present application is shown.
- the embodiment of the present application may specifically include the following steps:
- Step 201 Acquire stack information of a specified stack.
- the RTOS system may obtain stack information of a specified stack.
- the stack information may include, but is not limited to, a start address, a stack size, a stack name, a task name, and the like of the specified stack.
- the step 201 may further include the following sub-steps: acquiring the stack information of the task stack when the task stack is detected to perform task switching .
- the stack information of the task stack can be obtained when the task stack is detected to be switched.
- the pointer of the task scheduled by the system changes, it may be determined that the task stack is switched at this time.
- the task after the handover may be obtained according to the address pointed by the pointer of the switched task.
- step 201 may further include the following substep: obtaining stack information of the interrupt stack from the compiled link script.
- the IoT system shares an interrupt stack, and the stack information is declared in the system compilation link script, so the stack information of the interrupt stack can be obtained from the compiled link script program before the system is compiled.
- Step 202 Determine a stack bottom address of the specified stack based on a start address of the specified stack and a stack size.
- the start address and the stack size of the corresponding stack may be obtained from the stack information, and the stack bottom address of the stack is obtained according to the “start address of the stack+the stack size”.
- the stack bottom address can be the edge of the stack growth direction.
- Step 203 using a memory management device, setting access rights of the stack bottom address
- the memory management device may be used to set the access permission of the stack bottom address to protect the edge of the stack growth direction.
- the MPU protection may be set to the memory space corresponding to the bottom address of the stack, and the access authority of the bottom address of the stack may be set in the MPU.
- the access permission may include: prohibiting reading and/or prohibiting write and / or prohibit the execution of code and so on.
- the access rights can be set to disable all access operations.
- Step 204 When an access operation to the bottom of the stack is detected, determining that the specified stack has a stack overflow;
- the stack overflow can be determined.
- Step 205 A memory access interrupt is triggered by the memory management device.
- the interruption of the memory access exception can be triggered immediately.
- Step 206 Acquire context information corresponding to the stack overflow, and perform a stack overflow problem check based on the context information.
- the operating system executes an interrupt exception handler for memory access exception handling.
- context information can be printed and anomaly analysis can be performed based on the context information for troubleshooting.
- the context information may include, but is not limited to, a task identification that triggers an interrupt, an interrupt execution status, function call stack information, and the like.
- the edge of the stack growth direction can be protected by the MPU, and operations such as reading and/or writing and/or execution are prohibited, and the memory access interrupt is triggered immediately when the system code overflows, and the hardware interrupt is interrupted. Effectively improve the timeliness of stack overflow detection, timely discover the occasional problems such as stack overflow, and shorten the stack overflow troubleshooting time.
- the apparatus may specifically include the following modules:
- the stack overflow detection module 301 is configured to detect, by using a memory management device, whether a stack overflow occurs on the specified stack.
- the interrupt processing module 302 is configured to trigger a memory access interrupt by the memory management device when detecting a stack overflow of the specified stack.
- the device may further include the following modules:
- a stack information obtaining module configured to acquire stack information of the specified stack, where the stack information includes a start address and a stack size of the specified stack;
- a stack bottom address determining module configured to determine a stack bottom address of the specified stack based on a starting address of the specified stack and a stack size
- An access permission setting module is configured to set access rights of the stack bottom address by using the memory management device.
- the specified stack includes a task stack
- the stack information obtaining module is further configured to:
- the stack information of the task stack is acquired.
- the specified stack includes an interrupt stack
- the stack information obtaining module is further configured to:
- the stack information of the interrupt stack is obtained from the compiled link script.
- the stack overflow detection module 301 is further configured to:
- the device may further include the following modules:
- a context information obtaining module configured to acquire context information corresponding to the stack overflow
- a troubleshooting module is configured to perform a stack overflow problem based on the context information.
- the memory management device includes a memory protection unit MPU or a memory management unit MMU.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- Embodiments of the present disclosure can be implemented as a system for performing a desired configuration using any suitable hardware, firmware, software, or any combination thereof.
- FIG. 4 schematically illustrates an exemplary system (or apparatus) 400 that can be used to implement various embodiments described in this disclosure.
- FIG. 4 illustrates an exemplary system 400 having one or more processors 402, a system control module (chipset) coupled to at least one of the processor(s) 402. 404.
- System memory 406 coupled to system control module 404, non-volatile memory (NVM)/storage device 408 coupled to system control module 404, and one or more inputs/outputs coupled to system control module 404 Device 410, and a network interface 412 that is coupled to system control module 406.
- NVM non-volatile memory
- Processor 402 may include one or more single or multi-core processors, and processor 402 may comprise any combination of general purpose or special purpose processors (eg, graphics processors, application processors, baseband processors, etc.).
- system 400 can function as a browser as described in embodiments of the present application.
- system 400 can include and be integrated with one or more computer readable media (eg, system memory 406 or NVM/storage device 408) having instructions configured to One or more processors 402 that execute the instructions to implement the modules to perform the actions described in this disclosure.
- computer readable media eg, system memory 406 or NVM/storage device 408 having instructions configured to One or more processors 402 that execute the instructions to implement the modules to perform the actions described in this disclosure.
- system control module 404 can include any suitable interface controller to provide to at least one of processor(s) 402 and/or any suitable device or component in communication with system control module 404. Any suitable interface.
- System control module 404 can include a memory controller module to provide an interface to system memory 406.
- the memory controller module can be a hardware module, a software module, and/or a firmware module.
- System memory 406 can be used, for example, to load and store data and/or instructions for system 400.
- system memory 406 can include any suitable volatile memory, such as a suitable DRAM.
- system memory 406 can include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
- system control module 404 can include one or more input/output controllers to provide an interface to NVM/storage device 408 and input/output device(s) 410.
- NVM/storage device 408 can be used to store data and/or instructions.
- NVM/storage device 408 may comprise any suitable non-volatile memory (eg, flash memory) and/or may include any suitable non-volatile storage device(s) (eg, one or more hard disk drives (HDD), one or more compact disc (CD) drives and/or one or more digital versatile disc (DVD) drives).
- HDD hard disk drives
- CD compact disc
- DVD digital versatile disc
- NVM/storage device 408 can include a storage resource that is physically part of the device on which system 400 is installed, or that can be accessed by the device without having to be part of the device.
- the NVM/storage device 408 can be accessed via the network via the input/output device(s) 410.
- the NVM/storage device 408 may further include a memory management device, which may include an MPU or an MMU, etc., for managing the memory of the terminal, such as setting access rights of the memory, detecting whether the memory overflows, triggering an abnormal interruption of the memory access, Perform memory exception handling, etc.
- a memory management device which may include an MPU or an MMU, etc., for managing the memory of the terminal, such as setting access rights of the memory, detecting whether the memory overflows, triggering an abnormal interruption of the memory access, Perform memory exception handling, etc.
- the input/output device(s) 410 can provide an interface to the system 400 to communicate with any other suitable device, and the input/output device 410 can include a communication component, an audio component, a sensor component, and the like.
- Network interface 412 can provide an interface for system 400 to communicate over one or more networks, and system 400 can interact with one or more of the wireless networks in accordance with any of one or more wireless network standards and/or protocols.
- the components communicate wirelessly, such as by accessing a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof for wireless communication.
- At least one of the processor(s) 402 can be packaged with logic of one or more controllers (eg, memory controller modules) of the system control module 404.
- at least one of the processor(s) 402 can be packaged with the logic of one or more controllers of the system control module 404 to form a system in package (SiP).
- at least one of the processor(s) 402 can be integrated on the same mold as the logic of one or more controllers of the system control module 404.
- at least one of the processor(s) 402 can be integrated on the same mold as the logic of one or more controllers of the system control module 404 to form a system on a chip (SoC).
- SoC system on a chip
- system 400 can be, but is not limited to, a browser, a workstation, a desktop computing device, or a mobile computing device (eg, a laptop computing device, a handheld computing device, a tablet, a netbook, etc.).
- system 400 can have more or fewer components and/or different architectures.
- system 400 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit ( ASIC) and speakers.
- LCD liquid crystal display
- ASIC application specific integrated circuit
- the display screen can be implemented as a touch screen display to receive an input signal from the user.
- the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel.
- the touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
- the embodiment of the present application further provides a non-volatile readable storage medium, where the storage medium stores one or more programs, and when the one or more modules are applied to the terminal device, the terminal may be The device executes the instructions of the method steps in the embodiment of the present application.
- An apparatus in one example, comprising: one or more processors; and one or more machine-readable media having instructions stored thereon, when executed by the one or more processors, The apparatus is caused to perform the method as in the embodiment of the present application.
- Also provided in one example is one or more machine readable medium having stored thereon instructions that, when executed by one or more processors, cause the apparatus to perform the method as in the embodiments of the present application.
- embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
- Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flow or in a flow or block diagram of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
- Storage Device Security (AREA)
Abstract
本申请实施例提供了一种栈溢出处理的方法及装置,其中所述方法包括:采用内存管理器件检测指定栈是否发生栈溢出;当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。通过内存管理器件来检测栈溢出,可以有效提高栈溢出检测的时效性,及时发现栈溢出等偶现性问题,缩短栈溢出问题排查时间。
Description
本申请要求2017年06月27日递交的申请号为201710502695.7、发明名称为“一种栈溢出处理的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及内存处理技术领域,特别是涉及一种栈溢出处理的方法以及一种栈溢出处理的装置。
在操作系统的运行过程中,栈溢出是导致操作系统不稳定的重要原因,由于栈溢出具有偶现的特点,往往很难找到导致问题的原因,导致产品研发周期的不确定性。
在现有技术中,通常采用如下方式进行栈溢出检测:
在进程的栈初始化的时候,按预设的字节对齐方式,用特定魔数(比如0x9527)将栈元素依次完成初始化;在系统运行的时候,通过守护进程,依次遍历各个进程的栈,检测栈元素的值是否等于初始化的魔数,求得被污染的元素个数所占栈大小的比例,即为栈使用量,根据栈使用量来判定是否发生栈溢出。
通过这种方法,虽然能检测到是否出现栈溢出,但由于需要在系统运行的时候通过检测魔数有没有改变来判定是否出现溢出,此时距离栈溢出已经有一段时间,因此,现有方案不能及时的检测出栈溢出,导致栈溢出的排查时间较长。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种栈溢出处理的方法和相应的一种栈溢出处理的装置。
为了解决上述问题,本申请实施例公开了一种栈溢出处理的方法,所述方法包括:
采用内存管理器件检测指定栈是否发生栈溢出;
当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
优选地,在所述采用所述内存管理器件检测指定栈是否发生栈溢出的步骤之前,还包括:
获取所述指定栈的栈信息,所述栈信息包括所述指定栈的起始地址以及栈大小;
基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;
采用所述内存管理器件,设置所述栈底地址的访问权限。
优选地,所述指定栈包括任务栈,所述获取所述指定栈的栈信息的步骤包括:
当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
优选地,所述指定栈包括中断栈,所述获取所述指定栈的栈信息的步骤包括:
从编译链接脚本程序中获取所述中断栈的栈信息。
优选地,所述采用所述内存管理器件检测指定栈是否发生栈溢出的步骤包括:
当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出。
优选地,所述方法还包括:
获取所述栈溢出对应的上下文信息;
基于所述上下文信息,进行栈溢出问题排查。
优选地,所述内存管理器件包括内存保护单元MPU或内存管理单元MMU。
本申请实施例还公开了一种栈溢出处理的装置,所述装置包括:
栈溢出检测模块,用于采用内存管理器件检测指定栈是否发生栈溢出;
中断处理模块,用于当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
优选地,所述装置还包括:
栈信息获取模块,用于获取所述指定栈的栈信息,所述栈信息包括所述指定栈的起始地址以及栈大小;
栈底地址确定模块,用于基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;
访问权限设置模块,用于采用所述内存管理器件,设置所述栈底地址的访问权限。
优选地,所述指定栈包括任务栈,所述栈信息获取模块还用于:
当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
优选地,所述指定栈包括中断栈,所述栈信息获取模块还用于:
从编译链接脚本程序中获取所述中断栈的栈信息。
优选地,所述栈溢出检测模块还用于:
当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出。
优选地,所述装置还包括:
上下文信息获取模块,用于获取所述栈溢出对应的上下文信息;
问题排查模块,用于基于所述上下文信息,进行栈溢出问题排查。
优选地,所述内存管理器件包括内存保护单元MPU或内存管理单元MMU。
本申请实施例还公开了一种装置,包括:
一个或多个处理器;和
其上存储有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行上述的方法。
本申请实施例还公开了一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行上述的方法。
本申请实施例包括以下优点:
本申请实施例可以通过内存管理器件来检测任务栈或中断栈是否发生溢出。当内存管理器件检测到任务栈或中断栈发生溢出时,内存管理器件立刻触发内存访问中断,通过内存管理器件这种硬件的方式来检测栈溢出,可以有效提高栈溢出检测的时效性,及时发现栈溢出等偶现性问题,缩短栈溢出问题排查时间。
图1是本申请的一种栈溢出处理的方法实施例一的步骤流程图;
图2是本申请的一种栈溢出处理的方法实施例二的步骤流程图;
图3是本申请的一种栈溢出处理的装置实施例的结构框图;
图4本申请一种智能终端实施例的结构框图。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
本申请实施例可以应用于安装有操作系统的计算设备中,该计算设备可以包括终端或服务器,该计算设备中可以包括内存管理器件。具体的,该内存管理器件可以用于对计算设备的内存进行管理,例如设置内存的访问权限、检测内存是否溢出、触发内存访问异常中断、进行内存异常处理等。
在本申请实施例中,该内存管理器件可以包括硬件器件和/或软件程序。
例如,该内存管理器件可以包括MPU(Memory Protection Unit,内存保护单元), MPU中一个域就是一些属性值以及其对应的一片内存,这些属性包括:起始地址、长度、读写权限以及缓存等。
又如,该内存管理器件可以包括MMU(Memory Management Unit,内存管理单元),MMU是中央处理器CPU中用来管理虚拟存储器、物理存储器的控制线路,同时也负责虚拟地址映射为物理地址、以及提供硬件机制的内存访问授权、多用户多进程操作系统。
在一种实施方式中,该内存管理可以包括栈的管理,其中,栈是操作系统中抽象出来的一种先进后出的内存区域,主要用于局部变量和接口调用参数的自动存取。作为一种示例,栈可以包括任务栈和中断栈。
任务栈可以用于在任务切换时保存上下文信息。
中断栈可以用于产生中断时保存上下文信息。
本申请实施例可以应用于互联网中的内存管理,也可以应用于物联网(Internet of Things,简称IoT)中的内存管理。
以下以物联网的内存管理为例,对本申请实施例进行详细说明:
参照图1,示出了本申请的一种栈溢出处理的方法实施例一的步骤流程图,本申请实施例具体可以包括如下步骤:
步骤101,采用内存管理器件检测指定栈是否发生栈溢出;
在本申请实施例中,计算设备所使用的操作系统可以包括RTOS(Real Time Operating System,实时操作系统)。
在一种实施方式中,本申请实施例所说的指定栈可以包括RTOS系统中任务栈或中断栈。
步骤102,当检测到指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
本申请实施例可以通过内存管理器件来检测任务栈或中断栈是否发生溢出。当内存管理器件检测到任务栈或中断栈发生溢出时,内存管理器件立刻触发内存访问中断,通过内存管理器件这种硬件的方式来检测栈溢出,可以有效提高栈溢出检测的时效性,及时发现栈溢出等偶现性问题,缩短栈溢出问题排查时间。
参照图2,示出了本申请的一种栈溢出处理的方法实施例二的步骤流程图,本申请实施例具体可以包括如下步骤:
步骤201,获取指定栈的栈信息;
在具体实现中,RTOS系统可以获取指定栈的栈信息,作为一种示例,该栈信息可 以包括但不限于:指定栈的起始地址、栈大小、栈名称、任务名称等。
在本申请实施例的一种优选实施例中,若指定栈为任务栈,则步骤201进一步可以包括如下子步骤:当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
具体的,由于任务栈随着任务的切换而切换,因此,可以在检测到任务栈进行切换时,获得任务栈的栈信息。在具体实现中,若检测到系统调度的任务的指针发生变化时,则可以判定此时任务栈发生切换,此时,可以根据切换后的任务的指针所指向的地址,获得切换后的任务的数据结构,从该数据结构中获得栈信息。
在本申请实施例的另一种优选实施例中,若指定栈为中断栈,则步骤201进一步可以包括如下子步骤:从编译链接脚本程序中获取所述中断栈的栈信息。
具体的,物联网系统中共用一个中断栈,栈信息在系统编译链接脚本中声明,因此可以在系统编译前从编译链接脚本程序中获取中断栈的栈信息。
步骤202,基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;
在具体实现中,可以从栈信息中获得对应的栈的起始地址以及栈大小,并根据“栈的起始地址+栈大小”得到该栈的栈底地址。
在实际中,该栈底地址可以为栈增长方向的边缘。
步骤203,采用内存管理器件,设置所述栈底地址的访问权限;
在本申请实施例中,得到栈底地址以后,可以采用内存管理器件,设置栈底地址的访问权限,以对栈增长方向的边缘进行保护。
在具体实现中,可以对栈底地址对应的内存空间设置MPU保护,在MPU中设定该栈底地址的访问权限,作为一种示例,该访问权限可以包括:禁止读和/或禁止写和/或禁止执行代码等。或者,该访问权限也可以设定为禁止一切访问操作。
步骤204,当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出;
具体的,当检测到针对栈底地址的访问操作时,则可以判定该任务栈或中断栈发生栈溢出。在实现中,因为已经限制了栈底的访问权限,当对栈底进行读或写或执行等操作时,则可以判定栈溢出。
步骤205,由所述内存管理器件触发内存访问中断;
在本申请实施例中,当检测到针对任务栈或中断栈的栈底的访问操作时,可以立刻触发内存访问异常的中断。
步骤206,获取所述栈溢出对应的上下文信息,并基于所述上下文信息,进行栈溢出问题排查。
当内存管理器件触发内存访问中断以后,操作系统执行中断异常处理函数以进行内存访问异常处理。
在内存访问异常处理的过程中,可以打印上下文信息,并根据该上下文信息进行异常分析,以进行问题排查。
作为一种示例,该上下文信息可以包括但不限于触发中断的任务标识、中断执行状态、函数调用栈信息等。
在本申请实施例中,可以通过MPU对栈增长方向的边缘进行保护,禁止读和/或写和/或执行等操作,在系统代码出现栈溢出时立刻触发内存访问中断,通过硬件中断的方式有效提高栈溢出检测的时效性,及时发现栈溢出等偶现性问题,缩短栈溢出问题排查时间。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图3,示出了本申请的一种栈溢出处理的装置实施例的结构框图,所述装置具体可以包括如下模块:
栈溢出检测模块301,用于采用内存管理器件检测指定栈是否发生栈溢出;
中断处理模块302,用于当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
在本申请实施例的一种优选实施例中,所述装置还可以包括如下模块:
栈信息获取模块,用于获取所述指定栈的栈信息,所述栈信息包括所述指定栈的起始地址以及栈大小;
栈底地址确定模块,用于基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;
访问权限设置模块,用于采用所述内存管理器件,设置所述栈底地址的访问权限。
在本申请实施例的一种优选实施例中,所述指定栈包括任务栈,所述栈信息获取模块还用于:
当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
在本申请实施例的一种优选实施例中,所述指定栈包括中断栈,所述栈信息获取模块还用于:
从编译链接脚本程序中获取所述中断栈的栈信息。
在本申请实施例的一种优选实施例中,所述栈溢出检测模块301还用于:
当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出。
在本申请实施例的一种优选实施例中,所述装置还可以包括如下模块:
上下文信息获取模块,用于获取所述栈溢出对应的上下文信息;
问题排查模块,用于基于所述上下文信息,进行栈溢出问题排查。
在本申请实施例的一种优选实施例中,所述内存管理器件包括内存保护单元MPU或内存管理单元MMU。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本公开的实施例可被实现为使用任意适当的硬件,固件,软件,或及其任意组合进行想要的配置的系统。图4示意性地示出了可被用于实现本公开中所述的各个实施例的示例性系统(或装置)400。
对于一个实施例,图4示出了示例性系统400,该系统具有一个或多个处理器402、被耦合到(一个或多个)处理器402中的至少一个的系统控制模块(芯片组)404、被耦合到系统控制模块404的系统存储器406、被耦合到系统控制模块404的非易失性存储器(NVM)/存储设备408、被耦合到系统控制模块404的一个或多个输入/输出设备410,以及被耦合到系统控制模块406的网络接口412。
处理器402可包括一个或多个单核或多核处理器,处理器402可包括通用处理器或专用处理器(例如图形处理器、应用处理器、基频处理器等)的任意组合。在一些实施例中,系统400能够作为本申请实施例中所述的浏览器。
在一些实施例中,系统400可包括具有指令的一个或多个计算机可读介质(例如,系统存储器406或NVM/存储设备408)以及与该一个或多个计算机可读介质相合并被配置为执行指令以实现模块从而执行本公开中所述的动作的一个或多个处理器402。
对于一个实施例,系统控制模块404可包括任意适当的接口控制器,以向(一个或多个)处理器402中的至少一个和/或与系统控制模块404通信的任意适当的设备或组件提供 任意适当的接口。
系统控制模块404可包括存储器控制器模块,以向系统存储器406提供接口。存储器控制器模块可以是硬件模块、软件模块和/或固件模块。
系统存储器406可被用于例如为系统400加载和存储数据和/或指令。对于一个实施例,系统存储器406可包括任意适当的易失性存储器,例如,适当的DRAM。在一些实施例中,系统存储器406可包括双倍数据速率类型四同步动态随机存取存储器(DDR4SDRAM)。
对于一个实施例,系统控制模块404可包括一个或多个输入/输出控制器,以向NVM/存储设备408及(一个或多个)输入/输出设备410提供接口。
例如,NVM/存储设备408可被用于存储数据和/或指令。NVM/存储设备408可包括任意适当的非易失性存储器(例如,闪存)和/或可包括任意适当的(一个或多个)非易失性存储设备(例如,一个或多个硬盘驱动器(HDD)、一个或多个光盘(CD)驱动器和/或一个或多个数字通用光盘(DVD)驱动器)。
NVM/存储设备408可包括在物理上作为系统400被安装在其上的设备的一部分的存储资源,或者其可被该设备访问而不必作为该设备的一部分。例如,NVM/存储设备408可通过网络经由(一个或多个)输入/输出设备410进行访问。
NVM/存储设备408还可以包括内存管理器件,该内存管理器件可以包括MPU或MMU等,用于对终端的内存进行管理,例如设置内存的访问权限、检测内存是否溢出、触发内存访问异常中断、进行内存异常处理等。
(一个或多个)输入/输出设备410可为系统400提供接口以与任意其他适当的设备通信,输入/输出设备410可以包括通信组件、音频组件、传感器组件等。网络接口412可为系统400提供接口以通过一个或多个网络通信,系统400可根据一个或多个无线网络标准和/或协议中的任意标准和/或协议来与无线网络的一个或多个组件进行无线通信,例如接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合进行无线通信。
对于一个实施例,(一个或多个)处理器402中的至少一个可与系统控制模块404的一个或多个控制器(例如,存储器控制器模块)的逻辑封装在一起。对于一个实施例,(一个或多个)处理器402中的至少一个可与系统控制模块404的一个或多个控制器的逻辑封装在一起以形成系统级封装(SiP)。对于一个实施例,(一个或多个)处理器402中的至少一个可与系统控制模块404的一个或多个控制器的逻辑集成在同一模具上。对于一个实施例,(一个或多个)处理器402中的至少一个可与系统控制模块404的一个或多个控制 器的逻辑集成在同一模具上以形成片上系统(SoC)。
在各个实施例中,系统400可以但不限于是:浏览器、工作站、台式计算设备或移动计算设备(例如,膝上型计算设备、手持计算设备、平板电脑、上网本等)。在各个实施例中,系统400可具有更多或更少的组件和/或不同的架构。例如,在一些实施例中,系统400包括一个或多个摄像机、键盘、液晶显示器(LCD)屏幕(包括触屏显示器)、非易失性存储器端口、多个天线、图形芯片、专用集成电路(ASIC)和扬声器。
其中,如果显示器包括触摸面板,显示屏可以被实现为触屏显示器,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。
本申请实施例还提供了一种非易失性可读存储介质,该存储介质中存储有一个或多个模块(programs),该一个或多个模块被应用在终端设备时,可以使得该终端设备执行本申请实施例中各方法步骤的指令(instructions)。
在一个示例中提供了一种装置,包括:一个或多个处理器;和,其上存储的有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行如本申请实施例中的方法。
在一个示例中还提供了一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行如本申请实施例中的方法。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可 提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的栈溢出的处理方法及装置进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (16)
- 一种栈溢出处理的方法,其特征在于,所述方法包括:采用内存管理器件检测指定栈是否发生栈溢出;当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
- 根据权利要求1所述的方法,其特征在于,在所述采用所述内存管理器件检测指定栈是否发生栈溢出的步骤之前,还包括:获取所述指定栈的栈信息,所述栈信息包括所述指定栈的起始地址以及栈大小;基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;采用所述内存管理器件,设置所述栈底地址的访问权限。
- 根据权利要求2所述的方法,其特征在于,所述指定栈包括任务栈,所述获取所述指定栈的栈信息的步骤包括:当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
- 根据权利要求2所述的方法,其特征在于,所述指定栈包括中断栈,所述获取所述指定栈的栈信息的步骤包括:从编译链接脚本程序中获取所述中断栈的栈信息。
- 根据权利要求2-4任一项所述的方法,其特征在于,所述采用所述内存管理器件检测指定栈是否发生栈溢出的步骤包括:当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出。
- 根据权利要求1-4任一项所述的方法,其特征在于,还包括:获取所述栈溢出对应的上下文信息;基于所述上下文信息,进行栈溢出问题排查。
- 根据权利要求1所述的方法,其特征在于,所述内存管理器件包括内存保护单元MPU或内存管理单元MMU。
- 一种栈溢出处理的装置,其特征在于,所述装置包括:栈溢出检测模块,用于采用内存管理器件检测指定栈是否发生栈溢出;中断处理模块,用于当检测到所述指定栈发生栈溢出时,由所述内存管理器件触发内存访问中断。
- 根据权利要求8所述的装置,其特征在于,还包括:栈信息获取模块,用于获取所述指定栈的栈信息,所述栈信息包括所述指定栈的起始地址以及栈大小;栈底地址确定模块,用于基于所述指定栈的起始地址以及栈大小,确定所述指定栈的栈底地址;访问权限设置模块,用于采用所述内存管理器件,设置所述栈底地址的访问权限。
- 根据权利要求9所述的装置,其特征在于,所述指定栈包括任务栈,所述栈信息获取模块还用于:当检测到所述任务栈进行任务切换时,获取所述任务栈的栈信息。
- 根据权利要求9所述的装置,其特征在于,所述指定栈包括中断栈,所述栈信息获取模块还用于:从编译链接脚本程序中获取所述中断栈的栈信息。
- 根据权利要求9-11任一项所述的装置,其特征在于,所述栈溢出检测模块还用于:当检测到对栈底的访问操作时,判定所述指定栈发生栈溢出。
- 根据权利要求8-11任一项所述的装置,其特征在于,还包括:上下文信息获取模块,用于获取所述栈溢出对应的上下文信息;问题排查模块,用于基于所述上下文信息,进行栈溢出问题排查。
- 根据权利要求8所述的装置,其特征在于,所述内存管理器件包括内存保护单元MPU或内存管理单元MMU。
- 一种装置,其特征在于,包括:一个或多个处理器;和其上存储有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行如权利要求1-7一个或多个的方法。
- 一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行如权利要求1-7一个或多个的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/726,596 US20200133713A1 (en) | 2017-06-27 | 2019-12-24 | Stack Overflow Processing Method and Apparatus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710502695.7A CN109144756A (zh) | 2017-06-27 | 2017-06-27 | 一种栈溢出处理的方法及装置 |
| CN201710502695.7 | 2017-06-27 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US16/726,596 Continuation US20200133713A1 (en) | 2017-06-27 | 2019-12-24 | Stack Overflow Processing Method and Apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019001334A1 true WO2019001334A1 (zh) | 2019-01-03 |
Family
ID=64740376
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/092153 Ceased WO2019001334A1 (zh) | 2017-06-27 | 2018-06-21 | 一种栈溢出处理的方法及装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20200133713A1 (zh) |
| CN (1) | CN109144756A (zh) |
| WO (1) | WO2019001334A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112084024A (zh) * | 2020-08-31 | 2020-12-15 | 北京字节跳动网络技术有限公司 | 一种内存监控方法、装置、介质和电子设备 |
Families Citing this family (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11620153B2 (en) * | 2019-02-04 | 2023-04-04 | International Business Machines Corporation | Instruction interrupt suppression of overflow exception |
| CN110362991A (zh) * | 2019-07-19 | 2019-10-22 | 上海睿赛德电子科技有限公司 | 一种实时操作系统的线程栈空间保护的方法 |
| WO2021062798A1 (zh) * | 2019-09-30 | 2021-04-08 | 深圳市汇顶科技股份有限公司 | 栈溢出的检测方法、装置、电子设备及存储介质 |
| CN111858363B (zh) * | 2020-07-24 | 2024-12-10 | Oppo广东移动通信有限公司 | 栈溢出的识别方法、装置、终端及存储介质 |
| CN114282206A (zh) * | 2020-09-28 | 2022-04-05 | 阿里巴巴集团控股有限公司 | 栈溢出检测方法、装置、嵌入式系统和存储介质 |
| CN112579485B (zh) * | 2020-12-19 | 2024-06-14 | 深圳市广和通无线通信软件有限公司 | 数据交互方法、装置、计算机设备和存储介质 |
| CN112905376B (zh) * | 2021-02-10 | 2023-01-10 | 山东英信计算机技术有限公司 | 一种错误上报的方法、装置及介质 |
| KR102878655B1 (ko) * | 2021-12-09 | 2025-10-31 | 현대오토에버 주식회사 | 어플리케이션 스택 보호 방법 |
| CN115048641A (zh) * | 2022-07-21 | 2022-09-13 | 苏州忆联信息系统有限公司 | 基于mpu的栈溢出自动拦截方法、装置、计算机设备及存储介质 |
| CN115858070A (zh) * | 2022-12-09 | 2023-03-28 | 深圳市闪剪智能科技有限公司 | Ios视图控制器推入与推出管理方法、装置、设备及介质 |
| CN116909819A (zh) * | 2023-07-11 | 2023-10-20 | 珠海格力电器股份有限公司 | 一种处理器调试方法、装置、计算机设备及处理器 |
| CN117591333B (zh) * | 2024-01-17 | 2024-06-18 | 深圳市国电科技通信有限公司 | 线程栈溢出检测方法、装置、系统、芯片和介质 |
| CN118012675B (zh) * | 2024-04-10 | 2024-06-28 | 麒麟软件有限公司 | 虚拟化保护GuestOS中断栈的方法、装置及存储介质 |
| CN120029811A (zh) * | 2025-02-28 | 2025-05-23 | 山东云海国创云计算装备产业创新中心有限公司 | 一种多核实时操作系统的栈越界检测方法、装置、设备及系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101154180A (zh) * | 2006-09-29 | 2008-04-02 | 大唐移动通信设备有限公司 | 一种任务栈溢出的监测方法 |
| CN101290596A (zh) * | 2008-05-23 | 2008-10-22 | 中兴通讯股份有限公司 | 一种任务堆栈溢出的实时检测方法及装置 |
| CN104679645A (zh) * | 2013-11-28 | 2015-06-03 | 中国航空工业集团公司航空动力控制系统研究所 | 一种栈空间余量实时检测方法 |
| CN104714834A (zh) * | 2013-12-14 | 2015-06-17 | 中国航空工业集团公司第六三一研究所 | 一种空间确定的任务调度方法 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09198258A (ja) * | 1996-01-19 | 1997-07-31 | Nec Corp | タスクスタックオーバーフロー検出回路 |
| CN101183331B (zh) * | 2007-12-12 | 2010-12-08 | 上海华为技术有限公司 | 一种任务栈溢出检测方法、装置及计算机系统 |
-
2017
- 2017-06-27 CN CN201710502695.7A patent/CN109144756A/zh active Pending
-
2018
- 2018-06-21 WO PCT/CN2018/092153 patent/WO2019001334A1/zh not_active Ceased
-
2019
- 2019-12-24 US US16/726,596 patent/US20200133713A1/en not_active Abandoned
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101154180A (zh) * | 2006-09-29 | 2008-04-02 | 大唐移动通信设备有限公司 | 一种任务栈溢出的监测方法 |
| CN101290596A (zh) * | 2008-05-23 | 2008-10-22 | 中兴通讯股份有限公司 | 一种任务堆栈溢出的实时检测方法及装置 |
| CN104679645A (zh) * | 2013-11-28 | 2015-06-03 | 中国航空工业集团公司航空动力控制系统研究所 | 一种栈空间余量实时检测方法 |
| CN104714834A (zh) * | 2013-12-14 | 2015-06-17 | 中国航空工业集团公司第六三一研究所 | 一种空间确定的任务调度方法 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112084024A (zh) * | 2020-08-31 | 2020-12-15 | 北京字节跳动网络技术有限公司 | 一种内存监控方法、装置、介质和电子设备 |
| CN112084024B (zh) * | 2020-08-31 | 2024-02-02 | 北京字节跳动网络技术有限公司 | 一种内存监控方法、装置、介质和电子设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20200133713A1 (en) | 2020-04-30 |
| CN109144756A (zh) | 2019-01-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019001334A1 (zh) | 一种栈溢出处理的方法及装置 | |
| CN112041823B (zh) | 计算机过程执行的选择性跟踪部分 | |
| US20190286816A1 (en) | Behavior recognition, data processing method and apparatus | |
| US9218302B2 (en) | Page table management | |
| CN104011733B (zh) | 在系统预引导期间具有改进的只读存储器锁定的安全数据保护 | |
| US20250190542A1 (en) | Virtualization-based trusted computing measurement method and apparatus, device, and storage medium | |
| JP6367490B2 (ja) | プロセッサトランザクショナルメモリサポートを用いるメモリアクセス保護 | |
| JP2018523201A (ja) | ファームウェア関連イベント通知 | |
| US11422827B2 (en) | Method, device, apparatus for identifying graphics card of GPU server and medium | |
| US20200257628A1 (en) | File pre-fetch scheduling for cache memory to reduce latency | |
| US9189426B2 (en) | Protected access to virtual memory | |
| CN104572431B (zh) | 一种测试方法及装置 | |
| CN114356591B (zh) | 进程间通信方法、装置、物联网操作系统以及物联网设备 | |
| EP3022643B1 (en) | Techniques for dynamically redirecting device driver operations to user space | |
| WO2019001318A1 (zh) | 一种资源优化与更新的方法、服务器及设备 | |
| CN117827765A (zh) | 文件操作的控制方法、装置、设备和介质 | |
| US10248785B2 (en) | Application memory protection using a host page table switching virtual machine function | |
| JP2018536230A (ja) | キャッシュへのアクセス | |
| CN114064236B (zh) | 任务执行方法、装置、设备和存储介质 | |
| CN109144760B (zh) | 用于获取内存状态的方法、装置、系统及介质 | |
| US11669614B2 (en) | Electronic device and control method therefor | |
| CN109144844B (zh) | 追踪方法、装置、设备和机器可读介质 | |
| CN115344855A (zh) | 基于内核的故障注入方法、系统、电子设备和存储介质 | |
| CN106990998B (zh) | 虚拟机监控方法及装置 | |
| CN112487414B (zh) | 一种进程命令行的获取方法、装置、设备以及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18824671 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18824671 Country of ref document: EP Kind code of ref document: A1 |