A thread analysis method and apparatus

By extracting thread identification from stack information and using a symbol table index, the method efficiently identifies and analyzes thread issues, addressing the inefficiencies of traditional symbol table verification methods.

CN114647562BActive Publication Date: 2025-07-15BEIJING GAOTU YUNJI EDUCATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210376620.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-07-15
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

The prior art requires a lot of computing resources and time when looking up symbol table files required for thread analysis, resulting in low efficiency.

Method used

By obtaining the stack information of the target thread, extracting the target identification information of the target executable file, and quickly determining the target symbol table file based on the index file of the symbol table file, and using the target symbol table file and stack information for problem analysis.

Benefits of technology

It realizes the rapid search of the target symbol table files corresponding to the target executable file, avoiding search and verification one by one, and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647562B_ABST
    Figure CN114647562B_ABST
Patent Text Reader

Abstract

The present disclosure provides a thread analysis method and apparatus. First, stack information of a target thread is obtained; then, target identification information of a target executable file is extracted from the stack information; secondly, based on an index file of a symbol table file, a target symbol table file matching the target identification information is determined; finally, problem analysis of the target thread is performed based on the target symbol table file and the stack information. In the embodiments of the present disclosure, through the target identification information of the target executable file extracted from the stack information and the index file of the symbol table file, the target symbol table file corresponding to the target executable file can be quickly found, without searching and verifying one by one, and the efficiency is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a thread analysis method and apparatus. Background Art

[0002] During the process of using the client of an application, situations such as lag and crash often occur. After the lag or crash, the thread problems can be analyzed and located through the running log. Usually, the running log is not intuitive and clear, and developers need to analyze it in combination with the symbol table file.

[0003] Since there are a large number of symbol table files in the entire running system, it requires a large amount of computing resources and time to find the symbol table file required for thread analysis and verify its correctness, and the efficiency is low. Summary of the Invention

[0004] Embodiments of the present disclosure at least provide a thread analysis method and apparatus.

[0005] In a first aspect, an embodiment of the present disclosure provides a thread analysis method, including:

[0006] Obtaining stack information of a target thread;

[0007] Extracting target identification information of a target executable file from the stack information;

[0008] Determining a target symbol table file that matches the target identification information based on an index file of the symbol table file;

[0009] Performing problem analysis on the target thread based on the target symbol table file and the stack information.

[0010] In an optional implementation manner, the method further includes:

[0011] Responding to a thread crash event, and obtaining a running log corresponding to the thread crash event;

[0012] Determining stack information of a target thread that crashes based on the running log.

[0013] In an optional implementation manner, the determining a target symbol table file that matches the target identification information based on an index file of the symbol table file includes:

[0014] Determining a target symbol table file that matches the target identification information based on a mapping relationship between the symbol table file indicated in the index file and the identification information of the executable file.

[0015] In an optional implementation manner, the index file of the symbol table file is generated through the following steps:

[0016] Obtain the full symbol table file;

[0017] Determine the identification information of the executable files corresponding to the full symbol table files respectively;

[0018] Based on the identification information of the executable files corresponding to the full symbol table files respectively, establish a mapping relationship between the symbol table files and the identification information of the executable files;

[0019] Generate an index file for the symbol table file based on the mapping relationship.

[0020] In an alternative implementation, the problem analysis of the target thread based on the target symbol table file and the stack information includes:

[0021] Based on the offset of each piece of code indicated by the target symbol table file in the memory address and the memory address indicated by the stack information, determine the target code corresponding to the target thread;

[0022] Perform problem analysis on the target thread based on the target code.

[0023] In an alternative implementation, the generating the index file for the symbol table file based on the mapping relationship includes:

[0024] Obtain the description information of the executable file corresponding to the full symbol table file;

[0025] Generate the index file for the symbol table file based on the mapping relationship and the description information.

