Database exception thread fault tracking method, device, equipment and storage medium

By utilizing thread identification information and symbol tables within a multi-process coroutine architecture, a fault tracking information set for abnormal database threads is constructed, solving the problem of incomplete database fault tracking information and enabling more accurate fault location and analysis.

CN120803794BActive Publication Date: 2025-11-25TIANJIN NANKAI UNIV GENERAL DATA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511278349.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-11-25
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

In existing technologies, database fault tracking information is incomplete, making it difficult for maintenance personnel to accurately locate the cause of the fault and to repair database problems in a timely manner.

Method used

By using thread identification information to determine the current and historical stack information of abnormal threads from multiple symbol tables and memory spaces under a multi-process coroutine architecture, and combining function names and code segment addresses, a fault tracing information set is constructed, including current and historical function names to supplement the function call process of abnormal threads.

Benefits of technology

It provides more detailed and complete fault tracing information, improves the accuracy of root cause localization in distributed environments, and ensures the accuracy and completeness of fault analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803794B_ABST
    Figure CN120803794B_ABST
Patent Text Reader

Abstract

The application provides a database abnormal thread fault tracking method, device and equipment and a storage medium, and is applied to the technical field of databases. The method comprises the following steps: in response to a received abnormal prompt signal, determining pointer information of a function code segment address being run; according to thread identification information of an abnormal thread, determining a target symbol table matched with the thread identification information from a plurality of symbol tables; based on the target symbol table and the pointer information, determining a plurality of first function names corresponding to a plurality of function code segment addresses one by one; according to the thread identification information, determining historical stack information of the abnormal thread running on other processes; according to a historical target symbol table, determining a plurality of second function names corresponding to a plurality of historical function code segment addresses included in the historical stack information one by one; and based on the plurality of function code segment addresses, the plurality of first function names and the plurality of second function names, determining a fault tracking information set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and more specifically to a method, apparatus, device, and storage medium for fault tracing of abnormal threads in a database. Background Technology

[0002] As the amount of data stored in databases continues to grow, databases often fail due to various problems in practical applications, resulting in their inability to respond to and process received requests normally. Related technologies often require the use of data obtained through detection to determine the cause of the failure during database access. For example, tools for detecting network bandwidth can be used to measure real-time network bandwidth, and the cause of the database failure can be determined based on the detected real-time network bandwidth.

[0003] In realizing the concept of this invention, the related technologies have at least the following problems: the information obtained for fault cause analysis is incomplete, making it difficult for maintenance personnel or fault analysis tools to determine the root cause of the database failure based on the currently obtained fault tracing information, and thus making it impossible to repair the database failure in a timely manner. Summary of the Invention

[0004] In view of the above problems, the present invention provides a method, apparatus, device and storage medium for fault tracing of abnormal threads in a database.

[0005] According to a first aspect of the present invention, a fault tracing method for an abnormal thread in a database is provided, comprising: in response to receiving an exception indication signal indicating an abnormal execution of a currently executing thread, identifying the currently executing thread as an abnormal thread, determining pointer information from the current stack information of the abnormal thread to indicate the address of a function code segment currently running; determining a target symbol table matching the thread identification information of the abnormal thread from multiple symbol tables based on the thread identification information of the abnormal thread; the symbol table including a mapping relationship between function names and function code segment addresses; determining multiple first function names corresponding one-to-one with the multiple function code segment addresses included in the current stack information of the abnormal thread based on the target symbol table and the pointer information; and determining, based on the thread identification information of the abnormal thread... From multiple memory spaces corresponding one-to-one with multiple processes, determine the historical stack information of the aforementioned abnormal thread running on other processes, which matches the thread identification information of the aforementioned abnormal thread. The historical stack information includes multiple historical function code segment addresses. The first program to which the multiple historical function code segment addresses belong has different functions from the second program to which the multiple historical function code segment addresses belong. Each program corresponds to at least one symbol table. Based on the historical target symbol tables that match the programs to which the multiple historical function code segment addresses belong, determine multiple second function names that correspond one-to-one with the multiple historical function code segment addresses. Based on the multiple function code segment addresses, the multiple historical function code segment addresses, the multiple first function names, and the multiple second function names, determine a fault tracing information set.

[0006] According to an embodiment of the present invention, the aforementioned historical target symbol table is obtained through the following operations: based on the thread identifier information of the aforementioned abnormal thread, task identifier information corresponding to other processes that have run the abnormal thread is determined from a first mapping table; wherein, the aforementioned first mapping table records task identifier information executed during the execution of the aforementioned abnormal thread; based on the aforementioned task identifier information, the aforementioned first program is determined from a plurality of programs; based on the program identifier information of the aforementioned first program, the symbol table storage space is accessed to determine the aforementioned historical target symbol table corresponding to the aforementioned first program.

[0007] According to an embodiment of the present invention, the above-mentioned determination of multiple first function names corresponding to multiple function code segment addresses included in the current stack information of the abnormal thread based on the target symbol table and the pointer information includes: backtracking in the current stack information of the abnormal thread according to the pointer information to determine multiple function code segment addresses; and determining multiple first function names corresponding to the function code segment addresses in the multiple symbol tables according to the multiple function code segment addresses.

[0008] According to an embodiment of the present invention, the above-mentioned backtracking in the current stack information of the abnormal thread based on the pointer information to determine multiple function code segment addresses includes: determining whether the function code segment represented by the currently backtracked function code segment address is a top-level function code segment; if the function code segment represented by the currently backtracked function code segment address is not a top-level function code segment, continuing backtracking; if the function code segment represented by the currently backtracked function code segment address is a top-level function code segment, stopping backtracking, and obtaining multiple function code segment addresses.

