Method for locating memory problem and electronic device
By allocating and monitoring memory space, obtaining exception information, using threshold judgment and kernel threads to accurately locate memory problems, solving the difficulty of positioning memory problems in the existing technology, and improving system stability and user experience.
Patent Information
- Application Number
- CN202210020899.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-10
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-01-10
AI Technical Summary
The existing technology lacks effective positioning methods when dealing with memory problems, resulting in frequent system crashes and affecting user experience.
Provide a method to allocate the target memory space, monitor the rewriting of information, obtain memory exception information, including the rewritten memory area and physical address, locate memory problems, use threshold judgment and kernel thread monitoring to determine the cause of the problem, such as kernel state code, IOMMU or DMA access, etc.
It improves the positioning efficiency of memory problems, can accurately locate and solve memory exceptions, and improves user experience.
Smart Images

Figure CN116450473B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electronic devices, and particularly to a method for locating memory stepping problems and an electronic device. Background Art
[0002] During daily system operation and maintenance and debugging processes, memory data failures are often caused by memory stepping problems. Memory stepping problems generally occur when the program memory in the system is modified by abnormal code. Memory stepping problems may cause the system to crash frequently, reducing the user experience.
[0003] There are many reasons for memory stepping problems. For example, memory stepping problems caused by direct memory access (DMA) and input / output memory management unit (IOMMU) directly accessing the memory space, memory stepping problems caused by the jump of double data rate synchronous dynamic random access memory (DDR) and cache, and memory stepping problems caused by kernel-mode code accessing user-mode processes, etc.
[0004] There is an urgent need to provide a method for locating memory stepping problems at present, so as to facilitate developers to solve memory stepping problems. Summary of the Invention
[0005] This application provides a method for locating memory stepping problems and an electronic device, which can locate memory stepping problems, so as to facilitate developers to solve memory stepping problems and improve the user experience.
[0006] In a first aspect, this application provides a method for locating memory stepping problems, including: allocating a first target memory space; monitoring whether the information in the first target memory space is rewritten; when the information in the first target memory space is rewritten, obtaining memory exception information, where the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information; and locating the memory stepping problem according to the memory exception information.
[0007] The first target memory space may be a memory space allocated for a user-mode process, and the electronic device may allocate the first target memory space for the user-mode process.
[0008] The first target memory space may be an idle memory space of the electronic device or a memory space being used by the user mode.
[0009] In a possible implementation, the first target memory space can be the memory space idle in the electronic device. That is, the electronic device can allocate all or part of the memory space from this idle memory space for the user-mode process as the first target memory space.
[0010] In another possible implementation, the first target memory space can be the memory space being used by the user mode. That is, the electronic device can allocate all or part of the memory space from this memory space being used by the user mode for the user-mode process as the first target memory space.
[0011] When the number of first target memory spaces is multiple, the first target memory space can include the memory space idle in the electronic device and the memory space being used by the user mode.
[0012] When the first target memory space is the memory space idle in the electronic device, the information in the first target memory space is written by the electronic device. When the first target memory space can be the memory space being used by the user mode, the information in the first target memory space is written by the user-mode process.
[0013] The memory area corresponding to the rewritten information should be less than or equal to the size of the first target memory space.
[0014] The physical address corresponding to the rewritten information, that is, the physical address of the memory space corresponding to the rewritten information.
[0015] The electronic device can locate the memory stepping problem according to the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information.
[0016] After the electronic device obtains the memory exception information, it can directly locate the memory stepping problem according to the memory exception information, and can also save the memory exception information to the log for subsequent viewing.
[0017] The method for locating the memory stepping problem provided by this application can locate the memory stepping problem according to the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information, so as to facilitate developers to solve the memory stepping problem and improve the user experience.
[0018] Combined with the first aspect, in some implementations of the first aspect, the above-mentioned locating the memory stepping problem according to the memory exception information includes: determining whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; in the case where the size of the memory area corresponding to the rewritten information is greater than the first threshold, determining the memory stepping problem as a memory stepping problem caused by kernel-mode code.
[0019] The method for locating the memory trampling problem provided by this application can determine whether the memory trampling problem is caused by kernel-mode code or DDR by judging whether the size of the memory area corresponding to the rewritten information exceeds a first threshold, so as to facilitate developers to solve the memory trampling problem and improve the user experience.
[0020] In combination with the first aspect, in some implementation manners of the first aspect, after determining that the memory trampling problem is caused by kernel-mode code, the method further includes: judging whether the occurrence times of the physical address corresponding to the rewritten information exceed a second threshold; in the case that the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, determining that the memory trampling problem caused by kernel-mode code is caused by the access of the input / output memory management unit IOMMU or direct memory access DMA in the kernel.
[0021] The method for locating the memory trampling problem provided by this application can determine that the memory trampling problem is caused by the access of IOMMU or DMA in the kernel by judging that the occurrence times of the physical address corresponding to the rewritten information exceed a second threshold, so as to facilitate developers to solve the memory trampling problem and improve the user experience.
[0022] In combination with the first aspect, in some implementation manners of the first aspect, the method further includes: in the case that the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, setting the physical address corresponding to the rewritten information to be not accessible by IOMMU; judging whether the physical address corresponding to the rewritten information is accessed by IOMMU; in the case that the physical address corresponding to the rewritten information is accessed by IOMMU, determining that the memory trampling problem caused by kernel-mode code is caused by the access of IOMMU.
[0023] In combination with the first aspect, in some implementation manners of the first aspect, the method further includes: in the case that the physical address corresponding to the rewritten information is not accessed by IOMMU, determining that the memory trampling problem caused by kernel-mode code is caused by the access of DMA.
[0024] The method for locating the memory trampling problem provided by this application can determine whether the memory trampling problem is caused by IOMMU or the access of DMA by judging whether the physical address corresponding to the rewritten information is accessed by IOMMU, so as to facilitate developers to solve the memory trampling problem and improve the user experience.
[0025] In combination with the first aspect, in some implementations of the first aspect, the above method further includes: when the size of the memory area corresponding to the rewritten information is less than or equal to the first threshold, determining the memory stepping problem as a memory stepping problem caused by a double data rate synchronous dynamic random access memory (DDR).
[0026] In combination with the first aspect, in some implementations of the first aspect, the above method further includes: outputting the rewritten information and / or the kernel page table status corresponding to the rewritten information.
[0027] In combination with the first aspect, in some implementations of the first aspect, before allocating the first target memory space, the above method further includes: determining whether there is a kernel thread for locating the memory stepping problem; when the kernel thread does not exist, allocating the first target memory space.
[0028] In combination with the first aspect, in some implementations of the first aspect, the above first target memory space includes a static memory space or a dynamic memory space.
[0029] Among them, the static memory may refer to the memory space allocated by the electronic device at a preset time. The dynamic memory space may refer to the memory space allocated by the electronic device at regular intervals.
[0030] For the method for locating the memory stepping problem provided by this application, the electronic device can continuously monitor the target memory space or continuously change the monitored target memory space, so as to more comprehensively locate the memory stepping problem.
[0031] In combination with the first aspect, in some implementations of the first aspect, before allocating the first target memory space, the above method further includes: at startup, creating a kernel thread for locating the memory stepping problem; allocating a second target memory space through the kernel thread and monitoring whether the second target memory space is accessed by kernel-mode code, and the second target memory space is only allowed to be used by user-mode processes; when the second target memory space is accessed by kernel-mode code, determining the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing user-mode processes.
[0032] When the electronic device starts up, it enters the kernel mode, and the electronic device creates a kernel thread for locating the memory stepping problem.
[0033] The second target memory space is allowed to be used by user-mode processes and is not allowed to be accessed by kernel-mode code.
[0034] The second target memory space is not allowed to be accessed by kernel-mode code. When the second target memory space is accessed by kernel-mode code, there is an access to the second target memory space by kernel-mode code, that is, an abnormal phenomenon occurs, and the memory stepping problem can be determined as a memory stepping problem caused by kernel-mode code accessing user-mode processes.
[0035] The method for locating memory stomping problems provided by this application can directly determine that the memory stomping problem is caused by kernel-mode code accessing user-mode processes by monitoring memory stomping problems in the second target memory space. It has the ability to locate memory stomping faults, monitors memory stomping problems more comprehensively, so as to facilitate developers to solve memory stomping problems and improve the user experience.
[0036] In a second aspect, this application provides an electronic device, including: a processing module and an acquisition module. The processing module is used to allocate a first target memory space; and monitor whether the information in the first target memory space is rewritten; the acquisition module is used to obtain memory exception information when the information in the first target memory space is rewritten, and the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information; the processing module is further used to: locate the memory stomping problem according to the memory exception information.
[0037] In combination with the second aspect, in some implementation manners of the second aspect, the above-mentioned processing module is further used to: judge whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; when the size of the memory area corresponding to the rewritten information is greater than the first threshold, determine the memory stomping problem as a memory stomping problem caused by kernel-mode code.
[0038] In combination with the second aspect, in some implementation manners of the second aspect, the above-mentioned processing module is further used to: judge whether the occurrence times of the physical address corresponding to the rewritten information exceed a second threshold; when the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, determine the memory stomping problem caused by kernel-mode code as a memory stomping problem caused by the access of the input / output memory management unit IOMMU or direct memory access DMA in the kernel.
[0039] In combination with the second aspect, in some implementation manners of the second aspect, the above-mentioned processing module is further used to: when the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, set the physical address corresponding to the rewritten information as not allowed to be accessed by IOMMU; judge whether the physical address corresponding to the rewritten information is accessed by IOMMU; when the physical address corresponding to the rewritten information is accessed by IOMMU, determine the memory stomping problem caused by kernel-mode code as a memory stomping problem caused by the access of IOMMU.
[0040] In combination with the second aspect, in some implementation manners of the second aspect, the above-mentioned processing module is further used to: when the physical address corresponding to the rewritten information is not accessed by IOMMU, determine the memory stomping problem caused by kernel-mode code as a memory stomping problem caused by the access of DMA.
[0041] In combination with the second aspect, in some implementations of the second aspect, the above-mentioned processing module is further configured to: when the size of the memory area corresponding to the rewritten information is less than or equal to the first threshold, determine the memory stepping problem as a memory stepping problem caused by the double data rate synchronous dynamic random access memory (DDR).
[0042] In combination with the second aspect, in some implementations of the second aspect, the above-mentioned processing module is further configured to: output the rewritten information and / or the kernel page table status corresponding to the rewritten information.
[0043] In combination with the second aspect, in some implementations of the second aspect, the above-mentioned processing module is further configured to: determine whether there is a kernel thread for locating the memory stepping problem; and allocate a first target memory space when the kernel thread does not exist.
[0044] In combination with the second aspect, in some implementations of the second aspect, the above-mentioned first target memory space includes a static memory space or a dynamic memory space.
[0045] In combination with the second aspect, in some implementations of the second aspect, the above-mentioned processing module is further configured to: at startup, create a kernel thread for locating the memory stepping problem; allocate a second target memory space through the kernel thread, and monitor whether the second target memory space is accessed by kernel-mode code, where the second target memory space is only allowed to be used by user-mode processes; and when the second target memory space is accessed by kernel-mode code, determine the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing user-mode processes.
[0046] In a third aspect, the present application provides an electronic device, including a processor, which is coupled to a memory and can be used to execute instructions in the memory to implement the method in any possible implementation manner of the first aspect above. Optionally, the device for running the application further includes a memory. Optionally, the electronic device further includes a communication interface, and the processor is coupled to the communication interface.
[0047] In a fourth aspect, the present application provides a processor, including: an input circuit, an output circuit, and a processing circuit. The processing circuit is configured to receive a signal through the input circuit and transmit the signal through the output circuit, so that the processor executes the method in any possible implementation manner of the first aspect above.
[0048] In the specific implementation process, the above-mentioned processor can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the processing circuit can be transistors, gate circuits, flip-flops, and various logic circuits, etc. The input signal received by the input circuit can be received and input by, for example, but not limited to, a receiver. The signal output by the output circuit can be output to, for example, but not limited to, a transmitter and transmitted by the transmitter. Moreover, the input circuit and the output circuit can be the same circuit, which is used as the input circuit and the output circuit at different times respectively. The present application does not limit the specific implementation manners of the processor and various circuits.
[0049] In a fifth aspect, the present application provides a processing device, including a processor and a memory. The processor is configured to read instructions stored in the memory, and can receive signals through a receiver and transmit signals through a transmitter to execute the method in any possible implementation manner in the first aspect above.
[0050] Optionally, there is one or more processors, and one or more memories.
[0051] Optionally, the memory can be integrated with the processor, or the memory is separately arranged from the processor.
[0052] In the specific implementation process, the memory can be a non-transitory memory, such as a read only memory (ROM). It can be integrated with the processor on the same chip, or can be separately arranged on different chips. The present application does not limit the type of the memory and the arrangement manner of the memory and the processor.
[0053] It should be understood that relevant data interaction processes, such as sending indication information, can be a process of outputting indication information from the processor, and receiving capability information can be a process of the processor receiving input capability information. Specifically, the data processed and output can be output to the transmitter, and the input data received by the processor can come from the receiver. Among them, the transmitter and the receiver can be collectively referred to as a transceiver.
[0054] The processing device in the fifth aspect above can be a chip. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0055] Sixth aspect, the present application provides a computer-readable storage medium storing a computer program (which may also be referred to as code or instruction), and when it runs on a computer, enables the computer to execute the method in any possible implementation manner of the first aspect above.
[0056] Seventh aspect, the present application provides a computer program product, which includes: a computer program (which may also be referred to as code or instruction), and when the computer program runs, enables the computer to execute the method in any possible implementation manner of the first aspect above. Description of the Drawings
[0057] Figure 1 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0058] Figure 2 It is a schematic block diagram of the software structure of an electronic device provided by an embodiment of the present application;
[0059] Figure 3 It is a schematic block diagram of the software structure of a first memory stepping positioning module provided by an embodiment of the present application;
[0060] Figure 4 It is a schematic flow chart of a method for positioning a memory stepping problem provided by an embodiment of the present application;
[0061] Figure 5 It is a schematic flow chart of another method for positioning a memory stepping problem provided by an embodiment of the present application;
[0062] Figure 6 It is a schematic flow chart of yet another method for positioning a memory stepping problem provided by an embodiment of the present application;
[0063] Figure 7 It is a schematic flow chart of another method for positioning a memory stepping problem provided by an embodiment of the present application;
[0064] Figure 8 It is a schematic flow chart of yet another method for positioning a memory stepping problem provided by an embodiment of the present application;
[0065] Figure 9 It is a schematic block diagram of an electronic device provided by an embodiment of the present application;
[0066] Figure 10 It is a schematic block diagram of another electronic device provided by an embodiment of the present application. Detailed Embodiments
[0067] Next, the technical solutions in the present application will be described with reference to the drawings.
[0068] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. For example, the first threshold and the second threshold are used to distinguish different thresholds, and no limitation is imposed on their sequence. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily limit them to be different.
[0069] It should be noted that in the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplarily" or "for example" aims to present relevant concepts in a specific manner.
[0070] In addition, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the preceding and following associated objects. "At least one (item)" or similar expressions thereof refer to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, and c may represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c may be single or multiple.
[0071] To better understand the embodiments of the present application, the terms related to the embodiments of the present application will be introduced first.
[0072] 1. Memory trampling problem
[0073] An error that occurs when the program memory in the system is modified by abnormal code can be called a memory trampling problem. Memory trampling can also be simply understood as a process accessing memory that it should not access.
[0074] Common phenomena of memory trampling include the following:
[0075] 1) Out-of-bounds memory trampling: The memory space trampled by the process is next to the memory space corresponding to the process. That is to say, the memory space applied for by the process is too small, resulting in the memory space used by the process exceeding the applied memory space.
[0076] 2) Memory still occupied after release: The memory space applied for by a process is released after being used by the process, but the memory space remains in a used state. That is to say, there is an abnormal program occupying the released memory space.
[0077] 3) Memory released repeatedly: After a process applies for a memory space, the memory space is released by another process. When this process uses it and then releases the memory space, the same memory space may be released repeatedly.
[0078] 2. Kernel mode and user mode
[0079] When a process (or task) executes a system call and gets into the kernel code for execution, the process is generally said to be in the kernel running state, or simply the kernel mode.
[0080] When a process is executing its own user code, it is said to be in the user running state, or simply the user mode.
[0081] 3. Memory management unit (MMU)
[0082] The MMU is deployed in the CPU and is an essential part of the CPU architecture.
[0083] The MMU can have the following functions:
[0084] 1) Perform virtual address translation. When a user accesses memory, the MMU can translate the virtual address accessed by the user into an actual physical address so that the CPU can access the actual physical address.
[0085] 2) Control access permissions. The MMU can control the access permissions for some virtual addresses to manage the access permissions and scope of user programs. For example, the code segment is generally set to read-only. If a user program performs a write operation on the code segment, the system will trigger an exception.
[0086] 3) Extended physical memory management. The MMU can manage the physical memory resources of the system and provide operation interfaces such as physical memory application and release for user programs.
[0087] 4. Input / output memory management unit (IOMMU)
[0088] The IOMMU is a memory management unit used to convert the virtual address when an external device of an electronic device accesses memory into a physical address.
[0089] 5. Double Data Rate Synchronous Dynamic Random Access Memory (DDR)
[0090] DDR can transfer data twice within one clock cycle. For example, one clock cycle includes the rising edge and the falling edge of the clock. DDR can transfer data once during the rising edge of the clock and once during the falling edge of the clock.
[0091] During daily system operation and debugging, memory data failures are often caused by memory stepping problems. Memory stepping problems generally occur when the program memory in the system is modified by abnormal code. Memory stepping problems may cause the system to crash frequently, reducing the user experience.
[0092] There are many reasons for memory stepping problems. For example, memory stepping problems caused by direct memory access (DMA) and input / output memory management unit (IOMMU) directly accessing the memory space, memory stepping problems caused by the jump of double data rate synchronous dynamic random access memory (DDR) and cache, and memory stepping problems caused by kernel-mode code accessing user-mode processes, etc.
[0093] Exemplarily, the kernel-mode code can directly write to the physical memory page through the kernel linear mapping page table. When the physical memory page is released and then used by the user-mode process, a memory stepping problem caused by the kernel-mode code accessing the user-mode process will occur. Among them, the situations of executing kernel-mode code can include user-mode processes calling system calls, driver code execution, kernel threads, etc.
[0094] Currently, when a memory stepping problem occurs, the current technology can output information such as the process identifier, instruction address, and stack information that cause the memory exception, so that users or developers can use the output information to locate the fault. This method requires manual location of the memory stepping fault source and does not have the ability to locate memory stepping faults, which may lead to a long time to solve the memory stepping problem and affect the efficiency of solving the memory stepping problem.
[0095] In view of this, the embodiments of the present application provide a method for locating memory stepping problems and an electronic device, which can locate special memory stepping problems (such as IOMMU, DMA, DDR, or kernel stepping on user-mode memory) to facilitate developers to solve memory stepping problems and improve the user experience.
[0096] The electronic device involved in the embodiments of the present application can be an electronic device with an operating system. For example, mobile phones, tablet computers, personal computers (PCs), wearable electronic devices such as smart watches, various teaching aids (such as learning machines, early education machines), smart toys, portable robots, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, etc.
[0097] In order to better understand the embodiments of the present application, the following introduces the hardware structure of the electronic device in the embodiments of the present application. Exemplarily, Figure 1 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
[0098] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, a key 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0099] Optionally, the above-mentioned sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0100] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0101] The processor 110 may include one or more processing units. Among them, different processing units may be independent devices or integrated in one or more processors. A memory may also be provided in the processor 110 for storing instructions and data.
[0102] The USB interface 130 is an interface that complies with the USB standard specifications. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device, and can also be used to transfer data between the electronic device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices, etc.
[0103] The charging management module 140 is used to receive charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. The power management module 141 is used to connect the charging management module 140 and the processor 110.
[0104] The wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0105] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antennas in the electronic device can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas.
[0106] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by antenna 1, and perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0107] The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc. applied to the electronic device.
[0108] The electronic device realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
[0109] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1.
[0110] The electronic device can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.
[0111] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device may include one or N cameras 193, where N is a positive integer greater than 1.
[0112] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0113] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area.
[0114] The electronic device can implement the audio function through the audio module 170, speaker 170A, receiver 170B, microphone 170C, and application processor, etc. For example, music playback, recording, etc.
[0115] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert analog audio input into a digital audio signal. The speaker 170A, also known as the "loudspeaker", is used to convert the audio electrical signal into a sound signal. The electronic device can listen to music or hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the ear. The microphone 170C, also known as the "microphone", "transmitter", is used to convert the sound signal into an electrical signal.
[0116] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device. The barometric pressure sensor 180C is used to measure barometric pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes). The distance sensor 180F is used to measure distance. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature. The touch sensor 180K, also known as a "touch control device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also known as a "touch control screen". The bone conduction sensor 180M can obtain vibration signals.
[0117] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The electronic device can receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device. The indicator 192 can be an indicator light, which can be used to indicate the charging state, battery level change, and can also be used to indicate messages, missed calls, notifications, etc.
[0118] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. The layered architecture can adopt the Android system, the iOS system, or other operating systems, and the embodiments of the present application do not limit this.
[0119] Taking the Android system with a layered architecture as an example below, the software structure of the electronic device will be exemplarily described.
[0120] Figure 2 This is a software structure block diagram of the electronic device applicable to the embodiments of the present application. The layered architecture divides the software system of the electronic device into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom, which are the application layer, the application framework layer, the system services, the Android runtime and system libraries, and the kernel layer.
[0121] The application layer may include a series of application packages. The application layer runs applications by calling the application programming interfaces (APIs) provided by the application framework layer. As Figure 2 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, etc.
[0122] The application framework layer provides APIs and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. As Figure 2 shown, the application framework layer may include window manager, content provider, view system, telephone manager, resource manager, notification manager, etc.
[0123] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data, and make this data accessible to applications. The data may include video, image, audio, dialed and answered calls, browsing history and bookmarks, phone book, etc. The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures. The telephone manager is used to provide the communication function of the electronic device. For example, the management of call status (including connection, disconnection, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of a background running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt tone, the electronic device vibrates, the indicator light flashes, etc.
[0124] When the Android system runs, it includes core libraries and a virtual machine. The Android system runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0125] System services can include libraries in C or C++ languages, which can be used by different components in the Android system and can also provide services for developers through the application framework layer. System services can include a first memory stepping positioning module and a memory usage module. The first memory stepping positioning module is used to monitor whether a memory stepping problem occurs in the memory space and, in the case of a memory stepping problem, locate the memory stepping problem. The memory usage module includes the memory space that has been occupied in the user state.
[0126] The system libraries can contain multiple functional modules, such as a layer manager and a media library, etc.
[0127] The layer (Surface) manager is used to manage the display subsystem and provides the fusion of 2D layers and 3D layers for multiple applications. The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as JPG, PNG, etc.
[0128] Optionally, the first memory stepping positioning module can include multiple modules, which are respectively used to monitor whether a memory stepping problem occurs in the memory space and, in the case of a memory stepping problem, locate the memory stepping problem. The embodiments of the present application do not limit the number of such modules.
[0129] Exemplarily, Figure 3 is the software structure block diagram of the first memory stepping positioning module in the embodiments of the present application. As Figure 3 shown, the first memory stepping positioning module can include a scan thread module, a scan policy module, a hold memory module, a dump module, and a position module.
[0130] Among them, the scanning thread module is used to create a monitoring thread to monitor the memory space. The scanning policy module is used to determine the size of the monitored memory space, the number of monitored memory spaces, and whether the monitored memory space is static memory or dynamic memory. The memory acquisition module is used to acquire the memory space according to the policy in the scanning policy module. The output information module is used to output the abnormal information of the monitored memory space. The positioning module is used to locate the memory stepping problem according to the abnormal information of the memory space.
[0131] The kernel layer is the layer between hardware and software. The kernel layer is used to drive the hardware so that the hardware works. The kernel layer at least includes a camera driver and a sensor driver, etc., and the embodiments of the present application do not limit this. The kernel layer can also serve as an abstraction layer between the hardware and the software stack and can include multiple library modules. The library modules can be, for example, a second memory stepping positioning module and a memory allocation module, etc. Among them, the second memory stepping positioning module is used to detect whether a memory stepping problem occurs in the memory space, and in the case of a memory stepping problem, locate the memory stepping problem. The memory allocation module is used to allocate memory space.
[0132] Optionally, the memory allocation module can allocate memory space through a memory allocation function (such as memfd_create). In a possible implementation, the memory space allocated by the memory allocation module can only be used by user-space processes (which can be configured by memory hardware such as MMU or IOMMU), and kernel code access can be prohibited. The Android system can load the corresponding library modules for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware.
[0133] Optionally, the second memory stepping positioning module can include multiple modules, which are respectively used to monitor whether a memory stepping problem occurs in the memory space and to locate the memory stepping problem in the case of a memory stepping problem. The embodiments of the present application do not limit the number of these modules.
[0134] Exemplarily, the second memory stepping positioning module can be similar to the above-mentioned first memory stepping positioning module, including a scanning thread module, a scanning policy module, a memory acquisition module, an output information module, and a positioning module. The functions of these modules are as described above and will not be elaborated here. However, it should be understood that the number of modules included in the above-mentioned first memory stepping positioning module and the second memory stepping positioning module can be the same or different, and the embodiments of the present application do not limit this.
[0135] To implement the memory stepping problem positioning method of the embodiments of the present application, the above-mentioned first memory stepping positioning module, memory usage module, second memory stepping positioning module, and memory allocation module will be described in detail below with reference to Table 1.
[0136] Table 1
[0137]
[0138] As shown in Table 1, the first memory stepping positioning module and the memory allocation module are both newly added modules in the kernel layer. The first memory stepping positioning module is used to locate the memory stepping problem during kernel startup time. The memory allocation module is used to allocate memory space, and can also make the allocated memory space only accessible to user-space processes. The second memory stepping positioning module and the memory usage module are both newly added modules in the system service. The second memory stepping positioning module is used to locate the memory stepping problem when the system is in the user state. The memory usage module includes the memory space already occupied in the user state.
[0139] Optionally, the above-mentioned first memory stepping positioning module can also be called the kernel placeholder module, the memory allocation module can also be called the protected memory module, and the second memory stepping positioning module can also be called the user-state kernel placeholder module.
[0140] It should be understood that the names of the various modules shown in the above Figure 2 and Figure 3 are only examples given for the convenience of introduction in the embodiments of the present application, and the embodiments of the present application do not limit the names of these modules.
[0141] Figure 4 FIG. 400 is a schematic flowchart of a method for locating a memory stepping problem provided by an embodiment of the present application. This method can be applied to an electronic device. The hardware structure diagram of the electronic device can be as shown in Figure 1 shown, and the software structure block diagram of the electronic device can be as shown in Figure 2 shown, but the embodiments of the present application do not limit this.
[0142] As Figure 4 shown, the method 400 includes the following steps:
[0143] S401. Allocate a first target memory space.
[0144] The first target memory space can be the memory space applied for by a user-space process, and the electronic device can allocate the first target memory space for the user-space process.
[0145] The first target memory space can be 1 Gigabyte (GB), 2 GB, or 4 GB. The embodiments of the present application do not limit the size of the first target memory space. It should be understood that the size of the first target memory space can also be referred to as the length of the first target memory space, and the embodiments of the present application do not limit this.
[0146] The number of first target memory spaces can be 1, 2, or more than 2, and the embodiments of the present application do not limit the number of first target memory spaces. It should be understood that when the number of first target memory spaces is 1, the size of the first target memory space shall not exceed the total memory space of the electronic device; when the number of first target memory spaces is multiple, the total sum of the first target memory spaces shall not exceed the total memory space of the electronic device.
[0147] Exemplarily, the total memory space of the electronic device is 8G. When the number of first target memory spaces is 1, the first target memory space shall not exceed 8G; when the number of first target memory spaces is multiple, the total sum of the first target memory spaces shall not exceed 8G.
[0148] The first target memory space can be the free memory space of the electronic device or the memory space being used in the user state.
[0149] In a possible implementation manner, the first target memory space can be the free memory space of the electronic device, that is, the electronic device can allocate all or part of the memory space from this free memory space for the user state process as the first target memory space.
[0150] Exemplarily, the total memory space of the electronic device is 8G, and the free memory space of the electronic device is 4G. The electronic device can allocate 1G from this free memory space for the user state process as the first target memory space.
[0151] In another possible implementation manner, the first target memory space can be the memory space being used in the user state, that is, the electronic device can allocate all or part of the memory space from this memory space being used in the user state for the user state process as the first target memory space.
[0152] Exemplarily, the total memory space of the electronic device is 8G, and the memory space being used in the user state is 4G. The electronic device can allocate 1G from the memory space being used in the user state for the user state process as the first target memory space.
[0153] When the number of first target memory spaces is multiple, the first target memory space can include the free memory space of the electronic device and the memory space being used in the user state.
[0154] Exemplarily, the number of first target memory spaces is 3, namely target memory space 1, target memory space 2, and target memory space 3. Target memory space 1 and target memory space 2 can both be the free memory space of the electronic device, and target memory space 3 can be the memory space being used in the user state.
[0155] S402. Monitor whether the information in the first target memory space is rewritten.
[0156] The information in the first target memory space is rewritten, that is, the information in the first target memory space changes.
[0157] Exemplarily, the information in the first target memory space is 10100111, and after being rewritten, it becomes 10100000.
[0158] When the first target memory space is the idle memory space of the electronic device, the information in the first target memory space is written by the electronic device. When the first target memory space can be the memory space being used by the user state, the information in the first target memory space is written by the user state process.
[0159] Optionally, the electronic device can monitor whether the information in the first target memory space is rewritten at regular intervals, without continuous monitoring, which can save the processing resources of the electronic device.
[0160] S403. In the case where the information in the first target memory space is rewritten, obtain memory exception information, where the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information.
[0161] It should be understood that the memory area corresponding to the rewritten information should be less than or equal to the size of the first target memory space.
[0162] The physical address corresponding to the rewritten information, that is, the physical address of the memory space corresponding to the rewritten information.
[0163] Optionally, the above method further includes: outputting the rewritten information and / or the kernel page table status corresponding to the rewritten information.
[0164] The kernel page table status may include at least one of the access permission of the kernel page table, the read of the kernel page table, the write operation of the kernel page table, or the read-write operation of the kernel page table.
[0165] The electronic device outputs the rewritten information and / or the kernel page table status corresponding to the rewritten information, so as to facilitate the user or developer to determine whether the memory stepping problem located by the electronic device is correct.
[0166] It should be understood that the output in the embodiments of the present application can be a display output or an implicit output. The display output may refer to being displayed on the interface in the form of a window. The implicit output may refer to being output to a document. The embodiments of the present application do not limit the specific output method.
[0167] S404. According to the memory exception information, locate the memory stepping problem.
[0168] The electronic device can locate the memory stepping problem according to the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information.
[0169] After obtaining the memory exception information, the electronic device can directly locate the memory stepping problem according to the memory exception information, and can also save the memory exception information to the log for subsequent viewing.
[0170] The method for locating the memory stepping problem provided by the embodiments of the present application can locate the memory stepping problem according to the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information, so as to facilitate developers to solve the memory stepping problem and improve the user experience.
[0171] Optionally, the above first target memory space may include a static memory space and / or a dynamic memory space. Among them, the static memory may refer to the memory space allocated by the electronic device at a preset time. The dynamic memory space may refer to the memory space allocated by the electronic device at regular intervals.
[0172] In one possible implementation, the first target memory space is a static memory space. For example, the electronic device can allocate the first target memory space 30 minutes after the electronic device is powered on.
[0173] In this method, the electronic device can continuously monitor the first target memory space and can locate the memory stepping problem of the first target memory space, which is beneficial to subsequent solving of the memory stepping problem of the first target memory space.
[0174] In another possible implementation, the first target memory space is a dynamic memory space. For example, the electronic device can allocate the first target memory space every 10 minutes after the electronic device is powered on for 30 minutes, and the first target memory space allocated each time can be different.
[0175] In this method, the electronic device can continuously change the monitored first target memory space, and can locate the memory stepping problems of different memory spaces at different times, which is beneficial to locating more memory stepping problems.
[0176] In yet another possible implementation, the first target memory space includes a static memory space and a dynamic memory space.
[0177] It should be understood that in this implementation, the number of the first target memory spaces is multiple, that is, at least two.
[0178] In this method, the electronic device can continuously monitor the target memory space or continuously change the monitored target memory space, and can more comprehensively locate the memory stepping problem.
[0179] As an alternative embodiment, step S404 above, which locates the memory stepping problem based on the memory exception information, may include: determining whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; in the case where the size of the memory area corresponding to the rewritten information is greater than the first threshold, determining the memory stepping problem as a memory stepping problem caused by kernel-mode code.
[0180] The first threshold may be preset. For example, the first threshold may be bytes, that is, when the rewritten information is greater than 1 bit, the electronic device determines the memory stepping problem as a memory stepping problem caused by kernel-mode code. It should be understood that the specific size of the first threshold is not limited in the embodiments of the present application.
[0181] Optionally, in the case where the size of the memory area corresponding to the rewritten information is less than or equal to the first threshold, determining the memory stepping problem as a memory stepping problem caused by double data rate synchronous dynamic random access memory (DDR).
[0182] It should be understood that while the above electronic device determines a memory stepping problem caused by kernel-mode code or a memory stepping problem caused by DDR, it may output the rewritten information and / or the kernel page table status corresponding to the rewritten information, so as to facilitate the user or developer to determine whether the memory stepping problem located by the electronic device is correct.
[0183] The method for locating the memory stepping problem provided by the embodiments of the present application can determine whether it is a memory stepping problem caused by kernel-mode code or a memory stepping problem caused by DDR by determining whether the size of the memory area corresponding to the rewritten information exceeds the first threshold, so as to facilitate developers to solve the memory stepping problem and improve the user experience.
[0184] As an alternative embodiment, after determining the memory stepping problem as a memory stepping problem caused by kernel-mode code, the above method 400 further includes: determining whether the number of occurrences of the physical address corresponding to the rewritten information exceeds a second threshold; in the case where the number of occurrences of the physical address corresponding to the rewritten information exceeds the second threshold, determining the memory stepping problem caused by kernel-mode code as a memory stepping problem caused by the access of IOMMU or DMA in the kernel.
[0185] The second threshold may be preset. For example, the second threshold may be 6 times, that is, when the number of occurrences of the physical address corresponding to the rewritten information exceeds 6 times, the electronic device determines the memory stepping problem caused by kernel-mode code as a memory stepping problem caused by the access of IOMMU or DMA in the kernel. It should be understood that the specific size of the second threshold is not limited in the embodiments of the present application.
[0186] It should also be understood that the embodiments of the present application do not limit the case where the occurrence times of the physical address corresponding to the rewritten information are less than or equal to the second threshold.
[0187] Optionally, when the memory stepping problem is caused by the access of IOMMU or DMA in the kernel, the rewritten information and / or the kernel page table status corresponding to the rewritten information may be output, so as to facilitate the user or developer to determine whether the memory stepping problem located by the electronic device is correct.
[0188] The memory stepping problem location method provided by the embodiments of the present application can determine that the memory stepping problem is caused by the access of IOMMU or DMA in the kernel by judging that the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, so as to facilitate the developer to solve the memory stepping problem and improve the user experience.
[0189] As an optional embodiment, when the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, the electronic device may also set the physical address corresponding to the rewritten information to be not accessible by IOMMU; judge whether the physical address corresponding to the rewritten information is accessed by IOMMU; when the physical address corresponding to the rewritten information is accessed by IOMMU, determine that the memory stepping problem caused by the kernel state code is the memory stepping problem caused by the access of IOMMU.
[0190] Optionally, when the physical address corresponding to the rewritten information is not accessed by IOMMU, determine that the memory stepping problem caused by the kernel state code is the memory stepping problem caused by the access of DMA.
[0191] The memory stepping problem location method provided by the embodiments of the present application can determine whether the memory stepping problem is caused by IOMMU or the access of DMA by judging whether the physical address corresponding to the rewritten information is accessed by IOMMU, so as to facilitate the developer to solve the memory stepping problem and improve the user experience.
[0192] In Figure 3 On the basis of the software structure block diagram of the first memory stepping location module shown, Figure 5 It further shows a schematic flowchart of a memory stepping problem location method 500 based on the Figure 2 and Figure 3 shown software architecture.
[0193] As Figure 5 shown, the method 500 may include the following steps:
[0194] S501. The scanning thread module creates a start thread to start locating the memory stepping problem.
[0195] Exemplarily, the starting thread can be start scan kthread. The scan thread module starts to locate the memory stepping problem through start scankthread.
[0196] S502. The scan policy module determines the information of the first target memory space, where the information of the first target memory space includes the size of the first target memory space, the number of the first target memory spaces, and whether the first target memory space is static memory or dynamic memory.
[0197] The information of the first target memory space can refer to the above method 400 and will not be elaborated here.
[0198] S503. The scan policy sends the information of the first target memory space to the memory acquisition module. Correspondingly, the memory acquisition module receives the information of the first target memory space.
[0199] S504. Based on the information of the first target memory space, the memory acquisition module sends a request to allocate the first target memory space to the memory allocation module. Correspondingly, the memory allocation module receives the request to allocate the first target memory space.
[0200] Exemplarily, the memory acquisition module can send a request to allocate the first target memory space to the memory allocation module based on the allocMemory function.
[0201] S505. Based on the request to allocate the first target memory space, the memory allocation module sends the first target memory space to the memory acquisition module. Correspondingly, the memory acquisition module receives the first target memory space.
[0202] The memory allocation module can allocate the first target memory space in the memory space of the electronic device, or can also allocate the first target memory space in the memory space already occupied by the user mode.
[0203] In the case where the memory allocation module allocates the first target memory space in the memory space already occupied by the user mode, the memory allocation module can allocate the memory space already used by the user mode process in the memory usage module.
[0204] The first target memory space can allow kernel mode code to access, or can also not allow kernel mode code to access. The embodiments of the present application do not make any limitation on this.
[0205] S506. The scan thread module creates a monitoring thread, and this monitoring thread is used to monitor whether the information of the first target memory space is rewritten.
[0206] When the first target memory space is free, the scanning thread module can also create a filling thread (such as fillMagic) that is used to write information into the first target memory space, and the monitoring thread monitors whether the information in the first target memory space is rewritten.
[0207] When the first target memory space is a memory space already occupied by the user state, there is already information stored in the first target memory space, and the monitoring thread monitors whether the information in the first target memory space is rewritten.
[0208] S507. When the information in the first target memory space is rewritten, the scanning thread module sends indication information to the output information module, and the indication information is used to instruct the output information module to output memory exception information. Correspondingly, the output information module receives the indication information.
[0209] S508. The output information module outputs memory exception information based on the indication information.
[0210] Exemplarily, the output information module can obtain and output memory exception information through a dump function. The output information module can save the exception information in the tombstone log for subsequent viewing.
[0211] The specific information included in the memory exception information can refer to the above method 400 and will not be elaborated here.
[0212] S509. The output information module sends the memory exception information to the positioning module.
[0213] S510. The positioning module locates the memory stepping problem based on the memory exception information.
[0214] The specific positioning method of the positioning module can refer to the description of the above method 400 and will not be elaborated here.
[0215] The memory stepping problem positioning method provided by the embodiments of the present application can locate the memory stepping problem according to the memory exception information, and has the ability to locate memory stepping faults, so as to facilitate developers to solve the memory stepping problem and improve the user experience.
[0216] The above method 400 and method 500 describe the memory stepping problem positioning method in the user state. Next, the memory stepping problem positioning method in the kernel state will be described in combination with method 600 and method 700.
[0217] Figure 6 It is a schematic flowchart of another memory stepping problem positioning method 600 provided by the embodiments of the present application. This method 600 can be applied to an electronic device, and the hardware structure diagram of the electronic device can be as Figure 1As shown, the software structure block diagram of the electronic device may be as Figure 2 shown, but the embodiments of the present application do not limit this.
[0218] As Figure 6 shown, the method 600 includes the following steps:
[0219] S601. When starting up, create a kernel thread for locating memory trampling problems.
[0220] When the electronic device starts up, it enters the kernel state, and the electronic device creates a kernel thread for locating memory trampling problems.
[0221] S602. Allocate a second target memory space through the kernel thread, and monitor whether the second target memory space is accessed by kernel state code. The second target memory space is only allowed to be used by user state processes.
[0222] The second target memory space is allowed to be used by user state processes and is not allowed to be accessed by kernel state code.
[0223] The second target memory space may be 1 gigabyte (GB), 2 GB, or 4 GB. The embodiments of the present application do not limit the size of the second target memory space. It should be understood that the size of the second target memory space may also be referred to as the length of the second target memory space, and the embodiments of the present application do not limit this.
[0224] The second target memory space may be 1, 2, or more than 2. The embodiments of the present application do not limit the number of the first target memory spaces. It should be understood that when the second target memory space is 1, the size of the first target memory space shall not exceed the total memory space of the electronic device; when the second target memory space is multiple, the sum of the first target memory spaces shall not exceed the total memory space of the electronic device.
[0225] The first target memory space may be the free memory space of the electronic device or the memory space being used by the user state.
[0226] Optionally, the above-mentioned first target memory space may include a static memory space and / or a dynamic memory space.
[0227] S603. In the case where the second target memory space is accessed by kernel state code, determine that the memory trampling problem is caused by the kernel state code accessing the user state process.
[0228] It should be understood that the second target memory space is not allowed to be accessed by kernel state code. In the case where the second target memory space is accessed by kernel state code, there is an abnormal phenomenon that the kernel state code accesses the second target memory space. It can be determined that the memory trampling problem is caused by the kernel state code accessing the user state process.
[0229] The memory trampling problem location method provided by the embodiments of the present application can directly determine that the memory trampling problem is caused by the kernel - mode code accessing the user - mode process by monitoring the memory trampling problem in the second target memory space. It has the ability to locate memory trampling faults, monitors memory trampling problems more comprehensively, so as to facilitate developers to solve memory trampling problems and improve the user experience.
[0230] Based on the software structure block diagram of the second memory trampling location module introduced above, Figure 7 it further shows Figure 2 a schematic flowchart of the memory trampling problem location method 700 based on
[0231] As Figure 7 shown, the method 700 may include the following steps:
[0232] S701. When starting up, the scan thread module creates a kernel thread for locating memory trampling problems.
[0233] Exemplarily, the kernel thread for locating memory trampling problems can be start kthread. The scan thread module starts to locate memory trampling problems through start kthread.
[0234] S702. The scan policy module determines the information of the second target memory space, and the information of the second target memory space includes the size of the second target memory space, the number of the second target memory spaces, and whether the second target memory space is static memory or dynamic memory.
[0235] The information of the second target memory space can refer to the information of the first target memory space in the above - mentioned method 400, which will not be elaborated here.
[0236] S703. The scan policy sends the information of the second target memory space to the memory acquisition module. Correspondingly, the memory acquisition module receives the information of the second target memory space.
[0237] S704. The memory acquisition module sends a request to allocate the second target memory space to the memory allocation module based on the information of the second target memory space. Correspondingly, the memory allocation module receives the request to allocate the second target memory space.
[0238] Exemplarily, the memory acquisition module can send a request to allocate the first target memory space to the memory allocation module based on the memory allocation function (allocMemory).
[0239] S705. The memory allocation module sends the second target memory space to the memory acquisition module based on the request for the second target memory space of this application. The second target memory space is only allowed to be used by user-mode processes. Correspondingly, the memory acquisition module receives the second target memory space.
[0240] The memory allocation module can allocate the second target memory space in the memory space of the electronic device space, or can also allocate the second target memory space in the memory space already occupied by the user mode.
[0241] In the case where the memory allocation module allocates the second target memory space in the memory space already occupied by the user mode, the memory allocation module can allocate the memory space already used by the user-mode process in the memory usage module.
[0242] S706. The scanning thread module creates a monitoring kernel thread, and this monitoring thread is used to monitor whether the second target memory space is accessed by kernel-mode code.
[0243] S707. In the case where the second target memory space is accessed by kernel-mode code, the scanning thread module sends information including that the second target memory space is accessed by kernel-mode code to the positioning module. Correspondingly, the positioning module receives the information including that the second target memory space is accessed by kernel-mode code.
[0244] S708. The positioning module determines the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing a user-mode process according to the information including that the second target memory space is accessed by kernel-mode code.
[0245] Optionally, in the case where the second target memory space is accessed by kernel-mode code, the scanning thread module can also instruct the output information module to output memory exception information, and this memory exception information is used to judge the accuracy of the memory stepping problem located by the positioning module.
[0246] The memory stepping problem positioning method provided by the embodiments of this application can determine that the memory stepping problem is a memory stepping problem caused by kernel-mode code accessing a user-mode process by monitoring the memory stepping problem of the second target memory space, has the ability to locate memory stepping faults, and more comprehensively monitors the memory stepping problem, so as to facilitate developers to solve the memory stepping problem and improve the user experience.
[0247] It should be understood that the above method 600 and method 700 both describe the memory stepping problem positioning method for the second target memory space in the kernel mode.
[0248] The electronic device can execute the above method 400 and method 600 through a variety of possible implementation manners.
[0249] In a possible implementation, the electronic device may execute the above method 400 or the above method 600, that is, the electronic device may locate the memory stepping problem only in the kernel state or only in the user state.
[0250] In another possible implementation, the electronic device may execute the above 600 before method 400. After method 600 is executed for a period of time, the thread executing method 600 is released, and method 400 is executed. The duration of this period may be preset. For example, it may be 30 minutes.
[0251] Exemplarily, before S401, allocating the first target memory space in the above method 400, the above method 400 further includes: determining whether there is a kernel thread for locating the memory stepping problem; and allocating the first target memory space when the kernel thread does not exist.
[0252] Specifically, the kernel thread for locating the memory stepping problem is deployed in the kernel state and can locate the memory stepping problem in the kernel state. The above S401 to S404 are deployed in the user state and can locate the memory stepping problem in the user state. The electronic device needs to first determine whether there is a kernel thread for locating the memory stepping problem. When the kernel thread for locating the memory stepping problem does not exist, the electronic device may execute the above method 400. When the kernel thread for locating the memory stepping problem exists, the electronic device enters a waiting state and monitors in real time. When it is detected that the kernel thread for locating the memory stepping problem does not exist, the electronic device may start to execute the above method 400.
[0253] Optionally, the electronic device may execute the above 600 before method 400. When the electronic device enters the user state, the thread executing method 600 is released, and method 400 is executed.
[0254] In this implementation, the electronic device does not simultaneously execute the memory stepping problem location method in the user state or the kernel state, which is beneficial to reducing the power loss of the electronic device and improving the performance of the electronic device.
[0255] In yet another possible implementation, the electronic device may execute the above 600 before method 400. After method 400 is executed for a period of time, method 400 is executed. At this time, method 600 and method 400 are executed simultaneously.
[0256] The electronic device is in the kernel state when starting up and can execute method 600. After a period of time, the electronic device enters a state where the user state and the kernel state coexist and can execute method 600 and method 400.
[0257] In this implementation manner, the method for locating memory trampling problems is executed in the user mode and the kernel mode respectively, which can monitor memory trampling problems in the user mode and the kernel mode, is beneficial to monitoring more memory trampling problems, and improves the efficiency of locating memory trampling problems.
[0258] Optionally, when the electronic device executes method 400, the electronic device may first determine whether the total memory space of the electronic device is greater than or equal to a preset threshold before executing method 400, and execute method 400 when the total memory space of the electronic device is greater than or equal to the preset threshold. For example, the preset threshold may be 8G.
[0259] Optionally, before the above-mentioned electronic device executes method 600, it may first determine whether the total memory space of the electronic device is greater than or equal to a preset threshold, and when the total memory space of the electronic device is greater than or equal to the preset threshold, the electronic device executes method 600. For example, the preset threshold may be 8G.
[0260] Exemplarily, Figure 8 shows a schematic flowchart of another method 800 for locating memory trampling problems. As Figure 8 shown, this method 800 can be applied to an electronic device. The hardware structure diagram of the electronic device can be as Figure 1 shown, and the software structure block diagram of the electronic device can be as Figure 2 shown, but the embodiments of the present application do not limit this.
[0261] As Figure 8 shown, this method 800 may include the following steps:
[0262] S801. Perform initialization during startup.
[0263] When the electronic device starts up, it first starts the kernel and can first initialize the kernel. For example, the electronic device can initialize the kernel through the kernel initialization function (kernel init).
[0264] S802. Determine whether the total memory space of the electronic device is greater than or equal to a preset threshold.
[0265] S803. When the total memory space of the electronic device is greater than or equal to the preset threshold, create a kernel thread for locating memory trampling problems.
[0266] S804. Allocate a second target memory space through the kernel thread, and monitor whether the second target memory space is accessed by kernel-mode code. The second target memory space is only allowed to be used by user-mode processes.
[0267] S805. When the second target memory space is accessed by kernel-mode code, determine the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing a user-mode process.
[0268] It should be understood that when the total number of memory spaces of the electronic device is less than the preset threshold, the electronic device will not locate the memory stepping problem.
[0269] The method for locating the memory stepping problem provided by the embodiments of the present application first determines whether the total number of memory spaces is greater than or equal to the preset threshold before locating the memory stepping problem. When the total number of memory spaces of the electronic device is greater than or equal to the preset threshold, the memory stepping problem is located. While the electronic device is locating the memory stepping problem, it is beneficial to ensure the normal use of other functions of the electronic device and improve the performance of the electronic device.
[0270] The magnitudes of the sequence numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0271] In the above text, in combination with Figures 1 to 8 , the method for running an application provided by the embodiments of the present application is described in detail. Next, in combination with Figure 9 and Figure 10 , the electronic device provided by the embodiments of the present application will be described in detail.
[0272] Figure 9 FIG. 900 shows an electronic device 900 provided by an embodiment of the present application. The electronic device 900 includes a processing module 910 and an acquisition module 920. Among them, the processing module 910 is used to: allocate a first target memory space; and monitor whether the information in the first target memory space is rewritten; the acquisition module 920 is used to: when the information in the first target memory space is rewritten, acquire memory exception information, and the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information; the processing module is used to: locate the memory stepping problem according to the memory exception information.
[0273] Optionally, the above processing module 910 is further used to: determine whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; when the size of the memory area corresponding to the rewritten information is greater than the first threshold, determine the memory stepping problem as a memory stepping problem caused by kernel-mode code.
[0274] Optionally, the above processing module 910 is further configured to: determine whether the number of occurrences of the physical address corresponding to the rewritten information exceeds a second threshold; in the case where the number of occurrences of the physical address corresponding to the rewritten information exceeds the second threshold, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the input / output memory management unit (IOMMU) or direct memory access (DMA) in the kernel.
[0275] Optionally, the above processing module 910 is further configured to: in the case where the number of occurrences of the physical address corresponding to the rewritten information exceeds the second threshold, set the physical address corresponding to the rewritten information to be not accessible by the IOMMU; determine whether the physical address corresponding to the rewritten information is accessed by the IOMMU; in the case where the physical address corresponding to the rewritten information is accessed by the IOMMU, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the IOMMU.
[0276] Optionally, the above processing module 910 is further configured to: in the case where the physical address corresponding to the rewritten information is not accessed by the IOMMU, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the DMA.
[0277] Optionally, the above processing module 910 is further configured to: in the case where the size of the memory area corresponding to the rewritten information is less than or equal to a first threshold, determine the memory stepping problem as a memory stepping problem caused by double data rate synchronous dynamic random access memory (DDR).
[0278] Optionally, the above processing module 910 is further configured to: output the rewritten information and / or the kernel page table status corresponding to the rewritten information.
[0279] Optionally, the above processing module 910 is further configured to: determine whether there is a kernel thread for locating the memory stepping problem; in the case where the kernel thread does not exist, allocate a first target memory space.
[0280] Optionally, the above first target memory space includes a static memory space or a dynamic memory space.
[0281] Optionally, the above processing module 910 is further configured to: at startup, create a kernel thread for locating the memory stepping problem; allocate a second target memory space through the kernel thread, and monitor whether the second target memory space is accessed by the kernel-mode code, and the second target memory space is only allowed to be used by user-mode processes; in the case where the second target memory space is accessed by the kernel-mode code, determine the memory stepping problem as a memory stepping problem caused by the kernel-mode code accessing the user-mode process.
[0282] It should be understood that the electronic device 900 here is embodied in the form of functional modules. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor or a group of processors, etc.) for executing one or more software or firmware programs, and a memory, combining logic circuits and / or other suitable components supporting the described functions. In an alternative example, those skilled in the art can understand that the electronic device 900 can specifically be the electronic device in the above method embodiment, or the functions of the electronic device in the above method embodiment can be integrated in the electronic device 900. The electronic device 900 can be used to execute each process and / or step corresponding to the electronic device in the above method embodiment. To avoid repetition, it will not be elaborated here.
[0283] The above electronic device 900 has the function of implementing the corresponding steps executed by the electronic device in the above method embodiment; the above function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0284] In the embodiments of the present application, Figure 9 the electronic device 900 in can also be a chip or a chip system, for example: a system on chip (SoC).
[0285] Figure 10 is a schematic block diagram of another electronic device 1000 provided by the embodiments of the present application. The electronic device 1000 includes a processor 1010, a communication interface 1020 and a memory 1030. Among them, the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through an internal connection path. The memory 1030 is used to store instructions, and the processor 1020 is used to execute the instructions stored in the memory 1030 to control the communication interface 1020 to send signals and / or receive signals.
[0286] It should be understood that the electronic device 1000 may specifically be the electronic device in the above method embodiments, or the functions of the electronic device in the above method embodiments may be integrated in the electronic device 1000, and the electronic device 1000 may be used to execute the respective steps and / or processes corresponding to the electronic device in the above method embodiments. Optionally, the memory 1030 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may further include a non-volatile random access memory. For example, the memory may further store information about the device type. The processor 1010 may be used to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may execute the respective steps and / or processes corresponding to the electronic device in the above method embodiments.
[0287] It should be understood that in the embodiments of the present application, the processor 1010 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0288] In the implementation process, the respective steps of the above method may be completed by the integrated logic circuit in the hardware of the processor or the instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by the hardware processor, or executed and completed by a combination of the hardware and software modules in the processor. The software module may be located in a mature storage medium in the art such as a random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor executes the instructions in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0289] The present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to implement the method corresponding to the electronic device in the above method embodiments.
[0290] The present application further provides a chip system, which is used to support the electronic device in the above method embodiments to implement the functions shown in the embodiments of the present application.
[0291] The present application further provides a computer program product, which includes a computer program (which may also be referred to as code or instructions), and when the computer program runs on a computer, the computer may execute the method corresponding to the electronic device shown in the above method embodiments.
[0292] Those of ordinary skill in the art will realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0293] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0294] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or modules can be in electrical, mechanical, or other forms.
[0295] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they can be located in one place, or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0296] In addition, the functional modules in each embodiment of this application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
[0297] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0298] The above is only the specific implementation manner of this application, but the protection scope of the embodiments of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the embodiments of this application can easily think of changes or substitutions, which should all be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be subject to the protection scope of the claims.
Claims
1. A method for locating a memory problem, characterized in that: including: allocating a first target memory space; monitoring whether the information in the first target memory space is rewritten; when the information in the first target memory space is rewritten, obtaining memory exception information, where the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information; judging whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; when the size of the memory area corresponding to the rewritten information is greater than the first threshold, determining the memory stepping problem as a memory stepping problem caused by kernel-mode code.
2. The method according to claim 1, wherein After determining that the memory stepping problem is caused by kernel-mode code, the method further includes: judging whether the occurrence times of the physical address corresponding to the rewritten information exceed a second threshold; when the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, determining the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the input / output memory management unit (IOMMU) or direct memory access (DMA) in the kernel.
3. The method according to claim 2, characterized in that The method further includes: when the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, setting the physical address corresponding to the rewritten information as not allowing IOMMU access; judging whether the physical address corresponding to the rewritten information is accessed by the IOMMU; when the physical address corresponding to the rewritten information is accessed by the IOMMU, determining the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the IOMMU.
4. The method according to claim 3, wherein The method further includes: when the physical address corresponding to the rewritten information is not accessed by the IOMMU, determining the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the DMA.
5. The method according to any one of claims 1 to 4, characterized in that The method further includes: when the size of the memory area corresponding to the rewritten information is less than or equal to the first threshold, determining the memory stepping problem as a memory stepping problem caused by double data rate synchronous dynamic random access memory (DDR).
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: outputting the rewritten information and / or the kernel page table status corresponding to the rewritten information.
7. The method according to any one of claims 1 to 6, characterized in that, Before allocating the first target memory space, the method further includes: judging whether there is a kernel thread for locating the memory stepping problem; when the kernel thread does not exist, allocating the first target memory space.
8. The method according to any one of claims 1 to 7, characterized in that, The first target memory space includes a static memory space or a dynamic memory space.
9. The method according to any one of claims 1 to 8, characterized in that Before allocating the first target memory space, the method further includes: at boot time, creating a kernel thread for locating the memory stepping problem; allocating a second target memory space through the kernel thread and monitoring whether the second target memory space is accessed by kernel-mode code, where the second target memory space is only allowed to be used by user-mode processes; when the second target memory space is accessed by kernel-mode code, determining the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing user-mode processes.
10. An electronic device, characterized in that, including: A processing module, configured to allocate a first target memory space; and monitor whether the information in the first target memory space is rewritten; An acquisition module, configured to acquire memory exception information when the information in the first target memory space is rewritten, where the memory exception information includes the memory area corresponding to the rewritten information and / or the physical address corresponding to the rewritten information; The processing module is further configured to: locate the memory stepping problem according to the memory exception information; The processing module is further configured to: judge whether the size of the memory area corresponding to the rewritten information exceeds a first threshold; When the size of the memory area corresponding to the rewritten information is greater than the first threshold, determine the memory stepping problem as a memory stepping problem caused by kernel-mode code.
11. The electronic device according to claim 10, wherein The processing module is further configured to: judge whether the occurrence times of the physical address corresponding to the rewritten information exceed a second threshold; When the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the input / output memory management unit (IOMMU) or direct memory access (DMA) in the kernel.
12. The electronic device according to claim 11, wherein The processing module is further configured to: When the occurrence times of the physical address corresponding to the rewritten information exceed the second threshold, set the physical address corresponding to the rewritten information to be not allowed to be accessed by the IOMMU; judge whether the physical address corresponding to the rewritten information is accessed by the IOMMU; When the physical address corresponding to the rewritten information is accessed by the IOMMU, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the IOMMU.
13. The electronic device according to claim 12, wherein The processing module is further configured to: When the physical address corresponding to the rewritten information is not accessed by the IOMMU, determine the memory stepping problem caused by the kernel-mode code as a memory stepping problem caused by the access of the DMA.
14. The electronic device according to any one of claims 10 to 13, characterized in that, The processing module is further configured to: When the size of the memory area corresponding to the rewritten information is less than or equal to the first threshold, determine the memory stepping problem as a memory stepping problem caused by double data rate synchronous dynamic random access memory (DDR).
15. The electronic device according to any one of claims 10 to 14, characterized in that, The processing module is further configured to: output the rewritten information and / or the kernel page table status corresponding to the rewritten information.
16. The electronic device according to any one of claims 10 to 15, characterized in that, The processing module is further configured to: judge whether there is a kernel thread for locating the memory stepping problem; When the kernel thread does not exist, allocate the first target memory space.
17. The electronic device according to any one of claims 10 to 16, characterized in that, The first target memory space includes a static memory space or a dynamic memory space.
18. The electronic device according to any one of claims 10 to 17, characterized in that, The processing module is further configured to: at startup, create a kernel thread for locating the memory stepping problem; allocate a second target memory space through the kernel thread, and monitor whether the second target memory space is accessed by kernel-mode code, where the second target memory space is only allowed to be used by user-mode processes; When the second target memory space is accessed by kernel-mode code, determine the memory stepping problem as a memory stepping problem caused by kernel-mode code accessing user-mode processes.
19. An electronic device, characterized in that, including: A processor, the processor being coupled to a memory for storing a computer program, which when called by the processor causes the processor to execute the method according to any one of claims 1 to 9.
20. A chip system, characterized in that, Comprising: a processor for calling and running a computer program from a memory, so that a device equipped with the chip system implements the method according to any one of claims 1 to 9.
21. A computer-readable storage medium, characterized in that, For storing a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 9.
22. A computer program product, characterized in that, The computer program product includes computer program code, which when run on a computer causes the computer to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Memory rewriting positioning method and device
CN110764914A