[0026] In an alternative implementation, the symbol table file includes at least one of a system symbol table file, an application symbol table file, and a software development kit symbol table file; the description information of the executable file includes at least one of the central processing unit architecture of the system, the system version information, the application version information, and the software development kit version information.

[0027] In a second aspect, an embodiment of the present disclosure further provides a thread analysis device, including:

[0028] An acquisition module, configured to acquire the stack information of a target thread;

[0029] An extraction module, configured to extract the target identification information of a target executable file from the stack information;

[0030] An index module, configured to determine a target symbol table file that matches the target identification information based on the index file of the symbol table file;

[0031] An analysis module for analyzing problems of the target thread based on the target symbol table file and the stack information.

[0032] In an alternative implementation, the obtaining module is further configured to:

[0033] In response to a thread crash event, obtain the running log corresponding to the thread crash event;

[0034] Based on the running log, determine the stack information of the target thread where the crash occurred.

[0035] In an alternative implementation, the indexing module is specifically configured to:

[0036] Based on the mapping relationship between the symbol table file and the identification information of the executable file indicated in the index file, determine the target symbol table file that matches the target identification information.

[0037] In an alternative implementation, the apparatus further includes a generation module for:

[0038] Obtain the full set of symbol table files;

[0039] Determine the identification information of the executable files corresponding to the full set of symbol table files respectively;

[0040] Based on the identification information of the executable files corresponding to the full set of symbol table files respectively, establish a mapping relationship between the symbol table file and the identification information of the executable file;

[0041] Based on the mapping relationship, generate an index file for the symbol table file.

[0042] In an alternative implementation, the analysis module is specifically configured to:

[0043] Based on the offsets of each section of code indicated in the target symbol table file in the memory address, and the memory address indicated in the stack information, determine the target code corresponding to the target thread;

[0044] Based on the target code, analyze problems of the target thread.

[0045] In an alternative implementation, when generating the index file for the symbol table file based on the mapping relationship, the generation module is specifically configured to:

[0046] Obtain the description information of the executable files corresponding to the full set of symbol table files;

[0047] Based on the mapping relationship and the description information, generate the index file for the symbol table file.

[0048] In an alternative embodiment, the symbol table file includes at least one of a system symbol table file, an application symbol table file, and a software development kit symbol table file; the description information of the executable file includes at least one of a central processing unit architecture of the system, system version information, application version information, and software development kit version information.

[0049] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps in the above first aspect, or any possible implementation manner in the first aspect are executed.

[0050] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps in the above first aspect, or any possible implementation manner in the first aspect are executed.

[0051] For the thread analysis method and device provided by the embodiments of the present disclosure, first, stack information of a target thread is obtained; then, target identification information of a target executable file is extracted from the stack information; secondly, based on an index file of the symbol table file, a target symbol table file matching the target identification information is determined; finally, based on the target symbol table file and the stack information, problem analysis of the target thread is performed. By using the target identification information of the target executable file extracted from the stack information and the index file of the symbol table file, the embodiments of the present disclosure can quickly find the target symbol table file corresponding to the target executable file, without searching and verifying one by one, and the efficiency is relatively high.

[0052] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings

[0053] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required to be used in the embodiments will be briefly introduced below. The drawings herein are incorporated into the specification and constitute a part of this specification. These drawings show embodiments that conform to the present disclosure and are used together with the specification to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0054] Figure 1The flowchart of a thread analysis method provided by an embodiment of the present disclosure is shown;

[0055] Figure 2 In the thread analysis method provided by an embodiment of the present disclosure, the flowchart of generating an index file is shown;

[0056] Figure 3 The schematic diagram of a thread analysis device provided by an embodiment of the present disclosure is shown;

[0057] Figure 4 The schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. Detailed implementation manners

[0058] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some of the embodiments of the present disclosure, rather than all the embodiments. Usually, the components of the embodiments of the present disclosure described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.

[0059] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0060] The term "and / or" in this document only describes an association relationship and means that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" in this document means any one of a plurality or any combination of at least two of a plurality. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set composed of A, B, and C.