[0009] According to an embodiment of the present invention, determining the fault tracing information set based on the plurality of function code segment addresses, the plurality of historical function code segment addresses, the plurality of first function names, and the plurality of second function names includes: determining the function execution order of the plurality of function code segment addresses and the plurality of historical function code segment addresses based on the current stack information and the historical stack information of the abnormal thread; and sorting the plurality of first function names and the plurality of second function names based on the function execution order to obtain the fault tracing information set.

[0010] According to an embodiment of the present invention, the plurality of memory spaces corresponding one-to-one with the plurality of processes are located in shared memory; the determination of the historical stack information of the abnormal thread running on other processes from the plurality of memory spaces corresponding one-to-one with the abnormal thread based on the thread identification information of the abnormal thread includes: determining the historical stack information of the abnormal thread in the shared memory based on the thread identification information of the abnormal thread.

[0011] According to an embodiment of the present invention, the method further includes: in response to the abnormal signal triggered by the abnormal thread, obtaining a callback function corresponding to the abnormal signal; and using the callback function to decrypt the encrypted symbol table set in memory to obtain multiple symbol tables.

[0012] A second aspect of the present invention provides a fault tracing device for database abnormal threads, comprising: a pointer determination module, configured to, in response to receiving an abnormal indication signal indicating an abnormal execution of a currently executing thread, identify the currently executing thread as an abnormal thread and determine pointer information from the current stack information of the abnormal thread that indicates the address of a function code segment currently running; a first determination module, configured to, based on the thread identification information of the abnormal thread, determine a target symbol table matching the thread identification information of the abnormal thread from multiple symbol tables; the symbol table includes a mapping relationship between function names and function code segment addresses; a function determination module, configured to, based on the target symbol table and the pointer information, determine multiple first function names corresponding one-to-one with the multiple function code segment addresses included in the current stack information of the abnormal thread; and an information determination module, configured to, based on the abnormal thread's... The system includes: thread identification information, which determines the historical stack information of the abnormal thread running on other processes from multiple memory spaces that correspond one-to-one with the thread identification information of the abnormal thread; the historical stack information includes multiple historical function code segment addresses, the first program to which the multiple historical function code segment addresses belong and the second program to which the multiple historical function code segment addresses belong have different functions, and each program corresponds to at least one symbol table; a second determining module, which determines multiple second function names that correspond one-to-one with the multiple historical function code segment addresses based on the historical target symbol tables that match the programs to which the multiple historical function code segment addresses belong; and an information set determining module, which determines a fault tracing information set based on the multiple function code segment addresses, the multiple historical function code segment addresses, the multiple first function names, and the multiple second function names.

[0013] A third aspect of the present invention provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0014] A fourth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0015] According to an embodiment of the present invention, in a multi-process coroutine architecture, abnormal threads can migrate between multiple processes, resulting in the current stack information and historical stack information corresponding to the abnormal thread being stored in multiple memory spaces. Based on the thread identification information of the abnormal thread, the historical stack information of the abnormal thread running in other processes that matches the thread identification information of the abnormal thread is determined from the multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information includes multiple historical function code segment addresses belonging to a first program, which has a different function from the multiple function code segment addresses belonging to a second program. Each program corresponds to at least one symbol table. Based on the target symbol table and pointer information corresponding to the thread identifier information of the abnormal thread, multiple first function names corresponding one-to-one with the multiple function code segment addresses included in the current stack information are determined. According to the historical target symbol table matching the programs to which the multiple historical function code segment addresses belong, multiple second function names corresponding one-to-one with the multiple historical function code segment addresses are determined. This allows the use of multiple historical function code segment addresses and multiple second function names to supplement the function call process of the abnormal thread before migration. Based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names, and multiple second function names, the fault tracking information set of the abnormal thread migrating between multiple processes is determined, thereby providing a more detailed and complete function call process for the fault analysis of the abnormal thread and improving the accuracy of fault root cause location in a distributed environment. Attached Figure Description

[0016] The above-mentioned contents, as well as other objects, features and advantages of the present invention, will become clearer from the following description of embodiments of the present invention with reference to the accompanying drawings.

[0017] Figure 1 The diagram illustrates an application scenario of a fault tracing method for database abnormal threads according to an embodiment of the present invention.

[0018] Figure 2 A flowchart of a fault tracing method for database abnormal threads according to an embodiment of the present invention is shown.

[0019] Figure 3 A relationship diagram between threads and processes according to an embodiment of the present invention is shown.

[0020] Figure 4 A flowchart of a fault tracing method for a database abnormal thread according to another embodiment of the present invention is shown.

[0021] Figure 5 A schematic diagram of a fault tracing information set according to an embodiment of the present invention is shown.

[0022] Figure 6 A structural block diagram of a fault tracing device for database abnormal threads according to an embodiment of the present invention is shown.

[0023] Figure 7 A block diagram of an electronic device suitable for implementing a fault tracing method for database abnormal threads according to an embodiment of the present invention is shown. Detailed Implementation

[0024] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0028] In the technical solution of this invention, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to maintain the security of user personal information and network security.

[0029] According to embodiments of the present invention, in a multi-process coroutine architecture, threads have the characteristic of cross-process migration. This causes stack information originally belonging to the same thread to be scattered and divided into multiple different, non-contiguous stack spaces. Furthermore, the single-process stack snapshots used in related technologies can only capture fragments of information from the last resident process of the abnormal thread, leaving a large amount of relevant information located in the stack spaces of other processes unavailable. This results in incomplete fault tracking information, making it difficult to accurately determine the cause of database failures based on the fault tracking information obtained in related technologies.

