GBase 8s database border-crossing positioning method and GBase 8s database border-crossing positioning system
By applying for and protecting the memory space in the GBase8s database and mapping it to the shadow memory space, using the ASAN memory error checker to detect the out-of-bounds problem, the problem of over-bounds positioning in the database is solved, and the stability and reliability of the database are improved.
Patent Information
- Application Number
- CN202510512121.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-23
AI Technical Summary
The existing technology is difficult to effectively locate the out-of-bounds problem in the GBase8s database. The ASAN memory error checker does not match the GBase8s database and cannot directly introduce ASAN for out-of-bounds positioning.
By applying for allocable memory space and target memory space in the GBase8s database and protecting it, the data memory segment is accessible, while other memory segments are inaccessible. Then, map the shared memory space to the shadow memory space, and use the ASAN memory error checker to detect out-of-bounds problems.
It realizes the collaboration between the ASAN memory error checker and the GBase8s database, effectively locate and solve problems beyond boundaries, and improves the stability and reliability of the database.
Smart Images

Figure CN120029859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of databases, and in particular to a GBase8s database cross-border positioning method and system. Background Art
[0002] During the operation of the database, memory errors are a common and thorny problem, among which out-of-bounds problems are particularly prominent. When processing large amounts of data and complex business logic, traditional database systems are prone to out-of-bounds memory access due to improper memory management, pointer operation errors, and other reasons. This type of memory error not only leads to serious consequences such as data loss and system crashes, but also because of its randomness and hidden nature, it is often difficult to quickly and accurately locate the root cause of the problem. Some existing debugging methods and tools have limited effects when facing complex database memory errors, and cannot effectively help developers and operation and maintenance personnel to promptly discover and solve out-of-bounds problems, which poses a huge challenge to the stable operation and maintenance of database systems.
[0003] In order to solve the problem of database out-of-bounds location, the related technology proposed ASAN (AddressSanitizer) memory error checker. However, when introducing ASAN memory error checker into GBase8s database system, it faced the problem of model mismatch, which made it impossible to directly introduce ASAN memory error checker, that is, it was impossible to use ASAN memory error checker to locate out-of-bounds problems for GBase8s database system. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a GBase8s database out-of-bounds location method and system, which can solve the problem of mismatch between the ASAN memory error checker and the GBase8s database, realize the collaborative work between the two, and then use the ASAN memory error checker to effectively locate the out-of-bounds of the GBase8s database, thereby improving the stability and reliability of the GBase8s database.
[0005] In a first aspect, the present invention provides a GBase8s database cross-border positioning method, the method is applied to a GBase8s database, and the method comprises: Apply for allocatable memory space from the segment memory space of the GBase8s database, and apply for target memory space for the specified program from the allocatable memory space; The allocatable memory space and / or the target memory space are used as the memory space to be checked, and protection processing is performed on the memory space to be checked, so that the data memory segment in the memory space to be checked is in an accessible state, and other memory segments except the data memory segment are in an inaccessible state; The shared memory space of the GBase8s database is mapped to the shadow memory space corresponding to the memory space to be checked, and the shadow memory space represents the accessible status of each memory address in the memory space to be checked by marking; If an access request for a data memory segment in the memory space to be checked is received, the ASAN memory error checker is used to detect whether the access request has an out-of-bounds problem based on the shared memory space to obtain an out-of-bounds detection result.
[0006] In one embodiment, a pool memory allocator is configured in the GBase8s database; Apply for allocatable memory space from the segment memory space of the GBase8s database, including: Receive memory application requests sent by the specified program through the pool memory allocator, and apply for allocatable memory space from the segment memory space of the GBase8s database; Protect the memory space to be checked, including: The following operations are performed through the pool memory allocator: filling operations are performed on each memory segment in the allocatable memory space, so that each memory segment in the allocatable memory space is inaccessible; recovery operations are performed on the data memory segments in the allocatable memory space, so that the data memory segments in the allocatable memory space are accessible.
[0007] In one embodiment, a heap memory allocator is configured in the GBase8s database; Apply for target memory space for the specified program from the allocatable memory space, including: The target memory space is applied for the specified program from the allocatable memory space through the heap memory allocator. The size of the data memory segment in the target memory space is consistent with the memory size carried in the memory application request. Protect the memory space to be checked, including: The following operations are performed through the heap memory allocator: filling operations are performed on each memory segment in the target memory space, so that each memory segment in the target memory space is inaccessible; the actual memory size to be allocated is determined according to the memory size carried in the memory application request, and the actual memory size to be allocated includes the size of the data memory segment and the size of the protection memory segment; according to the size of the data memory segment and the size of the protection memory segment, the data memory segment and the protection memory segment are divided from the target memory space; and a recovery operation is performed on the data memory segment in the target memory space, so that the data memory segment in the target memory space is accessible.
[0008] In one implementation, mapping the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked includes: Determine the starting memory address of the shared memory space from the high memory space of the ASAN memory error checker, and determine the memory size of the shared memory space; Based on the starting memory address and memory size of the shared memory space, create the shared memory space in the high memory space; For any memory address in the shared memory space, a memory address that has a mapping relationship with the memory address is determined from the shadow memory space corresponding to the memory space to be checked, so as to determine an address mapping table between the shared memory space and the shadow memory space.
[0009] In one implementation, a memory address in a shared memory space is recorded as a shared memory address, and a memory address in a shadow memory space is recorded as a shadow memory address; an ASAN memory error checker is used to detect whether an access request has an out-of-bounds problem based on the shared memory space, and an out-of-bounds detection result is obtained, including: For any memory address to be accessed within the memory range to be accessed carried by the access request, perform the following operations: Through the ASAN memory error checker, the target shared memory address corresponding to the memory address to be accessed is accessed based on the address mapping table, and multiple target shadow memory addresses that have a mapping relationship with the target shared memory address are determined based on the address mapping table. According to the mark of the target shadow memory address, it is detected whether the memory address to be accessed has an out-of-bounds problem.
[0010] In one implementation, the allocatable memory space includes a plurality of allocatable sub-memory spaces, each of which is divided into a block header memory segment, a data memory segment, and an align padding memory segment; detecting whether the memory address to be accessed has an out-of-bounds problem according to a mark of a target shadow memory address includes: If, according to the mark of the target shadow memory address, it is determined that the block header memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem; If, based on the mark of the target shadow memory address, it is determined that the Align Padding memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, or the Blockheader memory segment in the next adjacent allocatable sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem.
[0011] In one implementation, the target memory space includes multiple target sub-memory spaces, the head target sub-memory space includes a heap memory segment, a data memory segment, an Align Padding memory segment, and a protection memory segment, and the other target sub-memory spaces include a data memory segment, an Align Padding memory segment, and a protection memory segment; detecting whether the memory address to be accessed has an out-of-bounds problem according to a mark of the target shadow memory address, further comprising: If, according to the mark of the target shadow memory address, it is determined that the heap memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, or the protection memory segment in the adjacent previous target sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem; If it is determined that the Align Padding memory segment or the protection memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed according to the mark of the target shadow memory address, it is determined that the memory address to be accessed has an out-of-bounds problem.
[0012] In a second aspect, the present invention further provides a GBase8s database cross-border positioning system, the system is applied to a GBase8s database, and the system includes: The memory application module is used to apply for allocatable memory space from the segment memory space of the GBase8s database, and to apply for target memory space for a specified program from the allocatable memory space; a memory processing module, used for taking the allocatable memory space and / or the target memory space as the memory space to be checked, and performing protection processing on the memory space to be checked, so that the data memory segments in the memory space to be checked are in an accessible state, and the memory segments other than the data memory segments are in an inaccessible state; A memory mapping module is used to map the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked, and the shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking; The cross-bounds positioning module is used to detect whether there is a cross-bounds problem in the access request based on the shared memory space through the ASAN memory error checker if an access request for the data memory segment in the memory space to be checked is received, and obtain the cross-bounds detection result.
[0013] In a third aspect, the present invention further provides a server, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement any one of the methods provided in the first aspect.
[0014] In a fourth aspect, the present invention further provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the methods provided in the first aspect.
[0015] The present invention provides a GBase8s database cross-boundary positioning method and system. First, apply for allocatable memory space from the segment memory space of the GBase8s database, and apply for target memory space for a specified program from the allocatable memory space; then, use the allocatable memory space and / or the target memory space as the memory space to be checked, and perform protection processing on the memory space to be checked, so that the data memory segment in the memory space to be checked is in an accessible state, and other memory segments except the data memory segment are inaccessible; then, map the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked, and the shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking; finally, if an access request for the data memory segment in the memory space to be checked is received, the ASAN memory error checker is used to detect whether the access request has an cross-boundary problem based on the shared memory space to obtain an cross-boundary detection result. The above method adjusts and optimizes the memory allocator of the GBase8s database, so that after applying for the allocable memory space and the target memory space, the allocable memory space and / or the target memory space are protected, so that the data memory segments therein are in an accessible state and other data memory segments are inaccessible. On this basis, the shared memory space is mapped to its corresponding shadow memory space, so that the ASAN memory error checker detects whether there is an out-of-bounds problem in the access request by accessing the shared memory space. The present invention can solve the problem of mismatch between the ASAN memory error checker and the GBase8s database, realize the collaborative work between the two, and then use the ASAN memory error checker to effectively locate the out-of-bounds of the GBase8s database, thereby improving the stability and reliability of the GBase8s database.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a GBase8s database cross-border positioning method provided by an embodiment of the present invention; Figure 2 A schematic diagram of an allocatable memory space provided by an embodiment of the present invention; Figure 3 A schematic diagram of a target memory space provided by an embodiment of the present invention; Figure 4 A schematic diagram of mapping a shared memory space of a GBase8s database to a shadow memory space provided by an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a GBase8s database cross-border positioning system provided by an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] At present, when introducing the ASAN memory error checker into the GBase8s database system, there is a problem of model mismatch. Specifically, the GBase8s database is a database management system designed based on the process + shared memory model, and its memory management, program execution process, and interaction with hardware have unique settings. As a general memory error detection tool, the ASAN memory error checker has a powerful ability to detect memory out-of-bounds problems, but its original design is to map the entire shadow memory space during initialization. Since the shadow memory space belongs to private memory, it is only valid in the process space. Therefore, when the shadow memory is on the private memory, the shadow memory content seen by different processes in the database is inconsistent. At the same time, when the ASAN memory error checker debugs heap memory problems, it needs to replace the malloc / free memory allocator, but the GBase8s database has its own memory manager, which also makes it impossible to directly introduce the ASAN memory error checker.
[0022] Based on this, the present invention provides a GBase8s database out-of-bounds location method and system, which can solve the problem of mismatch between the ASAN memory error checker and the GBase8s database, realize the collaborative work between the two, and then use the ASAN memory error checker to effectively locate the out-of-bounds of the GBase8s database, thereby improving the stability and reliability of the GBase8s database.
[0023] To facilitate understanding of this embodiment, firstly, a GBase8s database cross-border positioning method disclosed in an embodiment of the present invention is described in detail. The method is applied to the GBase8s database, see Figure 1 The flowchart of a GBase8s database cross-border positioning method shown in FIG. 1 mainly includes the following steps S102 to S108: Step S102, applying for allocatable memory space from the segment memory space of the GBase8s database, and applying for target memory space for a designated program from the allocatable memory space.
[0024] Among them, GBase8s database is configured with pool memory allocator and heap memory allocator. Pool memory allocator is used to apply for allocatable memory space (also called pool memory space) from segment memory space, and heap memory allocator is used to continue to apply for target memory space from allocatable memory space applied by pool memory allocator and return it to program for use. This process is a top-down logic.
[0025] In one example, when the memory space in the free list of the Pool memory allocator is insufficient, it will request memory space from the segment memory manager (this memory space is the allocatable memory space), and the segment memory manager can allocate the corresponding allocatable memory space according to the memory request; when memory needs to be allocated for a specified program, the heap memory allocator requests the pool memory allocator to allocate memory space (this memory space is the target memory space), and allocates the requested memory space to the program for use.
[0026] Step S104, taking the allocatable memory space and / or the target memory space as the memory space to be checked, and performing protection processing on the memory space to be checked, so that the data memory segments in the memory space to be checked are accessible, and other memory segments except the data memory segments are inaccessible.
[0027] In one example, for the allocatable memory space, the pool memory allocator can be used to fill all memory segments in the allocatable memory space, and then the data memory segments therein can be restored, so that the data memory segments in the allocatable memory space can be made accessible, and the memory segments other than the data memory segments can be made inaccessible.
[0028] In one example, for the target memory space, all memory segments in the target memory space can be filled through the heap memory allocator, and then a data memory segment with a protection zone is allocated from the target memory space, and then a recovery operation is performed on the data memory segment, so that the data memory segment in the target memory space can be made accessible, and other memory segments except the data memory segment can be made inaccessible.
[0029] The embodiment of the present invention adjusts and optimizes the pool memory allocator and the heap memory allocator, so that the subsequent ASAN memory error checker can realize the cross-boundary positioning of the GBase8s database without using the malloc / free memory allocator.
[0030] Step S106, mapping the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked.
[0031] The shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking, for example, "0" represents that the memory address is in an accessible state (that is, the memory address is located in the data memory segment), and "-1" represents that the memory address is inaccessible (that is, the memory address is located outside the data memory segment). In one example, a shared memory space can be allocated from the high memory area of the ASAN memory error checker, and the shared memory space can be mapped to the shadow memory space according to a predefined ratio to obtain an address mapping table between the shared memory space and the shadow memory space, and the address mapping table can describe the mapping relationship between the memory addresses in the shared memory space and the memory addresses of the shadow memory space.
[0032] Step S108, if an access request for a data memory segment in the memory space to be checked is received, the ASAN memory error checker is used to detect whether the access request has an out-of-bounds problem based on the shared memory space to obtain an out-of-bounds detection result.
[0033] Among them, the out-of-bounds detection result is used to describe whether there is an out-of-bounds problem in the access request, and in the case that the access request has an out-of-bounds problem, locate the access request as a forward out-of-bounds or backward out-of-bounds. In one embodiment, the ASAN memory error checker accesses the corresponding shared memory address in the shared memory space based on the memory interval to be accessed carried by the access request, and determines the shadow memory address that has a mapping relationship with the memory address according to the aforementioned address mapping table, and detects whether there is an out-of-bounds in the memory interval to be accessed based on the mark of the shadow memory address. Compared with the existing ASAN memory error checker that directly uses shadow memory to locate out-of-bounds and has the problem of inconsistent shadow memory content seen by different processes in the database, the embodiment of the present invention puts the Shadow memory on the shared memory, so that the shadow memory content accessed by all processes of the database is consistent, thereby significantly improving the above problem.
[0034] The GBase8s database out-of-bounds location method provided in an embodiment of the present invention adjusts and optimizes the memory allocator of the GBase8s database so that after applying for the allocable memory space and the target memory space, the allocable memory space and / or the target memory space are protected so that the data memory segments therein are in an accessible state and other data memory segments are inaccessible. On this basis, the shared memory space is mapped to its corresponding shadow memory space, so that the ASAN memory error checker detects whether there is an out-of-bounds problem in the access request by accessing the shared memory space. The present invention can solve the problem of mismatch between the ASAN memory error checker and the GBase8s database, realize the collaborative work between the two, and then use the ASAN memory error checker to effectively locate the out-of-bounds of the GBase8s database, thereby improving the stability and reliability of the GBase8s database.
[0035] For ease of understanding, an embodiment of the present invention provides a specific implementation of a GBase8s database out-of-bounds positioning method.
[0036] The embodiment of the present invention adjusts and optimizes the memory management module of the GBase8s database so that it can work better with the ASAN memory error checker. This includes redesigning the strategy of memory allocation and release to ensure that the ASAN memory error checker can accurately monitor the memory operation of the GBase8s database system.
[0037] Specifically, the embodiment of the present invention implements the detection of heap memory by modifying the pool memory allocator and the heap memory allocator.
[0038] (I) Pool memory allocator: When the free list memory of the Pool memory allocator does not have enough memory space and requests a large block of memory (that is, allocates memory space) from the segment memory manager, the pool memory allocator performs the following operations: (1.1) Memory application: Apply for allocatable memory space from the segment memory space of the GBase8s database.
[0039] In one implementation, the pool memory allocator applies for allocatable memory space from the segment memory space of the GBase8s database, cuts it into multiple small memory spaces and provides them to the heap memory allocator. The memory space not provided to the heap memory allocator is stored in a free list.
[0040] (1.2) Poison processing: Fill each memory segment in the allocatable memory space, making each memory segment in the allocatable memory space inaccessible.
[0041] In the specific implementation, before returning the address of the allocatable memory space to the program, the GBase8s database will poison (fill) the content of the allocatable memory space. The specific poison content is f7 (in the computer field, f7 usually means "Poisoned by user", that is, the area marked as damaged or protected by the user), so as to mark the allocatable memory space as a special protection area to prevent unauthorized access and data tampering.
[0042] (1.3) Unpoison operation: Perform recovery operations on the data memory segments in the allocatable memory space, making the data memory segments in the allocatable memory space accessible.
[0043] In one embodiment, see Figure 2 The schematic diagram of an allocatable memory space shown in FIG. 4 includes multiple allocatable sub-memory spaces, each of which is divided into a Block header memory segment, a Data area (i.e., a data memory segment), and an Align Padding memory segment. The gray-filled area indicates that the shadow memory space (including the Block header memory segment and the Align Padding memory segment) is poisoned and inaccessible; the unfilled area indicates that the shadow memory space (including the Data area) is not poisoned and is accessible.
[0044] In the specific implementation, before returning the address of the allocatable memory space through the mt_malloc function (a memory allocation function used in a multi-threaded environment), the Unpoison operation is performed on the Data area (i.e., the data memory segment) in the allocatable memory space, that is, the memory content of the Data area is restored to a normal state. The size of the unpoison operation is the requested memory size (i.e., the size parameter), which ensures that the Data area can store and use data normally in the subsequent program running.
[0045] Furthermore, although the Data area is unpoisoned, the Block header memory segment still retains the poisoned state of f7. The Block header memory segment acts as a protection zone, which is used to identify the boundaries and status information of the entire memory block, preventing illegal access and tampering to the Block header area, thereby further enhancing the security of the memory.
[0046] (II) Heap memory allocator: The heap memory manager is responsible for allocating and managing heap memory. Since the memory allocated by the heap memory manager is stored continuously (there will be a padding area when the size is not aligned), there are certain security risks. Therefore, in order to protect the heap memory, an 8-byte protection area needs to be added. The heap memory allocator will perform the following operations: (2.1) Obtaining a large block of memory (i.e., target memory space) from the pool memory manager: Requesting a target memory space for a specified program from the allocatable memory space, the size of the data memory segment in the target memory space being consistent with the memory size carried in the memory request. In one embodiment, when memory allocation is required, the heap memory manager first obtains a large block of memory (i.e., target memory space) from the pool memory manager, which is the basic resource subsequently allocated to each program or process.
[0047] (2.2) Perform poisoning on a large block of memory (i.e., the target memory space): Perform fill operations on each memory segment in the target memory space, making each memory segment in the target memory space inaccessible. In one example, after obtaining a large block of memory (i.e., the target memory space), the heap memory manager will perform poisoning (filling) operations on the entire large block of memory (i.e., the target memory space). The poisoning operation here is to set the memory content to a specific value, such as f7. This specific value is used to mark the memory area as a special state, indicating that it may contain sensitive information or require special protection to prevent unauthorized access and data tampering.
[0048] (2.3) Calculate the actual memory size to be allocated: Determine the actual memory size to be allocated based on the memory size carried in the memory application request. The actual memory size to be allocated includes the size of the data memory segment and the size of the protection memory segment. In one example, when the chkralloc function is called to allocate memory, it will first calculate based on the memory size carried in the memory application request (that is, the size parameter). The calculation method is to use ALIGN(size, 8) + 8, where ALIGN(size, 8) means to align the size parameter upward to a multiple of 8. The total size calculated in this way is the actual memory size to be allocated, including the size of the s data memory segment requested by the user and the size of the additional protection memory segment.
[0049] (2.4) Allocating memory with protection zone: According to the size of the data memory segment and the size of the protection memory segment, the target memory space is divided into data memory segments and protection memory segments. In one example, according to the calculated size of the data memory segment and the size of the protection memory segment, the corresponding memory space is allocated from the heap memory manager, and the memory space includes the data memory segment required by the user and the additional protection memory segment.
[0050] Specifically, at the end of the data memory segment, there is an additional 8 bytes of space, which is used as the protection memory segment. The memory content of the protection memory segment is reserved as f7 and is set to an inaccessible state. This can prevent programs from accidentally accessing or maliciously tampering with the data in the protection zone, ensuring the security and stability of the memory.
[0051] (2.5) Perform unpoison operation on the Data area: Perform recovery operation on the data memory segment in the target memory space, so that the data memory segment in the target memory space is accessible. In one example, after the allocation is completed, the unpoison operation is performed on the returned data memory segment. The size of the unpoison operation is the original size parameter requested by the user. Through this operation, the memory content of the data memory segment is restored to a normal readable and writable state, so that the user program can use this part of the memory normally to store and process data.
[0052] In one embodiment, see Figure 3 The schematic diagram of a target memory space shown in the figure, the target memory space includes multiple target sub-memory spaces, the head target sub-memory space includes the heap memory segment, the data memory segment (also known as the Data area), the Align Padding memory segment and the protection memory segment (Protect bytes (8 bytes)), and the other target sub-memory spaces include the data memory segment (also known as the Data area), the Align Padding memory segment and the protection memory segment (Protect bytes (8 bytes)). The gray-filled area indicates that the part of the shadow memory space (including the heap memory segment, the Align Padding memory segment and the protection memory segment) is poisoned and inaccessible; the unfilled area indicates that the part of the shadow memory space (including the Data area) is not poisoned and is accessible.
[0053] Compared with the existing ASAN memory error checker that directly uses shadow memory to locate out-of-bounds, resulting in problems such as inconsistent shadow memory contents seen by different processes in the database, the embodiment of the present invention uses the ASAN memory error checker to locate out-of-bounds based on shared memory space, so that the shadow memory contents accessed by all processes of the database are consistent, thereby significantly improving the above problems.
[0054] Furthermore, the embodiment of the present invention supports the user thread scheduling mechanism of the GBase8s database by mapping the shared memory space to the Shadow memory space, so that the content of the Shadow memory space seen by each user thread on each vp (virtual server) is consistent. Figure 4 The diagram shown is a schematic diagram of mapping the shared memory space of the GBase8s database to the shadow memory space. The mapping process is as follows: Step 1: Determine the starting memory address of the shared memory space from the high memory space of the ASAN memory error checker, and determine the memory size of the shared memory space. The principle of ASAN supports shadow mapping of high and low memory areas, but due to the difference in memory size that can be allocated to high and low memory areas in different system architectures, and the size of the shared memory space required by the database, the embodiment of the present invention chooses to use the ASAN high memory space solution.
[0055] First, you can plan to allocate the starting memory address (0x10007fff8000) of the high memory space of the ASAN memory error checker to the database shared memory. This involves modifying the SHMBASE related configuration items of the onconfig file of the gbase8s database, that is, specifying the starting address to be set to 0x10007fff8000.
[0056] Next, you can determine the size of the shared memory space, such as the maximum shared memory space used is 24G. On this basis, calculate and set the size of the Shadow memory space, which can be configured in an 8:1 ratio according to the actual memory requirements. For example, if the maximum shared memory space used is 24G, then the Shadow memory space can be allocated 3G.
[0057] Step 2: Create a shared memory space in the high memory space based on the starting memory address and memory size of the shared memory space. In one example, the shared memory space is first created from 24G memory starting from the starting memory address (0x02008fff7000) of the high memory space using the mumap command (delete the object mapping of a specific address area).
[0058] Step 3: For any memory address in the shared memory space, determine the memory address that has a mapping relationship with the memory address from the shadow memory space corresponding to the memory space to be checked, so as to determine the address mapping table between the shared memory space and the shadow memory space. For example, starting from the starting memory address (0x10007fff8000) of the shared memory space, determine the starting memory address in the shadow memory space corresponding to the starting memory address, repeat this process until the last memory address of the shared memory space or the shadow memory space is traversed, and then stop to obtain an address mapping table for describing the mapping relationship between the memory address of the shared memory space and the memory address of the shadow memory space.
[0059] After modifying according to the above steps, the Shadow memory space corresponding to the memory space to be checked is in the shared memory space and can be accessed by all vp. Figure 4 ,In the modified address mapping table, the area filled with slashes represents the shared memory space of the ,database, and the area filled with grids represents the Shadow memory space ,corresponding to the shared memory space.
[0060] In one example, the memory address in the shared memory space is recorded as the shared memory address, and the memory address in the shadow memory space is recorded as the shadow memory address. Based on the aforementioned modification of the memory allocator and the mapping of the shadow memory space, the embodiment of the present invention further provides an implementation method for detecting whether an access request (or memory read and write operation) has an out-of-bounds problem based on the shared memory space through an ASAN memory error checker, and obtaining an out-of-bounds detection result, and performing the following operations for any memory address to be accessed in the memory interval to be accessed carried by the access request: Through the ASAN memory error checker, the target shared memory address corresponding to the memory address to be accessed is accessed based on the address mapping table, multiple target shadow memory addresses that have a mapping relationship with the target shared memory address are determined based on the address mapping table, and whether the memory address to be accessed has an out-of-bounds problem is detected according to the mark of the target shadow memory address. The embodiment of the present invention first determines the target shared memory address corresponding to each memory address to be accessed in the memory interval to be accessed through the address mapping table, and then accesses the target shared memory address through the ASAN memory error checker, and continues to obtain the marks of multiple target shadow memory addresses corresponding to the target shared memory address according to the address mapping table, so as to detect whether the memory interval to be accessed has an out-of-bounds problem.
[0061] The specific logic of ASAN memory error checker for out-of-bounds location is as follows: During compilation, ASAN memory error checker will insert stubs for memory operations in the code. Specifically, it will insert a check code before each access operation to determine whether the memory address to be accessed is "poisoned" (i.e., whether it is in an inaccessible state). If a memory access error is found, the error reporting mechanism will be triggered to prompt the user that there is an out-of-bounds problem in this access operation.
[0062] The embodiment of the present invention further provides specific implementation methods of cross-boundary positioning for the aforementioned allocatable memory space and target memory space: (a) Allocatable memory space: Please continue to refer to Figure 2 , the allocatable memory space includes multiple allocatable sub-memory spaces, each of which is divided into a Block header memory segment, a data memory segment (Data), and an AlignPadding memory segment. On this basis, the process of locating the out-of-bounds of the allocatable memory space is as follows: In one example, if it is determined that a Block header memory segment in an allocatable sub-memory space corresponding to a memory interval to be accessed is accessed based on a mark of a target shadow memory address, it is determined that an out-of-bounds problem exists in the memory address to be accessed.
[0063] In another example, if, based on the mark of the target shadow memory address, it is determined that the Align Padding memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, or the Block header memory segment in the next adjacent allocatable sub-memory space is accessed, then it is determined that the memory address to be accessed has an out-of-bounds problem.
[0064] For example, Figure 2 Two allocatable sub-memory spaces are illustrated (there can be more than one in actual application). Assuming that the user needs to access the data memory segment in the first allocatable sub-memory space and issues a corresponding access request, the target shadow memory address of the memory interval to be accessed is determined according to the aforementioned process; for any target shadow memory address, it is determined whether the target shadow memory address is located in the data memory segment. If it is located in the data memory segment in the first allocatable sub-memory space, it can be determined that the access request has not crossed the boundary; if it is located in the Block header memory segment in the first allocatable sub-memory space, the access request crosses the boundary forward and triggers an error; if it is located in the Align Padding memory segment in the first allocatable sub-memory space, or in the Block header memory segment in the second allocatable sub-memory space, the access request crosses the boundary backward and triggers an error.
[0065] Furthermore, when the entire allocatable memory space is released, its shadow memory space is poisoned and access is no longer allowed. If an access request is received at this time, it can be determined that there is an out-of-bounds situation.
[0066] (b) Target memory space: Please continue to refer to Figure 3 , the target memory space includes multiple target sub-memory spaces. The head target sub-memory space includes the heap memory segment, the data memory segment (also known as the Data area), the Align Padding memory segment and the protection memory segment (Protect bytes (8 bytes)). Other target sub-memory spaces include the data memory segment (also known as the Data area), the Align Padding memory segment and the protection memory segment (Protect bytes (8 bytes)). On this basis, the process of locating the out-of-bounds of the allocatable memory space is as follows: In one example, if, based on the mark of the target shadow memory address, it is determined that the heap memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, or the protected memory segment in the adjacent previous target sub-memory space is accessed, then it is determined that the memory address to be accessed has an out-of-bounds problem.
[0067] In another example, if it is determined that the Align Padding memory segment or the protection memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed based on the mark of the target shadow memory address, it is determined that the memory address to be accessed has an out-of-bounds problem.
[0068] For example, Figure 3 Two target sub-memory spaces are illustrated (there can be more than one in actual application). Assuming that the user needs to access the data memory segment in the first target sub-memory space and issues a corresponding access request, the target shadow memory address of the memory interval to be accessed is determined according to the aforementioned process; for any target shadow memory address, determine whether the target shadow memory address is located in the data memory segment. If it is located in the data memory segment in the second target sub-memory space, it can be determined that the access request has not crossed the boundary; if it is located in the heap memory segment in the second target sub-memory space, or in the protection memory segment in the first target sub-memory space, or in the heap management structure, then the access request crosses the boundary forward and triggers an error; if it is located in the Align Padding or protection memory segment in the second target sub-memory space, then the access request crosses the boundary backward and triggers an error.
[0069] Furthermore, when the entire target memory space is released, its shadow memory space is poisoned and access is no longer allowed. If an access request is received at this time, it can be determined that there is an out-of-bounds situation.
[0070] Furthermore, according to the business logic and data processing characteristics of the GBase8s database, the monitoring rules of the ASAN memory error checker were customized. Through in-depth analysis of the core functions and key business processes of the database system, it was determined which memory operations were normal and legal, and which were potential risk points that needed to be focused on and detected, thus avoiding a large number of unnecessary alarm messages caused by the overly strict detection rules of the ASAN memory error checker.
[0071] Furthermore, the integration mode of ASAN memory error checker and GBase8s database was optimized, and a more flexible and efficient interface design was adopted to reduce the coupling between the two and improve the overall stability and compatibility of the system.
[0072] To sum up, the GBase8s database out-of-bounds location method provided by the embodiment of the present invention can effectively solve the problem of difficulty in locating database memory error out-of-bounds problems in the prior art, provides a strong guarantee for the stable operation and maintenance of the database system, and has significant practicality and promotion value.
[0073] Based on the above embodiments, the present invention provides a GBase8s database cross-border positioning system, which is applied to the GBase8s database. Figure 5 The structural diagram of a GBase8s database cross-border positioning system shown in the figure mainly includes the following parts: The memory application module 502 is used to apply for allocatable memory space from the segment memory space of the GBase8s database, and to apply for target memory space for a specified program from the allocatable memory space; The memory processing module 504 is used to use the allocatable memory space and / or the target memory space as the memory space to be checked, and perform protection processing on the memory space to be checked, so that the data memory segments in the memory space to be checked are in an accessible state, and the memory segments other than the data memory segments are in an inaccessible state; A memory mapping module 506 is used to map the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked, and the shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking; The out-of-bounds location module 508 is used to detect whether there is an out-of-bounds problem in the access request based on the shared memory space through the ASAN memory error checker if an access request for the data memory segment in the memory space to be checked is received, and obtain an out-of-bounds detection result.
[0074] The GBase8s database out-of-bounds location system provided by the embodiment of the present invention adjusts and optimizes the memory allocator of the GBase8s database, so that after applying for the allocable memory space and the target memory space, the allocable memory space and / or the target memory space are protected, so that the data memory segments therein are in an accessible state and other data memory segments are inaccessible. On this basis, the shared memory space is mapped to its corresponding shadow memory space, so that the ASAN memory error checker detects whether there is an out-of-bounds problem in the access request by accessing the shared memory space. The present invention can solve the problem of mismatch between the ASAN memory error checker and the GBase8s database, realize the collaborative work between the two, and then use the ASAN memory error checker to effectively locate the out-of-bounds of the GBase8s database, thereby improving the stability and reliability of the GBase8s database.
[0075] In one implementation, a pool memory allocator is configured in the GBase8s database; the memory application module 502 is specifically used for: Receive memory application requests sent by the specified program through the pool memory allocator, and apply for allocatable memory space from the segment memory space of the GBase8s database; In one implementation, the memory processing module 504 is specifically configured to: The following operations are performed through the pool memory allocator: filling operations are performed on each memory segment in the allocatable memory space, so that each memory segment in the allocatable memory space is inaccessible; recovery operations are performed on the data memory segments in the allocatable memory space, so that the data memory segments in the allocatable memory space are accessible.
[0076] In one implementation, a heap memory allocator is configured in the GBase8s database; the memory application module 502 is specifically used for: The target memory space is applied for the specified program from the allocatable memory space through the heap memory allocator. The size of the data memory segment in the target memory space is consistent with the memory size carried in the memory application request. In one implementation, the memory processing module 504 is specifically configured to: The following operations are performed through the heap memory allocator: filling operations are performed on each memory segment in the target memory space, so that each memory segment in the target memory space is inaccessible; the actual memory size to be allocated is determined according to the memory size carried in the memory application request, and the actual memory size to be allocated includes the size of the data memory segment and the size of the protection memory segment; according to the size of the data memory segment and the size of the protection memory segment, the data memory segment and the protection memory segment are divided from the target memory space; and a recovery operation is performed on the data memory segment in the target memory space, so that the data memory segment in the target memory space is accessible.
[0077] In one implementation, the memory mapping module 506 is specifically configured to: Determine the starting memory address of the shared memory space from the high memory space of the ASAN memory error checker, and determine the memory size of the shared memory space; Based on the starting memory address and memory size of the shared memory space, create the shared memory space in the high memory space; For any memory address in the shared memory space, a memory address that has a mapping relationship with the memory address is determined from the shadow memory space corresponding to the memory space to be checked, so as to determine an address mapping table between the shared memory space and the shadow memory space.
[0078] In one implementation, the memory address in the shared memory space is recorded as the shared memory address, and the memory address in the shadow memory space is recorded as the shadow memory address; the out-of-bounds positioning module 508 is specifically used for: For any memory address to be accessed within the memory range to be accessed carried by the access request, perform the following operations: Through the ASAN memory error checker, the target shared memory address corresponding to the memory address to be accessed is accessed based on the address mapping table, and multiple target shadow memory addresses that have a mapping relationship with the target shared memory address are determined based on the address mapping table. According to the mark of the target shadow memory address, it is detected whether the memory address to be accessed has an out-of-bounds problem.
[0079] In one implementation, the allocatable memory space includes a plurality of allocatable sub-memory spaces, each of which is divided into a block header memory segment, a data memory segment, and an align padding memory segment; the out-of-bounds positioning module 508 is specifically used for: If, according to the mark of the target shadow memory address, it is determined that the block header memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem; If, based on the mark of the target shadow memory address, it is determined that the Align Padding memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, or the Blockheader memory segment in the next adjacent allocatable sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem.
[0080] In one implementation, the target memory space includes multiple target sub-memory spaces, the target sub-memory space of the head includes a heap memory segment, a data memory segment, an Align Padding memory segment, and a protection memory segment, and the other target sub-memory spaces include a data memory segment, an Align Padding memory segment, and a protection memory segment; the out-of-bounds positioning module 508 is specifically used to: If, according to the mark of the target shadow memory address, it is determined that the heap memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, or the protection memory segment in the adjacent previous target sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem; If, based on the mark of the target shadow memory address, it is determined that the Align Padding memory segment or the protection memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem.
[0081] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0082] An embodiment of the present invention provides a server. Specifically, the server includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned embodiments.
[0083] Figure 6 A structural diagram of a server provided in an embodiment of the present invention, the server 100 includes: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected via the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.
[0084] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0085] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0086] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0087] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.
[0088] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.
[0089] If the functions are implemented in the form of software functional units 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0090] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A GBase8s database out-of-bounds location method, characterized in that: The method is applied to a GBase8s database, and the method comprises: Applying for allocatable memory space from the segment memory space of the GBase8s database, and applying for target memory space for a specified program from the allocatable memory space; The allocatable memory space and / or the target memory space are used as the memory space to be checked, and protection processing is performed on the memory space to be checked, so that the data memory segments in the memory space to be checked are in an accessible state, and other memory segments except the data memory segments are in an inaccessible state; Mapping the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked, wherein the shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking; If an access request for the data memory segment in the memory space to be checked is received, an ASAN memory error checker is used to detect whether the access request has an out-of-bounds problem based on the shared memory space to obtain an out-of-bounds detection result.
2. The GBase8s database cross-border positioning method according to claim 1, characterized in that: The GBase8s database is configured with a pool memory allocator; Applying for allocatable memory space from the segment memory space of the GBase8s database includes: Receive a memory application request sent by a specified program through the pool memory allocator, and apply for allocatable memory space from the segment memory space of the GBase8s database; The memory space to be checked is protected, including: The following operations are performed by the pool memory allocator: filling operations are performed on each memory segment in the allocatable memory space, so that each memory segment in the allocatable memory space is in an inaccessible state; and recovery operations are performed on the data memory segments in the allocatable memory space, so that the data memory segments in the allocatable memory space are in an accessible state.
3. The GBase8s database cross-border positioning method according to claim 2 is characterized in that: The GBase8s database is configured with a heap memory allocator; Applying a target memory space for a specified program from the allocatable memory space includes: Applying a target memory space for a specified program from the allocatable memory space through a heap memory allocator, wherein the size of the data memory segment in the target memory space is consistent with the memory size carried in the memory application request; The memory space to be checked is protected, including: The following operations are performed by the heap memory allocator: filling operations are performed on each memory segment in the target memory space, so that each memory segment in the target memory space is in an inaccessible state; the actual memory size to be allocated is determined according to the memory size carried by the memory application request, and the actual memory size to be allocated includes the size of the data memory segment and the size of the protection memory segment; according to the size of the data memory segment and the size of the protection memory segment, the data memory segment and the protection memory segment are divided from the target memory space; and a recovery operation is performed on the data memory segment in the target memory space, so that the data memory segment in the target memory space is in an accessible state.
4. The GBase8s database cross-border positioning method according to claim 1, characterized in that: Mapping the shared memory space of the GBase8s database to the shadow memory space corresponding to the memory space to be checked includes: Determining a starting memory address of a shared memory space from a high memory space of the ASAN memory error checker, and determining a memory size of the shared memory space; Creating the shared memory space in the high memory space based on the starting memory address and the memory size of the shared memory space; For any memory address in the shared memory space, a memory address that has a mapping relationship with the memory address is determined from the shadow memory space corresponding to the memory space to be checked, so as to determine an address mapping table between the shared memory space and the shadow memory space.
5. The GBase8s database cross-border positioning method according to claim 4 is characterized in that: The memory address in the shared memory space is recorded as the shared memory address, and the memory address in the shadow memory space is recorded as the shadow memory address; By using the ASAN memory error checker, whether the access request has an out-of-bounds problem is detected based on the shared memory space, and an out-of-bounds detection result is obtained, including: For any memory address to be accessed in the memory range to be accessed carried by the access request, the following operations are performed: Through the ASAN memory error checker, the target shared memory address corresponding to the memory address to be accessed is accessed based on the address mapping table, and the target shadow memory address that has a mapping relationship with the target shared memory address is determined based on the address mapping table. According to the mark of the target shadow memory address, it is detected whether the memory address to be accessed has an out-of-bounds problem.
6. The GBase8s database cross-border positioning method according to claim 5, characterized in that: The allocatable memory space includes a plurality of allocatable sub-memory spaces, each of which is divided into a Block header memory segment, a data memory segment, and an Align Padding memory segment; Detecting whether the memory address to be accessed has an out-of-bounds problem according to the mark of the target shadow memory address includes: If it is determined that the block header memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed according to the mark of the target shadow memory address, it is determined that the memory address to be accessed has an out-of-bounds problem; If, based on the mark of the target shadow memory address, it is determined that the Align Padding memory segment in the allocatable sub-memory space corresponding to the memory interval to be accessed is accessed, or the Block header memory segment in the adjacent next allocatable sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem.
7. The GBase8s database cross-border positioning method according to claim 5, characterized in that: The target memory space includes a plurality of target sub-memory spaces, the target sub-memory space at the head includes a heap memory segment, a data memory segment, an Align Padding memory segment and a protection memory segment, and the other target sub-memory spaces include the data memory segment, the Align Padding memory segment and the protection memory segment; Detecting whether the memory address to be accessed has an out-of-bounds problem according to the mark of the target shadow memory address, further comprising: If, according to the mark of the target shadow memory address, it is determined that the heap memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, or the protection memory segment in the adjacent previous target sub-memory space is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem; If it is determined based on the mark of the target shadow memory address that the Align Padding memory segment or the protection memory segment in the target sub-memory space corresponding to the memory interval to be accessed is accessed, it is determined that the memory address to be accessed has an out-of-bounds problem.
8. A GBase8s database cross-border positioning system, characterized in that: The system is applied to a GBase8s database, and the system comprises: A memory application module, used for applying for allocatable memory space from the segment memory space of the GBase8s database, and applying for target memory space for a specified program from the allocatable memory space; a memory processing module, configured to use the allocatable memory space and / or the target memory space as a memory space to be checked, and perform protection processing on the memory space to be checked, so that the data memory segments in the memory space to be checked are in an accessible state, and the memory segments other than the data memory segments are in an inaccessible state; A memory mapping module, used for mapping the shared memory space of the GBase8s database to a shadow memory space corresponding to the memory space to be checked, wherein the shadow memory space represents the accessible state of each memory address in the memory space to be checked by marking; The cross-boundary positioning module is used to detect whether there is a cross-boundary problem in the access request based on the shared memory space through the ASAN memory error checker if an access request for the data memory segment in the memory space to be checked is received, and obtain a cross-boundary detection result.
9. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Heap memory allocation method and device and storage medium
CN112650692A
Method and device for detecting heap memory boundary crossing and computer storage medium
CN118519919A
Method for processing memory stepping problem and related device
CN119668904A
Shared memory abnormal access behavior detection method, device and equipment
CN119847789A
User-level exception-based invocation of software instrumentation handlers
US20240095063A1
Cited By
Memory pool memory error analysis and identification method, electronic equipment and storage medium
CN117234766A