[0061] In view of the defect that a large amount of computing resources and time are required to search for a symbol table file in the prior art, resulting in low efficiency, embodiments of the present disclosure provide a thread analysis method and apparatus. First, stack information of a target thread is obtained; then, target identification information of a target executable file is extracted from the stack information; secondly, based on an index file of a symbol table file, a target symbol table file matching the target identification information is determined; finally, based on the target symbol table file and the stack information, problem analysis is performed on the target thread. By using the target identification information of the target executable file extracted from the stack information and the index file of the symbol table file, embodiments of the present disclosure can quickly find the target symbol table file corresponding to the target executable file, without searching and verifying one by one, and the efficiency is high.

[0062] To facilitate understanding of this embodiment, first, a thread analysis method disclosed in embodiments of the present disclosure will be introduced in detail. The execution subject of the thread analysis method provided in embodiments of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementation manners, the thread analysis method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0063] See Figure 1 As shown in the flowchart of the thread analysis method provided in embodiments of the present disclosure, the method includes steps S101 to S104, where:

[0064] S101. Obtain stack information of a target thread.

[0065] In this step, an application can be assigned one or more processes, and the processes can run multiple threads in parallel. A thread is the basic unit of central processing unit (CPU) scheduling and allocation, and a process is the smallest unit for the system to allocate resources (CPU, memory, etc.). Usually, memory can be allocated to a thread as a stack, and the thread can operate on the stack to implement calls to code functions. A stack is a specific storage area or register that can store data such as parameter values of functions and values of local variables.

[0066] Specifically, during the operation of an application, a thread crash event may occur. The state of the thread during operation can be monitored, and the running log generated during its operation can be saved. When a thread crash event occurs, the running log corresponding to the thread crash event is obtained, and then the stack information of the target thread that crashed is extracted from the obtained running log.

[0067] Since stack information is usually in the form of memory addresses identified by machine language and it is difficult to see the actual meaning, it needs to be converted into a readable form to be meaningful. Therefore, the code fields corresponding to the stack information can be obtained through a symbol table file.

[0068] S102. Extract the target identification information of the target executable file from the stack information.

[0069] In this step, the identification information of the target executable file included in the stack information can be identified first. Among them, the identification information of the executable file can be a Universally Unique Identifier (UUID), which is a globally unique identification information.

[0070] Specifically, the identification information included in the stack information can be identified by the regular recognition method.

[0071] S103. Based on the index file of the symbol table file, determine the target symbol table file that matches the target identification information.

[0072] In this step, since the number of symbol table files is too large, if each symbol table file is searched and verified, it will consume a large amount of computing resources and time. The index file of the symbol table file deployed in advance can be obtained to match the target identification information with the target symbol table file.

[0073] Among them, the index file of the symbol table file can indicate the mapping relationship between each symbol table file and the identification information of its corresponding executable file. Specifically, the target identification information of the target symbol table file can be searched in the index file. After the target identification information is searched, the target symbol table file corresponding to the target identification information can be determined according to the mapping relationship indicated in the index file.

[0074] In a possible implementation manner, the index file of the symbol table file can be generated through the following steps:

[0075] S1101. Obtain the full set of symbol table files.

[0076] In this step, the full set of symbol table files of the entire operating system, application programs, and SDK can be collected and obtained so that the generated index file can cover all symbol table files.

[0077] S1102. Determine the identification information of the executable files corresponding to the full set of symbol table files respectively.

[0078] In this step, the description information of the symbol table file can be read to obtain the identification information of its corresponding executable file.