[0030] Based on this, embodiments of the present invention provide a fault tracing method for database abnormal threads. In response to receiving an exception signal indicating an abnormal execution of the currently executing thread, the method identifies the currently executing thread as an abnormal thread and determines pointer information indicating the address of the currently running function code segment from the current stack information of the abnormal thread. Based on the thread identification information of the abnormal thread, a target symbol table matching the thread identification information of the abnormal thread is determined from multiple symbol tables. The symbol table includes a mapping relationship between function names and function code segment addresses. Based on the target symbol table and the pointer information, multiple first function names corresponding one-to-one with the multiple function code segment addresses included in the current stack information of the abnormal thread are determined. Based on the thread identification information of the abnormal thread... The system determines the historical stack information of the abnormal thread running in other processes from multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information includes the addresses of multiple historical function code segments. The functions of the first program to which the multiple historical function code segment addresses belong and the functions of the second program to which the multiple function code segment addresses belong are different. Each program corresponds to at least one symbol table. Based on the historical target symbol tables that match the programs to which the multiple historical function code segment addresses belong, the system determines multiple second function names that correspond one-to-one with the multiple historical function code segment addresses. Based on the multiple function code segment addresses, the multiple historical function code segment addresses, the multiple first function names, and the multiple second function names, the system determines a fault tracing information set.

[0031] Figure 1 The diagram illustrates an application scenario of a fault tracing method for database abnormal threads according to an embodiment of the present invention.

[0032] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0033] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0034] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0035] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0036] It should be noted that the database abnormal thread fault tracking method provided in this embodiment of the invention can generally be executed by server 105. Correspondingly, the database abnormal thread fault tracking device provided in this embodiment of the invention can generally be located in server 105. The database abnormal thread fault tracking method provided in this embodiment of the invention can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the database abnormal thread fault tracking device provided in this embodiment of the invention can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0037] It should be understood that Figure 1 The number of first terminal devices, second terminal devices, third terminal devices, networks, and servers shown in the diagram is merely illustrative. Depending on actual needs, any number of first terminal devices, second terminal devices, third terminal devices, networks, and servers can be included.

[0038] The following will be based on Figure 1 The described scene, through Figures 2-5 The method for fault tracing of abnormal database threads according to embodiments of the present invention is described in detail.

[0039] Figure 2 A flowchart of a fault tracing method for database abnormal threads according to an embodiment of the present invention is shown.

[0040] like Figure 2 As shown, the fault tracing method for database abnormal threads in this embodiment includes operations S210 to S260.

[0041] In operation S210, in response to receiving an exception signal indicating an abnormality in the execution of the currently executing thread, the currently executing thread is identified as an abnormal thread, and pointer information indicating the address of the function code segment being executed is determined from the current stack information of the abnormal thread.

[0042] In operation S220, based on the thread identification information of the abnormal thread, a target symbol table that matches the thread identification information of the abnormal thread is determined from multiple symbol tables; the symbol table includes the mapping relationship between function names and function code segment addresses.

[0043] In operation S230, based on the target symbol table and pointer information, the current stack information of the abnormal thread is determined, including multiple function code segment addresses that correspond one-to-one with multiple first function names.

[0044] In operation S240, based on the thread identifier information of the abnormal thread, the historical stack information of the abnormal thread running on other processes is determined from multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information includes the addresses of multiple historical function code segments. The functions of the first program to which the multiple historical function code segment addresses belong and the second program to which the multiple function code segment addresses belong are different. Each program corresponds to at least one symbol table.

[0045] In operation S250, based on the historical target symbol table that matches the program to which the addresses of multiple historical function code segments belong, multiple second function names that correspond one-to-one with the addresses of multiple historical function code segments are determined.

[0046] In operation S260, a fault tracing information set is determined based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names, and multiple second function names.

[0047] According to embodiments of the present invention, in a multi-process coroutine architecture, a process is the basic unit of resource allocation, containing all the resources required for program execution; for example, a process is allocated an independent memory space. A thread is the basic unit for executing tasks, and threads can migrate between different processes. Therefore, information related to abnormal threads, such as historical stack information, will be scattered and stored in multiple non-contiguous memory spaces because the abnormal thread has migrated between multiple processes.

[0048] According to an embodiment of the present invention, the exception notification signal may consist of multiple characters; for example, the exception notification signal may be "error0". When an exception occurs in a thread running in the database, an exception notification signal can be issued to facilitate fault tracing and determine the fault tracing information set for the abnormal thread.

[0049] According to an embodiment of the present invention, in response to receiving an exception prompt signal indicating an abnormal operation of the currently executing thread, the currently executing thread is identified as an abnormal thread, and the pointer information pushed onto the stack is determined from the current stack information of the abnormal thread. The current stack information is stored in the stack storage space of the process in which the abnormal thread is running when the exception occurs. The current stack information includes pointer information indicating the address of the currently running function code segment, and the pointer information may be the address of the currently running function code segment.

[0050] According to an embodiment of the present invention, the thread identification information of the abnormal thread can be in character form. Based on the thread identification information of the abnormal thread, historical stack information matching the thread identification information of the abnormal thread is searched from multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information may include multiple historical function code segment addresses, which are the addresses of function code segments called by the abnormal thread in other processes.

[0051] According to embodiments of the present invention, a function code segment represents a code fragment of a function, and a program may include multiple function code segments. A symbol table may be generated after the program is compiled, and the symbol table includes the addresses of multiple function code segments and the function names corresponding to each of the multiple function code segment addresses. A program may include multiple function code segments.

[0052] According to embodiments of the present invention, a first program is used to represent the program corresponding to the address of a historical code segment, and a second program is used to represent the program corresponding to the address of a function code segment. There can be multiple first and second programs. The functions of the first and second programs differ; that is, the source code, compiler output, and runtime behavior of the first program differ from those of the second program. For example, the first program implements algorithm A, while the second program implements algorithm B. The historical function code segment belonging to the first program and the function code segment belonging to the second program may share some code, but the core functions of the first and second programs differ, resulting in the historical function code segment address belonging to the first program being different from the function code segment address belonging to the second program.

[0053] According to an embodiment of the present invention, based on the thread identification information of the abnormal thread, multiple symbol tables are stored in the storage space to determine the target symbol table and the historical target symbol table that match the thread identification information of the abnormal thread.

[0054] According to an embodiment of the present invention, based on the mapping relationship between function names and function code segment addresses included in the target symbol table, the first function name corresponding to the pointer information and the multiple first function names corresponding one-to-one with the addresses of other multiple function code segments included in the current stack information are searched in the target symbol table.

[0055] According to an embodiment of the present invention, for the addresses of historical code segments belonging to a first program, the addresses of multiple historical function code segments are matched based on the historical target symbol table to determine multiple second function names that correspond one-to-one with the addresses of multiple historical function code segments.

[0056] According to an embodiment of the present invention, the following data are organized in the form of key-value pairs: multiple function code segment addresses and multiple first function names corresponding one-to-one with the multiple function code segment addresses, and multiple historical function code segment addresses and multiple second function names corresponding one-to-one with the multiple function code segment addresses, to determine a fault tracing information set, so that database operation and maintenance personnel can determine the cause of the fault based on the fault tracing information set and maintain the database system based on the cause of the fault.

[0057] According to an embodiment of the present invention, in a multi-process coroutine architecture, abnormal threads can migrate between multiple processes, resulting in the current stack information and historical stack information corresponding to the abnormal thread being stored in multiple memory spaces. Based on the thread identification information of the abnormal thread, the historical stack information of the abnormal thread running in other processes that matches the thread identification information of the abnormal thread is determined from the multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information includes multiple historical function code segment addresses belonging to a first program, which has a different function from the multiple function code segment addresses belonging to a second program. Each program corresponds to at least one symbol table. Based on the target symbol table and pointer information corresponding to the thread identifier information of the abnormal thread, multiple first function names corresponding one-to-one with the multiple function code segment addresses included in the current stack information are determined. According to the historical target symbol table matching the programs to which the multiple historical function code segment addresses belong, multiple second function names corresponding one-to-one with the multiple historical function code segment addresses are determined. This allows the use of multiple historical function code segment addresses and multiple second function names to supplement the function call process of the abnormal thread before migration. Based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names, and multiple second function names, the fault tracking information set of the abnormal thread migrating between multiple processes is determined, thereby providing a more detailed and complete function call process for the fault analysis of the abnormal thread and improving the accuracy of fault root cause location in a distributed environment.

[0058] Figure 3 A relationship diagram between threads and processes according to an embodiment of the present invention is shown.

[0059] like Figure 3 As shown, processes Q and P are merely containers for the execution body; threads 1, 2, and 3 are the actual execution bodies. Threads 1, 2, and 3 can migrate between different processes. Specifically, referring to the timeline, in process Q, the execution order of threads is thread 1, thread 2, thread 3, and thread 1. In process P, the execution order is thread 2, thread 3, thread 1, and thread 2. Thread 1 executes in process Q beforehand, and after a predetermined duration, it is interrupted. Thread 1 then jumps to process P for execution, and after a predetermined duration, it is interrupted. Afterward, it jumps back to process Q for execution.

[0060] Similarly, thread 2 executes in process P beforehand, and is interrupted after a predetermined execution time. Thread 2 then jumps to process Q to execute, and is interrupted after a predetermined execution time. Afterwards, it jumps back to process P to execute.

[0061] According to an embodiment of the present invention, the fault tracing method for database abnormal threads further includes: in response to an abnormal signal triggered by the abnormal thread, obtaining a callback function corresponding to the abnormal signal; and using the callback function to decrypt the encrypted symbol table set in memory space to obtain multiple symbol tables.

[0062] According to an embodiment of the present invention, in response to an exception signal triggered by an abnormal thread, a corresponding callback function is matched according to the exception signal and executed, thereby using the decryption key to decrypt the set of encrypted symbol tables stored in memory to obtain multiple symbol tables.

[0063] According to embodiments of the present invention, the symbol table set is dynamically decrypted in memory space through a dedicated callback function, which reduces the chance of the symbol table being exposed in memory for a long time, reduces the possibility of it being accidentally modified or polluted by other processes or threads, ensures the accuracy and reliability of the symbol table, and thus improves the accuracy of the fault tracing information set.

[0064] According to an embodiment of the present invention, multiple memory spaces corresponding one-to-one with multiple processes are located in shared memory; determining the historical stack information of an abnormal thread running on other processes from the multiple memory spaces corresponding one-to-one with the abnormal thread's thread identifier information includes: determining the historical stack information of the abnormal thread in shared memory based on the abnormal thread's thread identifier information.