[0079] Among them, the collected symbol table files can include types such as system symbol table files, application symbol table files, and software development kit symbol table files. The executable file corresponding to the system symbol table file is a system file, which can be divided into different files according to the central processing unit architecture of the system and different system version information; the executable file of the application symbol table file can be an application program file, which can be divided into different files according to the application version information, and the executable file of the software development kit symbol table file can be a software development kit file, which can be divided into different files according to the software development kit version. The above information can be used to reflect the characteristics of the symbol table file, and can obtain the corresponding system version information, central processing unit architecture, firmware version information (version information of the application program or software development kit), etc. while obtaining the identification information of the executable file.

[0080] S1103. Based on the identification information of the executable files respectively corresponding to the full set of symbol table files, establish the mapping relationship between the identification information of the symbol table files and the executable files.

[0081] In this step, the mapping relationship between the identification information of the symbol table file and the executable file can be established according to the extracted identification information and the corresponding relationship between the symbol table file from which the identification information is extracted. Exemplarily, the mapping relationship can be in the form of "identification information A - symbol table file a".

[0082] S1104. Based on the mapping relationship, generate the index file of the symbol table file.

[0083] In this step, the above-determined mapping relationship can be sorted into a table form to form an index file containing multiple mapping relationships.

[0084] Here, the system version information, central processing unit architecture, firmware version information (version information of the application program or software development kit), etc. corresponding to the above symbol table file can also be added to the index file to form a mapping relationship with the symbol table file and the identification information. When determining the target symbol table file corresponding to the target identification information based on the index file, the system version information, central processing unit architecture, firmware version information (version information of the application program or software development kit), etc. corresponding to the target identification information can also be determined, which is convenient for problem analysis of the target thread.

[0085] S104. Based on the target symbol table file and the stack information, conduct problem analysis on the target thread.

[0086] Among them, the target symbol table file indicates the offsets of each segment of function code of the executable file in the memory address. Through the target symbol table file, the memory address indicated in the stack information can be translated to obtain the target code corresponding to the target thread.

[0087] After determining the target code corresponding to the target thread, based on information such as the target code itself, the system version information of its corresponding executable file, the central processing unit architecture, and the firmware version information (version information of the application or software development kit), the preset problem analysis logic can be used to perform problem analysis, so as to locate the problem of thread crash and enable developers to repair the problematic code.

[0088] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation to the implementation process. The specific execution order of each step should be determined according to its function and possible internal logic.

[0089] Based on the same inventive concept, an embodiment of the present disclosure also provides a thread analysis device corresponding to the thread analysis method. Since the principle of solving problems by the device in the embodiment of the present disclosure is similar to the above thread analysis method of the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0090] Refer to Figure 3 As shown, it is a schematic diagram of a thread analysis device provided by an embodiment of the present disclosure. The device includes:

[0091] An acquisition module 310, configured to acquire the stack information of the target thread;

[0092] An extraction module 320, configured to extract the target identification information of the target executable file from the stack information;

[0093] An indexing module 330, configured to determine a target symbol table file that matches the target identification information based on the index file of the symbol table file;

[0094] An analysis module 340, configured to perform problem analysis on the target thread based on the target symbol table file and the stack information.

[0095] Through the target identification information of the target executable file extracted from the stack information and the index file of the symbol table file in the embodiment of the present disclosure, the target symbol table file corresponding to the target executable file can be quickly found, without searching and verifying one by one, and the efficiency is relatively high.

[0096] In an optional implementation manner, the acquisition module 310 is further configured to:

[0097] In response to a thread crash event, acquire the running log corresponding to the thread crash event;

[0098] Based on the running log, determine the stack information of the target thread that has crashed.

[0099] In an alternative embodiment, the index module 330 is specifically configured to:

[0100] Based on the mapping relationship between the symbol table file indicated in the index file and the identification information of the executable file, determine the target symbol table file that matches the target identification information.

[0101] In an alternative embodiment, the device further includes a generation module, configured to:

[0102] Obtain the full set of symbol table files;

[0103] Determine the identification information of the executable files corresponding to the full set of symbol table files respectively;

[0104] Based on the identification information of the executable files corresponding to the full set of symbol table files respectively, establish a mapping relationship between the symbol table file and the identification information of the executable file;