[0065] According to an embodiment of the present invention, multiple memory spaces corresponding one-to-one with multiple processes are located in shared memory, and the historical stack information of abnormal threads can be obtained by accessing the shared memory.

[0066] According to an embodiment of the present invention, storing multiple memory spaces corresponding one-to-one with multiple processes in shared memory can shorten the time for searching historical stack information in other related processes, reduce the risk that historical stack information will be overwritten by other information before it is found, thereby improving the integrity and accuracy of fault tracing information.

[0067] According to an embodiment of the present invention, the historical target symbol table is obtained through the following operations: based on the thread identifier information of the abnormal thread, the task identifier information corresponding to other processes that have run the abnormal thread is determined from the first mapping table, wherein the first mapping table records the task identifier information executed during the execution of the abnormal thread; based on the task identifier information, a first program is determined from multiple programs; based on the program identifier information of each of the first programs, the symbol table storage space is accessed to determine the historical target symbol table corresponding to the first program.

[0068] According to an embodiment of the present invention, storing multiple memory spaces corresponding one-to-one with multiple processes in shared memory can shorten the time for searching historical stack information in other related processes, reduce the risk that historical stack information will be overwritten by other information before it is found, thereby improving the integrity and accuracy of fault tracing information.

[0069] According to embodiments of the present invention, a thread serves as a task execution carrier and can be used to execute different tasks. A fixed mapping relationship exists between tasks and programs, and the same program can be used to execute one or more tasks. A first program corresponding to the task identification information is determined from multiple programs based on task identification information; there can be multiple first programs corresponding to task identification information. Based on the program identification information of the first program, a symbol table space used for storing symbol tables is accessed to determine the historical target symbol table corresponding to the first program. There is no direct correspondence between processes and tasks, or between processes and programs.

[0070] According to an embodiment of the present invention, a first mapping table is used to record the mapping relationship between thread identifier information and task identifier information of abnormal threads during thread execution to determine the task identifier information corresponding to the thread identifier information of the abnormal thread. Based on the program calls during task execution, program identifier information corresponding to the task identifier information is determined. Multiple historical target symbol tables are then determined based on the program identifier information to facilitate the determination of multiple second function names, supplementing the function call process before the abnormal thread migration and improving the accuracy of fault tracing information.

[0071] According to an embodiment of the present invention, determining multiple first function names corresponding one-to-one with multiple function code segment addresses included in the current stack information of the abnormal thread based on the target symbol table and pointer information includes: backtracking in the current stack information of the abnormal thread according to the pointer information to determine multiple function code segment addresses; and determining multiple first function names corresponding one-to-one with the function code segment addresses in multiple symbol tables according to the multiple function code segment addresses.

[0072] According to an embodiment of the present invention, the first function name corresponding to the address of the function code segment where the exception occurred is determined by matching the pointer information in the target symbol table. The stack pointer of the current stack information points to the top address of the stack used to store the current stack information. Based on the stack pointer of the current stack information, the current stack information is backtracked to determine the addresses of multiple function code segments.

[0073] According to an embodiment of the present invention, by backtracking the current stack information frame by frame based on the stack pointer of the current stack information, the execution order of multiple function code segments can be determined, and the function code segment address sequence can be obtained. Then, based on the function code segment address sequence, multiple symbol tables are traversed in the storage space used to store symbol tables to determine multiple first function names corresponding to the addresses of multiple function code segments, and the execution order of the multiple first function names.

[0074] According to an embodiment of the present invention, the first function name corresponding to the address of the currently running function code segment is determined based on pointer information. Backtracking is performed in the current stack information to determine multiple function code segment addresses. Multiple first function names corresponding one-to-one with the multiple function code segment addresses are determined in multiple symbol tables. The execution process of the abnormal thread is accurately located to the function call level to improve the accuracy of fault tracking information.

[0075] According to an embodiment of the present invention, backtracking is performed in the current stack information of the abnormal thread to determine the addresses of multiple function code segments, including: determining whether the function code segment represented by the address of the currently backtracked function code segment is a top-level function code segment; if the function code segment represented by the address of the currently backtracked function code segment is not a top-level function code segment, continuing backtracking; if the function code segment represented by the address of the currently backtracked function code segment is a top-level function code segment, stopping backtracking, and obtaining the addresses of multiple function code segments.

[0076] According to an embodiment of the present invention, the top-level function code segment represents the function code segment called first in the current stack information. Determining whether the function code segment represented by the address of the currently backtracked function code segment is the top-level function code segment involves using the stack pointer to continuously search towards the bottom of the current stack storing the current stack information to determine the addresses of multiple function code segments.

[0077] According to embodiments of the present invention, by continuously tracing back from the current function code segment where the exception occurs to the top-level function code segment, the call hierarchy between functions is clearly presented, which helps to more accurately reconstruct the execution process of the exception thread, provides more logical contextual information for fault analysis, and thus improves the accuracy of fault tracing information.

[0078] Figure 4 A flowchart of a fault tracing method for a database abnormal thread according to another embodiment of the present invention is shown.

[0079] like Figure 4 As shown, in response to receiving an exception signal 401 indicating an abnormality in the current execution thread, the stack Stack 410, which stores the current stack information, is traced back from the function code segment address indicated by the pointer information to determine the addresses of multiple function code segments.