[0105] Based on the mapping relationship, generate an index file of the symbol table file.

[0106] In an alternative embodiment, the analysis module 340 is specifically configured to:

[0107] Based on the offsets of each section of code indicated in the target symbol table file in the memory address, and the memory address indicated by the stack information, determine the target code corresponding to the target thread;

[0108] Based on the target code, perform problem analysis on the target thread.

[0109] In an alternative embodiment, when the generation module generates the index file of the symbol table file based on the mapping relationship, it is specifically configured to:

[0110] Obtain the description information of the executable files corresponding to the full set of symbol table files;

[0111] Based on the mapping relationship and the description information, generate an index file of the symbol table file.

[0112] In an alternative embodiment, the symbol table file includes at least one of a system symbol table file, an application symbol table file, and a software development kit symbol table file; the description information of the executable file includes at least one of the central processing unit architecture of the system, the system version information, the application version information, and the software development kit version information.

[0113] For the description of the processing flow of each module in the device and the interaction flow between modules, reference may be made to the relevant descriptions in the above method embodiments, which will not be elaborated here.

[0114] Corresponding toFigure 1 For the thread analysis method in [reference], an embodiment of the present disclosure also provides an electronic device 400, as Figure 4 shown, which is a schematic structural diagram of the electronic device 400 provided by an embodiment of the present disclosure, including:

[0115] A processor 41, a memory 42, and a bus 43; the memory 42 is used to store execution instructions, including an internal memory 421 and an external memory 422; here, the internal memory 421 is also called the main memory, which is used to temporarily store the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk. The processor 41 exchanges data with the external memory 422 through the internal memory 421. When the electronic device 400 runs, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions:

[0116] Obtain the stack information of the target thread;

[0117] Extract the target identification information of the target executable file from the stack information;

[0118] Based on the index file of the symbol table file, determine the target symbol table file that matches the target identification information;

[0119] Based on the target symbol table file and the stack information, perform problem analysis on the target thread.

[0120] In an optional implementation manner, the processor 41 is further configured to execute:

[0121] In response to a thread crash event, obtain the running log corresponding to the thread crash event;

[0122] Based on the running log, determine the stack information of the target thread that has crashed.

[0123] In an optional implementation manner, when the processor 41 executes to determine the target symbol table file that matches the target identification information based on the index file of the symbol table file, it is specifically configured to execute:

[0124] Based on the mapping relationship between the symbol table file indicated in the index file and the identification information of the executable file, determine the target symbol table file that matches the target identification information.

[0125] In an optional implementation manner, the processor 41 is further configured to execute:

[0126] Obtain the full set of symbol table files;

[0127] Determine the identification information of the executable files corresponding to the full set of symbol table files respectively;

[0128] Based on the identification information of the executable files respectively corresponding to the full set of symbol table files, establish a mapping relationship between the symbol table files and the identification information of the executable files;

[0129] Based on the mapping relationship, generate an index file for the symbol table file.

[0130] In an optional implementation manner, when the processor 41 executes the problem analysis of the target thread based on the target symbol table file and the stack information, it is specifically configured to execute:

[0131] Based on the offsets of each section of code indicated by the target symbol table file in the memory address, and the memory address indicated by the stack information, determine the target code corresponding to the target thread;

[0132] Based on the target code, perform problem analysis on the target thread.

[0133] In an optional implementation manner, when the processor 41 executes the generation of the index file for the symbol table file based on the mapping relationship, it is specifically configured to execute:

[0134] Obtain the description information of the executable files corresponding to the full set of symbol table files;

[0135] Based on the mapping relationship and the description information, generate an index file for the symbol table file.

[0136] In an optional implementation manner, the symbol table file includes at least one of a system symbol table file, an application symbol table file, and a software development kit symbol table file; the description information of the executable file includes at least one of the central processing unit architecture of the system, the system version information, the application version information, and the software development kit version information.

[0137] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, it executes the steps of the thread analysis method described in the above method embodiments. Among them, the storage medium can be a volatile or non-volatile computer-readable storage medium.

[0138] The embodiments of the present disclosure also provide a computer program product, which carries program codes, and the instructions included in the program codes can be used to execute the steps of the thread analysis method described in the above method embodiments. For specific details, refer to the above method embodiments and will not be elaborated here.

[0139] Among them, the above computer program product can be specifically implemented in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), and so on.

[0140] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein. In several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0141] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0142] In addition, in each embodiment of the present disclosure, the functional units can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0143] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.

[0144] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of the present disclosure, used to illustrate the technical solutions of the present disclosure, rather than limiting them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; 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 disclosure and should all be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A thread analysis method, characterized in that, Including: Obtain the stack information of the target thread; Extract the target identification information of the target executable file from the stack information; Based on the index file of the symbol table file, determine the target symbol table file that matches the target identification information; Based on the target symbol table file and the stack information, perform problem analysis on the target thread; The determining the target symbol table file that matches the target identification information based on the index file of the symbol table file includes: Based on the mapping relationship between the identification information of the symbol table file and the executable file indicated in the index file, determine the target symbol table file that matches the target identification information; Generate the index file of the symbol table file through the following steps: Obtain the full set of symbol table files; Determine the identification information of the executable files corresponding to the full set of symbol table files respectively; Based on the identification information of the executable files corresponding to the full set of symbol table files respectively, establish the mapping relationship between the symbol table file and the identification information of the executable file; Obtain the description information of the executable files corresponding to the full set of symbol table files; Based on the mapping relationship and the description information, generate the index file of the symbol table file; The symbol table file includes at least one of the system symbol table file, the application symbol table file, and the software development kit symbol table file; the description information of the executable file includes at least one of the central processing unit architecture of the system, the system version information, the application version information, and the software development kit version information.

2. The method according to claim 1, wherein The method further includes: In response to a thread crash event, obtain the running log corresponding to the thread crash event; Based on the running log, determine the stack information of the target thread that crashed.

3. The method according to claim 1, characterized in that, The performing problem analysis on the target thread based on the target symbol table file and the stack information includes: Based on the offset of each section of code indicated by the target symbol table file in the memory address and the memory address indicated by the stack information, determine the target code corresponding to the target thread; Based on the target code, perform problem analysis on the target thread.

4. A thread analysis device, characterized in that, Including: An obtaining module, configured to obtain the stack information of the target thread; An extracting module, configured to extract the target identification information of the target executable file from the stack information; An indexing module, configured to determine the target symbol table file that matches the target identification information based on the index file of the symbol table file; An analyzing module, configured to perform problem analysis on the target thread based on the target symbol table file and the stack information; The indexing module is specifically configured to: Based on the mapping relationship between the identification information of the symbol table file and the executable file indicated in the index file, determine the target symbol table file that matches the target identification information; Generate the index file of the symbol table file through the following steps: Obtain the full set of symbol table files; Determine the identification information of the executable files corresponding to the full set of symbol table files respectively; Based on the identification information of the executable files corresponding to the full set of symbol table files respectively, establish the mapping relationship between the symbol table file and the identification information of the executable file; Obtain the description information of the executable file corresponding to the full symbol table file; Generate an index file for the symbol table file based on the mapping relationship and the description information; The symbol table file includes at least one of a system symbol table file, an application symbol table file, and a software development kit symbol table file; the description information of the executable file includes at least one of the central processing unit architecture of the system, system version information, application version information, and software development kit version information.

5. An electronic device, characterized in that, Comprising: A processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the thread analysis method according to any one of claims 1 to 3 are executed.

6. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by the processor, the steps of the thread analysis method according to any one of claims 1 to 3 are executed.

Citation Information

Patent Citations

  • Crash file analysis method and device, electronic equipment and storage medium

    CN112199224A