[0080] Based on the thread identifier information 402 of the abnormal thread, at least one task identifier information corresponding to multiple processes that have run the abnormal thread is determined from the first mapping table 403. The first mapping table 403 records the task identifier information executed during the execution of the abnormal thread, and includes the correspondence between processes 1 to n and task identifier information 1 to task identifier information n, where n is an integer greater than 1. The processes that have executed the abnormal thread can be determined based on the thread identifier of the abnormal thread. For example, processes that have executed the abnormal thread include process 2, process 3, and process 5. Based on the thread identifier information 402 of the abnormal thread, a task identifier information set 404 is determined from the first mapping table 403. The task identifier information set 404 includes task identifier information 2 corresponding to process 2, task identifier information 3 corresponding to process 3, and task identifier information 5 corresponding to process 5.

[0081] Based on task identifier information set 404, target program identifier information set 406 corresponding to task identifier information 2, task identifier information 3, and task identifier information 5 is determined from program identifier information set 405. This includes the program identifier information of the first program and the program identifier information of the second program. Program identifier information set 405 includes at least the program identifier information of the first program and the program identifier information of the second program. Here, the number of individuals in multiple program identifier information sets 405 is merely illustrative; there can be multiple first and second programs corresponding to task identifier information 2, task identifier information 3, and task identifier information 5. That is, there can be multiple program identifier information sets for the first and second programs corresponding to task identifier information 2, task identifier information 3, and task identifier information 5.

[0082] Based on the target program identification information set 406, a target symbol table set 408 corresponding to the abnormal thread is determined from multiple symbol tables in the access symbol table storage space 407. The target program identification information set 406 includes the program identification information of the first program and the program identification information of the second program. The multiple symbol tables include symbol table 1, symbol table 2, symbol table 3, and symbol table 4; the target symbol table set 408 includes symbol table 1, symbol table 2, and symbol table 4, and includes the target symbol table and the historical target symbol table.

[0083] Based on symbol table 1, symbol table 2, and symbol table 4, the address of each function code segment is matched sequentially to determine multiple first function names 409 that correspond one-to-one with the addresses of multiple function code segments in symbol table 1, symbol table 2, or symbol table 4. Each function code segment address corresponds to one first function name.

[0084] Based on the thread identifier information 402 of the abnormal thread, the historical stack information of the abnormal thread running in another process that matches the thread identifier information 402 is determined from the shared memory 440. The historical stack information is stored in stacks Stack 420 and Stack 430, and the abnormal thread corresponds to a stack in each process.

[0085] The stack pointer based on Stack420 is used to traverse Stack420, which stores historical stack information, in order to backtrack the addresses of historical function code segments stored in Stack420. Similarly, the stack pointer based on Stack430 is used to traverse Stack430, which stores historical stack information, in order to backtrack the addresses of historical function code segments stored in Stack430, in order to determine the addresses of multiple historical function code segments.

[0086] In symbol table 1, or symbol table 2, or symbol table 4, the address of each historical function code segment is matched sequentially to determine multiple second function names 410 that correspond one-to-one with the addresses of multiple historical function code segments. Each historical function code segment address corresponds to one second function name.

[0087] Based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names 409, and multiple second function names 410, a fault tracing information set 411 is determined.

[0088] According to embodiments of the present invention, by determining multiple function code segment addresses from the current stack information of the abnormal thread, determining multiple historical function code segment addresses from the historical stack information, and matching them with multiple symbol tables, the function names corresponding to the function code segment addresses can be obtained more accurately. Thus, the execution process of the abnormal thread can be more comprehensively and accurately restored through the fault tracing information set, providing a more reliable basis for fault analysis.

[0089] According to an embodiment of the present invention, a fault tracing information set is determined based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names, and multiple second function names, including: determining the function execution order of multiple function code segment addresses and multiple historical function code segment addresses based on the current stack information and historical stack information of the abnormal thread; and sorting the multiple first function names and multiple second function names based on the function execution order to obtain the fault tracing information set.

[0090] According to an embodiment of the present invention, based on the current stack information and historical stack information of the abnormal thread, the execution order of multiple first function names and multiple second function names corresponding to multiple function code segment addresses is determined. This function execution order reflects the actual order in which each function code segment is called and executed when the exception occurs. The multiple first function names and multiple second function names are then sorted according to the determined function execution order. After the above sorting operation, a set containing ordered function code segment addresses, first function names, and second function names is finally obtained, i.e., a fault tracing information set.

[0091] According to embodiments of the present invention, by clearly defining the function execution order, the key function or code segment causing the fault can be located more accurately, as well as subsequent fault diagnosis. For example, the function execution order can be correlated with the event timestamps recorded in the system log to further determine the state and behavior of the system when each function is executed, thereby diagnosing the fault more comprehensively.

[0092] Figure 5 A schematic diagram of a fault tracing information set according to an embodiment of the present invention is shown.

[0093] like Figure 5 As shown, the fault tracing information set 500 includes at least code segment addresses and function names. The code segment addresses include the current function code segment address 511, multiple function code segment addresses 512, and multiple historical function code segment addresses 513. The function names include multiple first function names 521 and multiple second function names 522.

[0094] The function name can be used to obtain the degree of matching to determine the comment information 531 of each of the multiple first function names 521 and the comment information 532 of each of the multiple second function names 522.

[0095] According to an embodiment of the present invention, by matching the function name to obtain the annotation information, the purpose, function and implementation logic of the function are provided for multiple first function names and multiple second function names, thereby improving the accuracy of the fault tracing information set.

[0096] Based on the above-described method for tracing database abnormal threads, this invention also provides a device for tracing database abnormal threads. The following will combine... Figure 6 The device is described in detail.

[0097] Figure 6 A structural block diagram of a fault tracing device for database abnormal threads according to an embodiment of the present invention is shown.

[0098] like Figure 6 As shown, the fault tracking device 600 for database abnormal threads in this embodiment includes a pointer determination module 610, a first determination module 620, a function determination module 630, an information determination module 640, a second determination module 650, and an information set determination module 660.

[0099] The pointer determination module 610 is used to, in response to receiving an exception signal indicating an abnormality in the currently executing thread, identify the currently executing thread as an abnormal thread and determine pointer information from the current stack information of the abnormal thread to indicate the address of the currently running function code segment. In one embodiment, the pointer determination module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0100] The first determining module 620 is used to determine a target symbol table that matches the thread identification information of the abnormal thread from multiple symbol tables based on the thread identification information of the abnormal thread; the symbol table includes the mapping relationship between function names and function code segment addresses. In one embodiment, the first determining module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0101] The function determination module 630 is used to determine, based on the target symbol table and pointer information, multiple first function names corresponding one-to-one with the addresses of multiple function code segments included in the current stack information of the abnormal thread. In one embodiment, the function determination module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0102] The information determination module 640 is used to determine, based on the thread identifier information of the abnormal thread, the historical stack information of the abnormal thread running in another process from multiple memory spaces that correspond one-to-one with multiple processes. The historical stack information includes multiple historical function code segment addresses, the functions of the first program to which the multiple historical function code segment addresses belong and the functions of the second program to which the multiple function code segment addresses belong are different, and each program corresponds to at least one symbol table. In one embodiment, the information determination module 640 can be used to perform the operation S240 described above, which will not be repeated here.

[0103] The second determining module 650 is used to determine a plurality of second function names corresponding one-to-one with the addresses of the plurality of historical function code segments, based on a historical target symbol table that matches the programs to which the addresses of the plurality of historical function code segments belong. In one embodiment, the second determining module 650 may be used to perform the operation S250 described above, which will not be repeated here.

[0104] The information set determination module 660 is used to determine a fault tracing information set based on multiple function code segment addresses, multiple historical function code segment addresses, multiple first function names, and multiple second function names. In one embodiment, the information set determination module 660 can be used to perform the operation S260 described above, which will not be repeated here.

[0105] According to an embodiment of the present invention, the historical target symbol table is obtained through the following operations: based on the thread identifier information of the abnormal thread, the task identifier information corresponding to other processes that have run the abnormal thread is determined from the first mapping table; wherein, the first mapping table records the task identifier information executed during the execution of the abnormal thread; based on the task identifier information, a first program is determined from multiple programs; based on the program identifier information of each of the first programs, the symbol table storage space is accessed to determine the historical target symbol table corresponding to the first program.

[0106] According to an embodiment of the present invention, the function determination module 630 includes: an address determination unit and a function name determination unit.

[0107] The address determination unit is used to backtrack in the current stack information of the abnormal thread based on pointer information to determine the addresses of multiple function code segments.

[0108] The function name determination unit is used to determine multiple first function names in multiple symbol tables based on the addresses of multiple function code segments.

[0109] According to an embodiment of the present invention, the address determination unit includes: a determination subunit, a backtracking subunit, and an address determination subunit.

[0110] The determined sub-unit is used to determine whether the function code segment represented by the address of the currently backtracked function code segment is the top-level function code segment.

[0111] The backtracking subunit is used to continue backtracking if the function code segment represented by the address of the currently backtracked function code segment is not the top-level function code segment.

[0112] The address determination subunit is used to stop backtracking and obtain multiple function code segment addresses if the function code segment represented by the address of the currently backtracked function code segment is the top-level function code segment.

[0113] According to an embodiment of the present invention, the information set determination module 660 includes: an order determination unit and an information set determination unit.

[0114] The sequence determination unit is used to determine the execution order of multiple function code segment addresses and multiple historical function code segment addresses based on the current stack information and historical stack information of the abnormal thread.

[0115] The information set determination unit is used to sort multiple first function names and multiple second function names based on the function execution order to obtain a fault tracing information set.

[0116] According to an embodiment of the present invention, multiple memory spaces corresponding one-to-one with multiple processes are located in shared memory.

[0117] The information determination module includes: determining the historical stack information of the abnormal thread in shared memory based on the thread identifier information of the abnormal thread.

[0118] According to an embodiment of the present invention, the fault tracking device 600 for database abnormal threads further includes: a function acquisition module and a decryption module.

[0119] The function retrieval module is used to retrieve the callback function corresponding to the exception signal triggered by an abnormal thread.

[0120] The decryption module is used to decrypt the encrypted symbol table set in memory using callback functions, resulting in multiple symbol tables.

[0121] According to embodiments of the present invention, any plurality of modules among the pointer determination module 610, the first determination module 620, the function determination module 630, the information determination module 640, the second determination module 650, and the information set determination module 660 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the pointer determination module 610, the first determination module 620, the function determination module 630, the information determination module 640, the second determination module 650, and the information set determination module 660 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the pointer determination module 610, the first determination module 620, the function determination module 630, the information determination module 640, the second determination module 650, and the information set determination module 660 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0122] Figure 7 A block diagram of an electronic device suitable for implementing a fault tracing method for database abnormal threads according to an embodiment of the present invention is shown.

[0123] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0124] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.

[0125] According to an embodiment of the present invention, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0126] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.

[0127] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.

[0128] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the fault tracing method for database abnormal threads provided in the embodiments of the present invention.

[0129] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0130] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0131] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0132] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0133] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0134] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.

[0135] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.

Claims

1. A method for fault tracing of abnormal threads in a database, characterized in that, The method includes: In response to receiving an exception signal indicating an abnormal execution of the currently executing thread, the currently executing thread is identified as an abnormal thread, and pointer information indicating the address of the function code segment being executed is determined from the current stack information of the abnormal thread. Based on the thread identification information of the abnormal thread, a target symbol table matching the thread identification information of the abnormal thread is determined from multiple symbol tables; the symbol table includes the mapping relationship between function names and function code segment addresses; Based on the target symbol table and the pointer information, determine a plurality of first function names that correspond one-to-one with the addresses of the plurality of function code segments included in the current stack information; Based on the thread identifier information of the abnormal thread, the historical stack information of the abnormal thread running on other processes that matches the thread identifier information of the abnormal thread is determined from multiple memory spaces that correspond one-to-one with multiple processes; the historical stack information includes multiple historical function code segment addresses, the first program to which the multiple historical function code segment addresses belong has different functions from the second program to which the multiple function code segment addresses belong, and each program corresponds to at least one symbol table; Based on the historical target symbol table that matches the program to which the addresses of the multiple historical function code segments belong, determine multiple second function names that correspond one-to-one with the addresses of the multiple historical function code segments; Based on the addresses of the multiple function code segments, the addresses of the multiple historical function code segments, the multiple first function names, and the multiple second function names, a fault tracing information set is determined.

2. The fault tracing method according to claim 1, characterized in that, The historical target symbol table is obtained through the following operations: Based on the thread identifier information of the abnormal thread, the task identifier information corresponding to other processes that have run the abnormal thread is determined from the first mapping table; wherein, the first mapping table records the task identifier information executed during the execution of the abnormal thread; Based on the task identification information, the first program is determined from multiple programs; Based on the program identifier information of each of the first programs, the symbol table storage space is accessed to determine the historical target symbol table corresponding to the first program.

3. The fault tracing method according to claim 1, characterized in that, The step of determining multiple first function names that correspond one-to-one with the addresses of multiple function code segments included in the current stack information, based on the target symbol table and the pointer information, includes: Based on the pointer information, backtracking is performed in the current stack information of the abnormal thread to determine the addresses of the multiple function code segments; Based on the addresses of the multiple function code segments, the multiple first function names corresponding to the addresses of the multiple function code segments are determined in the multiple symbol tables.

4. The fault tracing method according to claim 3, characterized in that, The step of backtracking based on the pointer information in the current stack information of the abnormal thread to determine the addresses of the multiple function code segments includes: Determine whether the function code segment represented by the address of the currently backtracked function code segment is the top-level function code segment; If the function code segment represented by the address of the currently backtracked function code segment is not the top-level function code segment, continue backtracking; If the function code segment represented by the address of the currently backtracked function code segment is the top-level function code segment, stop backtracking and obtain the addresses of the multiple function code segments.

5. The fault tracing method according to claim 1, characterized in that, The step of determining the fault tracing information set based on the multiple function code segment addresses, the multiple historical function code segment addresses, the multiple first function names, and the multiple second function names includes: Based on the current stack information and the historical stack information of the abnormal thread, the execution order of the multiple function code segment addresses and the multiple historical function code segment addresses is determined; The fault tracing information set is obtained by sorting the plurality of first function names and the plurality of second function names based on the function execution order.

6. The fault tracing method according to claim 1, characterized in that, The multiple memory spaces, each corresponding to a specific process, are located in shared memory. The step of determining, based on the thread identifier information of the abnormal thread, the historical stack information of the abnormal thread running in other processes from multiple memory spaces that correspond one-to-one with multiple processes, includes: The historical stack information of the abnormal thread is determined in the shared memory based on the thread identifier information of the abnormal thread.

7. The fault tracing method according to claim 1, characterized in that, The method further includes: In response to an exception signal triggered by an abnormal thread, obtain the callback function corresponding to the exception signal; Using the callback function, the encrypted symbol table set is decrypted in memory to obtain multiple symbol tables.

8. A fault tracing device for database abnormal threads, characterized in that, The device includes: The pointer determination module is used to, in response to receiving an exception prompt signal indicating an abnormal execution of the currently executing thread, identify the currently executing thread as an abnormal thread and determine pointer information from the current stack information of the abnormal thread to indicate the address of the function code segment that is currently running. The first determining module is used to determine a target symbol table that matches the thread identification information of the abnormal thread from multiple symbol tables based on the thread identification information of the abnormal thread; the symbol table includes a mapping relationship between function names and function code segment addresses; The function determination module is used to determine, based on the target symbol table and the pointer information, multiple first function names that correspond one-to-one with the addresses of multiple function code segments included in the current stack information; The information determination module is used to determine, based on the thread identification information of the abnormal thread, the historical stack information of the abnormal thread running on other processes from multiple memory spaces that correspond one-to-one with multiple processes; the historical stack information includes multiple historical function code segment addresses, the first program to which the multiple historical function code segment addresses belong has different functions from the second program to which the multiple function code segment addresses belong, and each program corresponds to at least one symbol table; The second determining module is used to determine a plurality of second function names that correspond one-to-one with the addresses of the plurality of historical function code segments, based on a historical target symbol table that matches the program to which the addresses of the plurality of historical function code segments belong; The information set determination module is used to determine a fault tracing information set based on the addresses of the plurality of function code segments, the addresses of the plurality of historical function code segments, the plurality of first function names, and the plurality of second function names.

9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Embedded system progress abnormal tracking position-finding method

    CN101211309A

  • Method for collecting abnormal information of application program and related equipment

    CN118152171A