Stack information symbolization method and device, equipment, storage medium and product

By automatically determining the file address and function name of stack information on a Linux server, the problem of low efficiency in stack information symbolization is solved, achieving efficient and economical symbolization services and breaking the dependence on the Mac platform.

CN121168411APending Publication Date: 2025-12-19GUANGZHOU NETSTAR INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511280749.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

In existing technologies, the symbolization of stack information is inefficient, especially when the number of users is large, requiring developers to manually symbolize each item one by one, resulting in low efficiency. Furthermore, existing tools have poor compatibility with the iOS system and cannot run efficiently on non-Mac platforms.

Method used

By acquiring symbolic files and debugging metadata, the address of stack information in the file is determined. When the debugging information entity is an inline function type, the associated debugging information entity is determined based on the abstract origin information, and the function name and line number corresponding to the stack information are automatically determined, supporting the deployment of symbolic services on Linux servers.

Benefits of technology

It achieves efficient symbolization of stack information, improves symbolization efficiency, reduces dependence on Mac hardware, lowers maintenance costs, and enhances system availability and cost-effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168411A_ABST
    Figure CN121168411A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a stack information symbolization method and device, equipment, a storage medium and a product. According to the technical scheme provided by the embodiment of the invention, the file address of the stack information in the symbolized file is determined by obtaining the symbolized file, the debugging meta-information and the stack information to be symbolized, the debugging information entity containing the file address is determined in the debugging meta-information, and when the debugging information entity is in the inline function type, the stack information to be symbolized is debugged. The associated debugging information entity is determined according to the abstract origin information recorded in the debugging information entity, and the function name corresponding to the stack information is determined according to the associated debugging information entity, so that a developer does not need to manually symbolize the stack information one by one, the stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a stack information symbolization method, device, equipment, storage medium and product. BACKGROUND

[0002] When an application (for example, an iOS application) has an abnormal situation such as a crash, a lag, a memory overflow and the like online, stack information when the application has the abnormal situation is usually collected, and then is sent to a developer to locate a problem, so as to help the developer to solve and optimize a problem of the application and improve user experience.

[0003] The stack information only contains a memory address, and needs to be symbolized by a symbol file to obtain function name, file name and line number information which are convenient to read. In the related art, when a user quantity is large, a developer needs to symbolize the stack information one by one in the face of a large amount of stack information, and the efficiency of stack information symbolization is low. SUMMARY

[0004] Embodiments of the present application provide a stack information symbolization method, device, equipment, storage medium and product, which determine a file address of stack information in a symbolization file, determine a debugging information entity containing the file address in debugging meta information, determine an associated debugging information entity according to abstract origin information recorded in the debugging information entity when the debugging information entity is of an inline function type, and determine a function name corresponding to the stack information according to the associated debugging information entity, so that the developer does not need to manually symbolize the stack information one by one, the technical problem that the developer needs to symbolize the stack information one by one in the related art and the efficiency of stack information symbolization is low can be effectively solved, the stack information can be accurately and efficiently symbolized, and the efficiency of stack information symbolization is improved.

[0005] In a first aspect, embodiments of the present application provide a stack information symbolization method, comprising: obtaining a symbolization file, debugging meta information and stack information to be symbolized, and determining a file address of the stack information in the symbolization file; determining a debugging information entity containing the file address in the debugging meta information; in a case where a type of the debugging information entity is an inline function type, determining an associated debugging information entity according to abstract origin information recorded in the debugging information entity; determining a function name corresponding to the stack information according to the associated debugging information entity to obtain a symbolization result of the stack information.

[0006] In a second aspect, embodiments of the present application provide a stack information symbolization device, comprising an address determination module, an entity determination module, an inline processing module and a symbolization processing module, wherein: The address determining module is configured to obtain a symbolized file, debugging meta information, and stack information to be symbolized, and determine a file address of the stack information in the symbolized file; The entity determining module is configured to determine, in the debugging meta information, a debugging information entity containing the file address; The inline processing module is configured to, in a case where a type of the debugging information entity is an inline function type, determine an associated debugging information entity according to abstract origin information recorded in the debugging information entity; The symbolization processing module is configured to determine a function name corresponding to the stack information according to the associated debugging information entity, to obtain a symbolization result of the stack information.

[0007] In a third aspect, an embodiment of the present application provides a symbolization service method of stack information, comprising: receiving a symbolization request, and determining stack information corresponding to the symbolization request; performing symbolization processing on the stack information through a set symbolization script, to obtain a symbolization result corresponding to the stack information, wherein the symbolization script is configured to execute the stack information symbolization method in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a stack information symbolization device, comprising a memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the stack information symbolization method in the first aspect or the symbolization service method of stack information in the third aspect.

[0009] In a fifth aspect, an embodiment of the present application provides a nonvolatile storage medium storing computer executable instructions, which are used to execute the stack information symbolization method in the first aspect or the symbolization service method of stack information in the third aspect when executed by a computer processor.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program stored in a computer readable storage medium, and at least one processor of a device reads and executes the computer program from the computer readable storage medium, so that the device executes the stack information symbolization method in the first aspect or the symbolization service method of stack information in the third aspect.

[0011] The embodiment of the present application determines the file address of the stack information in the symbolization file, determines the debugging information entity containing the file address in the debugging meta information, when the debugging information entity is an inline function type, determines the associated debugging information entity according to the abstract origin information recorded in the debugging information entity, and determines the function name corresponding to the stack information according to the associated debugging information entity, without manually symbolizing the stack information one by one by the developer, so that the stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is a flowchart of a stack information symbolization method provided by the embodiment of the present application; Figure 2 is a flowchart of another stack information symbolization method provided by the embodiment of the present application; Figure 3 is a flowchart of a stack information symbolization service method provided by the embodiment of the present application; Figure 4 is a structural schematic diagram of a stack information symbolization device provided by the embodiment of the present application; Figure 5 is a structural schematic diagram of a stack information symbolization device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0013] In order to make the objects, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in combination with the drawings. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted by flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The above processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The above processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0014] The stack information symbolization method provided by the present application can be applied to the symbolization processing of stack information, wherein the stack information can be the stack information of macOS system, iOS system, or the stack information of Android system, Linux system, etc.

[0015] In the existing stack information symbolization scheme, when obtaining an application stack report, the stack information in the application stack report only contains memory addresses, and the stack information needs to be restored to human-readable function name, file name and line number information and the like by associating a file. The symbolization of the stack information generally relies on a symbolization file (for example, a Mach-O file, a binary file format used for executable files, dynamic libraries, kernel extensions and the like in a system (for example, a macOS and iOS system), which defines the organization of the code, data, symbols and the like of a program in memory) for symbolization, and the symbolization file can include a dSYM (Debug Symbol) file and a system symbol file and the like, the dSYM file contains information required for mapping memory addresses back to source code symbols (such as function names and line numbers), and can be used for the symbolization of stack information in a crash log, and the system symbol file is a Mach-O file containing symbol information, but the information contained is less detailed than the dSYM file, and it generally records part of the symbol information (such as a universally unique identifier UUID, an architecture, and part of a function name). For the symbolization of stack information of the macOS system and the iOS system, the provided symbolization tool (for example, atos) can generally only run on a Mac platform, and cannot be used for symbolization on a system commonly used for servers (for example, a Linux system), and the Mac platform is not suitable for servers, and if a symbolization service is deployed on the Mac platform, the stability of the service will be poor, and the compatibility of this stack information symbolization for the iOS system is poor, and problems such as the inability to resolve part of the symbols, poor readability of the resolved symbols, the lack of support for multiple architectures, and the inability to obtain architecture information are likely to occur. When the number of users is large, the developers still need to symbolize a large amount of stack information one by one, and the efficiency of the stack information symbolization is low. Based on this, a stack information symbolization method is provided in the embodiments of the present application to solve the technical problem of low efficiency of the existing stack information symbolization.

[0016] Figure 1 A flowchart of the stack information symbolization method provided in the embodiments of the present application is given, and the stack information symbolization method provided in the embodiments of the present application can be executed by a stack information symbolization device, which can be realized by hardware and / or software and integrated in a stack information symbolization apparatus.

[0017] The stack information symbolization method is described below by taking the stack information symbolization device as an example. Referring to Figure 1 , the stack information symbolization method comprises the following steps. S110: Obtain a symbolization file, debug meta information and stack information to be symbolized, and determine a file address of the stack information in the symbolization file.

[0018] Exemplarily, a symbolization file, debug meta information (Debug_info) and stack information to be symbolized are acquired, and the file address of the stack information in the symbolization file is determined.

[0019] The debug meta information can be determined in the symbolization file, the symbolization file can be a binary file in Mach-O format, and the symbolization file can include a symbol table (Symbol table) and a debug record format file (DWARF file) with attributes. The symbol table is a file containing a section for recording debug meta information, but not containing a section for recording debug line information (debug_line). The debug record format file is a file containing a section for recording debug line information and a section for recording debug meta information.

[0020] The debug meta information is core information in the debug record format file, and the debug record format file can use a debug information entity (DIE, the debugging information entry) to describe the debug meta information. Each debug information entity contains a tag (TAG) and multiple attributes. The tag is used to indicate the type of the current debug information entity, and the type of the debug information entity includes a function (non-inlined function, DW_TAG_subprogram), an inlined function (DW_TAG_inlined_subroutine), an r-formal parameter (DW_TAG_formal_paramete), a variable (DW_TAG_variable), a basic type (DW_TAG_base_type), a compilation unit (DW_TAG_compile_unit), etc. For the function type debug information entity, there are some key attributes, such as the start memory address and the end memory address of the function (DW_AT_low_pc, DW_AT_high_pc), the function name (DW_AT_name, DW_AT_linkage_name and DW_AT_MIPS_linkage_name), the file name and the line number of the function declaration (DW_AT_decl_file and DW_AT_decl_line). If the debug information entity is of the compilation unit type, a compilation unit can be understood as a compiled source file, which will have some key attributes recorded, such as the language of the current compilation unit (DW_AT_language), the line number information of the current compilation unit (DW_AT_stmt_list, the offset in the section corresponding to the debug line information, which can be used to find the corresponding line number and file name), and the start and end addresses of all functions corresponding to the compilation unit (DW_AT_low_pc, DW_AT_high_pc).

[0021] In one possible embodiment, in the stack information symbolization method provided in the present application, the file address of the stack information in the symbolization file is determined, including: determining the record address and the image loading address of the stack information, and the reference address of the symbolization file; calculating the address offset value according to the record address and the image loading address, and calculating the file address of the stack information in the symbolization file according to the address offset value and the reference address.

[0022] For example, the record address (runtime_address) and the image loading address (load_address) of the stack information are determined, and the reference address (vm_address) of the symbolization file is determined, wherein the image loading address is the loading address of the image (the image corresponding to the application program, the front-end framework UIKit, etc.) corresponding to the stack information, and the reference address can be understood as the address recorded in the symbolization file by the architecture corresponding to the application program or the front-end framework UIKit.

[0023] After the record address, the image loading address and the reference address are determined, the address offset value can be obtained by subtracting the image loading address from the record address, and the file address of the stack information in the symbolization file can be obtained by adding the address offset value and the reference address. Alternatively, the file address of the stack information in the symbolization file can be expressed as: file_address=runtime_address-load_address+vm_address. According to the record address and the image loading address, the address offset value is calculated, and the file address of the stack information in the symbolization file is accurately determined according to the address offset value and the reference address, so that the debugging information entity can be accurately determined in the debugging meta information, and the stack information can be accurately symbolized based on the debugging information entity.

[0024] S120: determining the debugging information entity containing the file address in the debugging meta information.

[0025] For example, after the file address of the stack information in the symbolization file is determined, the debugging information entity containing the file address can be determined in the debugging meta information. For example, the memory address range corresponding to each debugging information entity in the symbolization file is determined, the memory address range in which the file address is located is determined, and the debugging information entity corresponding to the determined memory address range is determined as the debugging information entity containing the file address. Alternatively, the memory address range can be determined by the starting memory address (DW_AT_low_pc) and the ending memory address (DW_AT_high_pc) of the debugging information entity.

[0026] S130: in the case where the type of the debugging information entity is an inline function type, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity.

[0027] The type of the debug information entity provided in the present application includes an inline function type and a non-inline function type. If the type of the debug information entity is the inline function type, the function name needs to be the function name of the inline function, rather than the declared function name.

[0028] For example, after determining the debug information entity, the type of the debug information entity is determined. When the type of the debug information entity is the inline function type, the associated debug information entity can be determined according to the abstract origin information (DW_AT_abstract_origin) recorded in the debug information entity.

[0029] S140: determining the function name corresponding to the stack information according to the associated debug information entity to obtain the symbolic result of the stack information.

[0030] For example, according to the function name corresponding to the associated debug information entity determined above, the function name corresponding to the associated debug information entity is determined as the function name corresponding to the stack information, and the function name can be used as the symbolic result of the stack information.

[0031] In one possible embodiment, in the stack information symbolization method provided in the present application, the function name corresponding to the stack information is determined according to the associated debug information entity, which includes: determining the function name corresponding to the stack information in one or more combinations of the linkage name (DW_AT_linkage_name), the MIPS linkage name (DW_AT_MIPS_linkage_name), and the source code name (DW_AT_name) recorded in the associated debug information entity. Optionally, the linkage name, the MIPS linkage name, and the source code name can be obtained in the order from high to low priority of the linkage name, the MIPS linkage name, and the source code name, and when the function name is obtained (i.e., one function name is obtained), the obtained function name is determined as the function name corresponding to the stack information. The present application determines the function name corresponding to the stack information according to the linkage name, the MIPS linkage name, and the source code name recorded in the associated debug information entity, and accurately symbolizes the stack information.

[0032] In one possible embodiment, in addition to the function name corresponding to the stack information, the symbolic result provided in the present application can also include the file name and the line number corresponding to the stack information. Based on this, in the stack information symbolization method provided in the present application, after determining the associated debug information entity according to the abstract origin information recorded in the debug information entity, it further includes: determining the file name corresponding to the stack information according to the inline call file attribute in the abstract origin information; and determining the line number corresponding to the stack information according to the inline line number information in the abstract origin information.

[0033] The debugging line number information is located in a section containing corresponding line number and file name information in the corresponding compilation unit. The line number information can be determined by finding the line information in the line greater than the file address. The file index (File_index) is obtained and the corresponding file name is obtained from the file name (file_names) list of the debugging line number information. If the function is an inline function, the file name and line number should be based on the file name and line number at the inline position, not the declaration position.

[0034] The abstract origin information is a key (key) in the inline function (DW_TAG_inlined_subroutine). The abstract origin information also records the file name and line number (DW_AT_call_file and DW_AT_call_line). The file name and line number corresponding to the stack information can be determined according to the file name and line number recorded in the abstract origin information.

[0035] For example, when the type of the debugging information entity is the inline function type, the actual inlined file name is found according to the inline call file attribute (DW_AT_call_file) in the abstract origin information, and the found file name is determined as the file name corresponding to the stack information. The actual inlined line number is found according to the inline line number information (DW_AT_call_line) in the abstract origin information, and the found line number is determined as the line number corresponding to the stack information.

[0036] According to the present application, the file name corresponding to the stack information is determined according to the inline call file attribute in the abstract origin information, and the line number corresponding to the stack information is determined according to the inline line number information in the abstract origin information. The stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved.

[0037] In one possible embodiment, in the stack information symbolization method provided by the present application, after determining the line number corresponding to the stack information according to the inline line number information in the abstract origin information, the method further includes: in the case that the determination of the file name and / or line number corresponding to the stack information fails, determining the file name and / or line number corresponding to the stack information in the debugging line number information associated with the debugging meta information.

[0038] Exemplarily, when the type of the debugging information entity is the inline function type, if the file name and / or the line number corresponding to the stack information fails to be determined according to the abstract origin information, the line number and / or the file name of the compilation declaration are searched in the debugging line number information associated with the debugging meta information, and the found line number and / or file name are determined as the file name and / or the line number corresponding to the stack information. The application accurately determines the line number corresponding to the stack information by determining the file name and / or the line number in the debugging line number information associated with the debugging meta information when the file name and / or the line number fails to be determined according to the abstract origin information, and accurately and efficiently symbolizes the stack information.

[0039] According to the above, by obtaining the symbolized file, the debugging meta information, and the stack information to be symbolized, determining the file address of the stack information in the symbolized file, determining the debugging information entity containing the file address in the debugging meta information, when the debugging information entity is of the inline function type, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity, and determining the function name corresponding to the stack information according to the associated debugging information entity, the stack information can be accurately and efficiently symbolized without manual symbolization of the stack information by the developer, and the symbolization efficiency of the stack information is improved. Furthermore, the file name corresponding to the stack information is determined according to the inline call file attribute in the abstract origin information, and the line number corresponding to the stack information is determined according to the inline line number information in the abstract origin information, so that the stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved.

[0040] Based on the above embodiment, Figure 2 A flowchart of another stack information symbolization method provided by the embodiment of the application is given, which is a specific embodiment of the above stack information symbolization method. Referring to Figure 2 The stack information symbolization method comprises: S210: obtaining the symbolized file, the debugging meta information, and the stack information to be symbolized, and determining the file address of the stack information in the symbolized file.

[0041] S220: determining the debugging information entity containing the file address in the debugging meta information.

[0042] S230: in the case where the type of the debugging information entity is the inline function type, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity.

[0043] S240: determining the function name corresponding to the stack information according to the associated debugging information entity, to obtain the symbolization result of the stack information.

[0044] S250: In a case where the type of the debug information entity is the non-inlined function type, determining the function name corresponding to the stack information according to the debug information entity to obtain the symbolization result of the stack information.

[0045] For example, in a case where the type of the debug information entity is the non-inlined function type, the function name corresponding to the stack information is determined according to the debug information entity, and the function name can be taken as the symbolization result of the stack information.

[0046] In one possible embodiment, in the stack information symbolization method provided in the present application, the function name corresponding to the stack information is determined according to the debug information entity, including: in the combination of one or more of the link symbol name, the MIPS link symbol name and the source code name recorded in the debug information entity, the function name corresponding to the stack information is determined. Optionally, the link symbol name, the MIPS link symbol name and the source code name can be obtained in order according to the priority from high to low, and when the function name is obtained (that is, one function name is obtained), the obtained function name is determined as the function name corresponding to the stack information. The present application accurately symbolizes the stack information by determining the function name corresponding to the stack information according to the link symbol name, the MIPS link symbol name and the source code name recorded in the debug information entity.

[0047] In one possible embodiment, in the stack information symbolization method provided in the present application, after the debug information entity containing the file address is determined in the debug meta information, further including: in a case where the type of the debug information entity is the non-inlined function type, and the function name corresponding to the stack information is failed to be determined according to the debug information entity, determining the associated debug information entity according to the offset information corresponding to the specification information recorded in the debug information entity; determining the function name corresponding to the stack information according to the associated debug information entity to obtain the symbolization result of the stack information.

[0048] For example, in a case where the type of the debug information entity is the non-inlined function type, and the function name corresponding to the stack information is failed to be determined according to the debug information entity, the associated debug information entity is searched according to the offset information (offset) corresponding to the specification information (DW_AT_specification) recorded in the debug information entity.

[0049] In one embodiment, the function name corresponding to the associated debug information entity is determined (for example, the function name is determined according to the priority of the link symbol name, the MIPS link symbol name and the source code name in the associated debug information entity), and the function name corresponding to the associated debug information entity in the associated debug information entity is determined as the function name corresponding to the stack information, and the function name can be taken as the symbolization result of the stack information.

[0050] The application guarantees correct acquisition of the function name corresponding to the stack information, and improves the symbolization accuracy of the stack information, by determining the associated debugging information entity according to the offset information corresponding to the specification information recorded by the debugging information entity when the type of the debugging information entity is a non-inlined function type and the function name corresponding to the stack information fails to be determined according to the debugging information entity.

[0051] In one possible embodiment, in the stack information symbolization method provided by the application, after the debugging information entity containing the file address is determined in the debugging meta information, the file name and the line number corresponding to the stack information can be determined in the debugging line number information associated with the debugging meta information. For example, the line number and the file name declared by the compilation are searched in the debugging line number information associated with the debugging meta information, and the found line number and file name are determined as the file name and the line number corresponding to the stack information, so that the stack information is accurately and efficiently symbolized.

[0052] In one embodiment, the symbolization file provided by the application includes a symbol table and a debugging record format file, wherein the symbol table does not contain a section for recording the debugging line number information, and the symbol table can be used for symbolization processing without detailed debugging information. Such symbolization scheme does not contain the file name and the line number information, and the stack information symbolization based on the symbol table can be used as an alternative symbolization scheme, and the stack information symbolization based on the debugging record format file can be used as a preferred symbolization scheme.

[0053] In one possible embodiment, in the stack information symbolization method provided by the application, after the file address of the stack information in the symbolization file is determined, the following steps are further included: determining whether the debugging line number information exists in the symbolization file; in the case that the debugging line number information does not exist in the symbolization file, determining an entry with the value of the file address in the symbolization file, and adding the table index in the entry to the table base address to obtain a target index; determining a target symbol at a position before the target index in the symbolization file, and determining the target symbol as the function name corresponding to the stack information.

[0054] For example, after the file address of the stack information in the symbolization file is determined, it is determined whether the debugging line number information exists in the symbolization file. If the debugging line number information exists in the symbolization file, the symbolization file is determined as the debugging record format file, and the stack information symbolization processing based on the debugging record format file is performed on the stack information (for details, refer to steps S110-S140 and steps S210-S250, which will not be described herein).

[0055] In one embodiment, when the debug line number information does not exist in the symbolization file, the symbolization file is determined as a symbol table, and the stack information is subjected to symbol table-based stack information symbolization processing. For example, an entry with a value as a file address is determined in the symbolization file, and a string table index in the entry is added to a string table base address to obtain a target index.

[0056] After the target index is determined, a target symbol with an index one bit before the target index is determined in the symbolization file (i.e., a symbol exactly smaller than the target index is found in the symbolization file), and the target symbol is determined as a function name corresponding to the stack information. The present application accurately and efficiently symbolizes the stack information by determining an entry with a value as a file address in the symbolization file when the debug line number information does not exist in the symbolization file, adding a string table index in the entry to a string table base address to obtain a target index, and determining a function name corresponding to the stack information in the symbolization file according to the target index.

[0057] In related technologies, to meet the high concurrency and stability requirements of symbolization tasks, multiple Mac devices are usually deployed to form a distributed symbolization cluster. Due to the high price of Mac hardware and the limitation of macOS system scheduling mechanism, the multi-core utilization rate is not high, and performance bottlenecks are easily formed. At the same time, deploying Mac in a non-professional computer room environment also needs to face uncertain factors such as power failure, network interruption, temperature control, etc., further increasing the maintenance cost and failure risk. The present application symbolizes the stack information, breaking through the limitation in related technologies that the iOS symbolization service must rely on the Mac hardware platform, and supports deployment and running on a Linux server. Since most current data centers are built based on Linux, they have perfect power guarantee, network stability, and automated operation and maintenance capabilities. The stack information symbolization scheme provided by the present application can be deployed in the existing server cluster of an enterprise, without the need for additional purchase, operation and maintenance of expensive and performance-limited Mac host devices. Relying on the excellent resource scheduling capability and stability of the Linux platform, a single server can support large-scale symbolization tasks, greatly reducing the hardware procurement, system maintenance, manpower management, and other aspects of operation and maintenance, and greatly improving the usability and economy of the symbolization system.

[0058] The above, by acquiring the symbolization file, the debugging meta information and the stack information to be symbolized, determining the file address of the stack information in the symbolization file, determining the debugging information entity containing the file address in the debugging meta information, when the debugging information entity is of the inline function type, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity, and determining the function name corresponding to the stack information according to the associated debugging information entity, and when the type of the debugging information entity is the non-inline function type, determining the function name corresponding to the stack information according to the debugging information entity, without manually symbolizing the stack information one by one by the developer, the stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved. Meanwhile, the file name and the line number corresponding to the stack information are determined in the debugging line number information associated with the debugging meta information, the stack information can be accurately and efficiently symbolized, and the symbolization efficiency of the stack information is improved.

[0059] Figure 3 A flowchart of a stack information symbolization service method provided by an embodiment of the present application is given, and the stack information symbolization method provided by the embodiment of the present application can be integrated in a server. The following describes the stack information symbolization service method executed by the server as an example. Referring to Figure 1 The stack information symbolization service method includes: S310: receiving a symbolization request and determining the stack information corresponding to the symbolization request.

[0060] S320: performing symbolization processing on the stack information through the set symbolization script to obtain the symbolization result corresponding to the stack information.

[0061] The symbolization script is configured to execute the stack information symbolization method provided by any of the above embodiments. The stack information symbolization method provided by any of the above embodiments is packaged into a symbolization script executable by the server (for example, a Linux server) to make the symbolization script executable to execute the stack information symbolization method provided by any of the above embodiments when running, and achieve the corresponding technical effects. The server can provide a web service interface, and the developer can send a symbolization request to the server through the interface and provide the stack information to be symbolized to the server.

[0062] Exemplarily, after receiving the symbolization request, the server determines the stack information corresponding to the symbolization request, performs symbolization processing on the stack information through the set symbolization script, and obtains the symbolization result corresponding to the stack information, so that the developer can perform abnormal analysis based on the symbolization result.

[0063] In a possible embodiment, in the method for providing symbolization service provided in the present application, after determining the stack information corresponding to the symbolization request, the method further comprises: searching for stack information cache information corresponding to the stack information in a local symbol cache, wherein the local symbol cache records symbolization result cache information corresponding to different stack information cache information; and in the case that the stack information cache information corresponding to the symbolization request exists in the local symbol cache, determining the symbolization result cache information corresponding to the searched stack information cache information as the symbolization result corresponding to the stack information.

[0064] After obtaining the symbolization result corresponding to the stack information by performing symbolization processing on the stack information through the symbolization script, the symbolization result can be recorded in the local symbol cache, so as to be directly called when symbolizing the stack information of the same memory address next time, thereby improving the symbolization efficiency.

[0065] Exemplarily, after determining the stack information corresponding to the symbolization request, the stack information cache information can be searched in the local symbol cache. If the stack information cache information corresponding to the symbolization request does not exist in the local symbol cache, the stack information can be processed through the symbolization script. If the stack information cache information corresponding to the symbolization request exists in the local symbol cache, the symbolization result cache information corresponding to the searched stack information cache information can be determined as the symbolization result corresponding to the stack information. The present application improves the symbolization efficiency of the stack information and the overall throughput capacity and instant feedback experience under multi-user concurrent access by caching the symbolization result and quickly determining the stack information cache information corresponding to the symbolization request in the local symbol cache.

[0066] In a possible embodiment, in the method for providing symbolization service provided in the present application, after determining the stack information corresponding to the symbolization request, the stack information can be processed through address clustering.

[0067] Correspondingly, the symbolization processing on the stack information through the symbolization script comprises: performing symbolization processing on the stack information processed through address clustering through the symbolization script.

[0068] Exemplarily, the symbolization request can correspond to one or more stack information. After determining the stack information corresponding to the symbolization request, the stack information is processed through address clustering, so as to cluster the memory addresses belonging to the same symbolization file in the stack information together.

[0069] In one embodiment, when the stack information is symbolized by the set symbolization script, the stack information processed by the address clustering can be symbolized by the set symbolization script, so that in the symbolization processing of the stack information belonging to the same symbolization file memory address, the corresponding symbolization file needs to be loaded only once to realize the symbolization processing of multiple memory addresses, which can effectively reduce the time consumption of symbolization processing.

[0070] By obtaining the symbolization file, the debugging meta information and the stack information to be symbolized, determining the file address of the stack information in the symbolization file, determining the debugging information entity containing the file address in the debugging meta information, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity when the debugging information entity is of the inline function type, and determining the function name corresponding to the stack information according to the associated debugging information entity, the stack information can be accurately and efficiently symbolized without manual symbolization of the stack information by the developer, and the symbolization efficiency of the stack information is improved.

[0071] Figure 4 A structure diagram of a stack information symbolization device provided by an embodiment of the present application is given. Referring to Figure 4 The stack information symbolization device includes an address determination module 41, an entity determination module 42, an inline processing module 43 and a symbolization processing module 44.

[0072] The address determination module 41 is configured to obtain the symbolization file, the debugging meta information and the stack information to be symbolized, and determine the file address of the stack information in the symbolization file; the entity determination module 42 is configured to determine the debugging information entity containing the file address in the debugging meta information; the inline processing module 43 is configured to determine the associated debugging information entity according to the abstract origin information recorded in the debugging information entity when the type of the debugging information entity is of the inline function type; and the symbolization processing module 44 is configured to determine the function name corresponding to the stack information according to the associated debugging information entity to obtain the symbolization result of the stack information.

[0073] By obtaining the symbolization file, the debugging meta information and the stack information to be symbolized, determining the file address of the stack information in the symbolization file, determining the debugging information entity containing the file address in the debugging meta information, determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity when the debugging information entity is of the inline function type, and determining the function name corresponding to the stack information according to the associated debugging information entity, the stack information can be accurately and efficiently symbolized without manual symbolization of the stack information by the developer, and the symbolization efficiency of the stack information is improved.

[0074] In one possible implementation, the address determining module 41 determines the file address of the stack information in the symbolized file, and is configured to: determine the record address and the image load address of the stack information, and the reference address of the symbolized file; calculate an address offset value according to the record address and the image load address, and calculate the file address of the stack information in the symbolized file according to the address offset value and the reference address.

[0075] In one possible implementation, the symbolization processing module 44 determines the function name corresponding to the stack information according to the associated debugging information entity, and is configured to: determine the function name corresponding to the stack information in the combination of one or more of the link symbol name, the MIPS link symbol name and the source code name recorded in the associated debugging information entity.

[0076] In one possible implementation, the symbolization processing module 44 is further configured to: determine the file name corresponding to the stack information according to the inline call file attribute in the abstract origin information; determine the line number corresponding to the stack information according to the inline line number information in the abstract origin information.

[0077] In one possible implementation, the symbolization processing module 44 is further configured to: in the case of failure to determine the file name and / or line number corresponding to the stack information, determine the file name and / or line number corresponding to the stack information in the debugging line number information associated with the debugging meta information.

[0078] In one possible implementation, the symbolization processing module 44 is further configured to: in the case of the type of the debugging information entity being a non-inline function type, determine the function name corresponding to the stack information according to the debugging information entity to obtain the symbolization result of the stack information.

[0079] In one possible implementation, the symbolization processing module 44 determines the function name corresponding to the stack information according to the debugging information entity, and is configured to: determine the function name corresponding to the stack information in the combination of one or more of the link symbol name, the MIPS link symbol name and the source code name recorded in the debugging information entity.

[0080] In one possible implementation, the symbolization processing module 44 is further configured to: determine the file name and line number corresponding to the stack information in the debugging line number information associated with the debugging meta information.

[0081] In one possible implementation, the symbolization processing module 44 is further configured to: In a case where the type of the debugging information entity is a non-inlined function type and the function name corresponding to the stack information fails to be determined according to the debugging information entity, determining the function name corresponding to the stack information according to offset information corresponding to specification information recorded in the debugging information entity; determining the function name corresponding to the stack information according to the debugging information entity to obtain the symbolic result of the stack information.

[0082] In one possible embodiment, the stack information symbolization apparatus further includes a file judgment module and an index determination module, wherein: The file judgment module is configured to determine whether the debugging line number information exists in the symbolization file; The index determination module is configured to, in a case where the debugging line number information does not exist in the symbolization file, determine an entry with a value of a file address in the symbolization file, and add a table index in the entry to a table base address to obtain a target index; The symbolization processing module 44 is further configured to determine a target symbol of an index one bit before the target index in the symbolization file, and determine the target symbol as the function name corresponding to the stack information.

[0083] It is worth noting that, in the embodiments of the stack information symbolization apparatus described above, each unit and module included is only logically divided according to functions, but is not limited to the above-mentioned division, as long as the corresponding functions can be implemented; in addition, the specific names of each functional unit are only for mutual differentiation, and do not limit the protection scope of the embodiments of the present application.

[0084] The embodiments of the present application further provide a stack information symbolization device, which can integrate the stack information symbolization apparatus provided by the embodiments of the present application. Figure 5 is a structural schematic diagram of a stack information symbolization device provided by the embodiments of the present application. Referring to Figure 5 The stack information symbolization device includes an input apparatus 53, an output apparatus 54, a memory 52, and one or more processors 51; the memory 52 is used to store one or more programs; when the one or more programs are executed by the one or more processors 51, the one or more processors 51 implement the stack information symbolization method or the symbolization service method provided by the above-mentioned embodiments. The stack information symbolization apparatus, device and computer provided above can be used to execute the stack information symbolization method or the symbolization service method provided by any of the above-mentioned embodiments, and have the corresponding functions and beneficial effects.

[0085] The embodiment of the present application further provides a nonvolatile storage medium storing computer executable instructions, which are used for executing the stack information symbolization method or the symbolization service method provided by the above embodiment when executed by a computer processor. Of course, the nonvolatile storage medium storing computer executable instructions provided by the embodiment of the present application is not limited to the stack information symbolization method or the symbolization service method provided above, and can also execute the related operations in the stack information symbolization method or the symbolization service method provided by any embodiment of the present application. The stack information symbolization apparatus, device and storage medium provided in the above embodiment can execute the stack information symbolization method or the symbolization service method provided by any embodiment of the present application, and the technical details not described in detail in the above embodiment can be referred to the stack information symbolization method or the symbolization service method provided by any embodiment of the present application.

[0086] On the basis of the above embodiment, the embodiment of the present application further provides a computer program product, the technical solution of the present application or the part of the contribution to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer program product is stored in a storage medium, and includes a plurality of instructions for making a computer device, a mobile terminal or a processor therein execute all or part of the steps of the stack information symbolization method or the symbolization service method provided by each embodiment of the present application.

Claims

1. A method of encoding stack information, characterized by, The method comprises the following steps: acquiring a symbolization file, debugging meta information and stack information to be symbolized, and determining a file address of the stack information in the symbolization file; determining a debugging information entity containing the file address in the debugging meta information; in a case where a type of the debugging information entity is an inline function type, determining an associated debugging information entity according to abstract origin information recorded in the debugging information entity; determining a function name corresponding to the stack information according to the associated debugging information entity, to obtain a symbolization result of the stack information.

2. The stack information encoding method according to claim 1, characterized by, The step of determining the file address of the stack information in the symbolization file comprises the following steps: determining a record address and a mirror loading address of the stack information, and a reference address of the symbolization file; calculating an address offset value according to the record address and the mirror loading address, and calculating the file address of the stack information in the symbolization file according to the address offset value and the reference address.

3. The stack information encoding method according to claim 1, wherein The step of determining the function name corresponding to the stack information according to the associated debugging information entity comprises the following steps: determining the function name corresponding to the stack information in a combination of one or more of a link symbol name, a MIPS link symbol name and a source code name recorded in the associated debugging information entity.

4. The stack information encoding method of claim 1, wherein After the step of determining the associated debugging information entity according to the abstract origin information recorded in the debugging information entity, the method further comprises the following steps: determining a file name corresponding to the stack information according to inline call file attribute in the abstract origin information; determining a line number corresponding to the stack information according to inline line number information in the abstract origin information.

5. The stack information encoding method according to claim 4, wherein After the step of determining the line number corresponding to the stack information according to the inline line number information in the abstract origin information, the method further comprises the following steps: in a case where the determination of the file name and / or the line number corresponding to the stack information fails, determining the file name and / or the line number corresponding to the stack information in debugging line number information associated with the debugging meta information.

6. The stack information encoding method according to any one of claims 1 to 5, characterized by, The method further comprises the following steps: in a case where the type of the debugging information entity is a non-inline function type, determining the function name corresponding to the stack information according to the debugging information entity, to obtain the symbolization result of the stack information.

7. The stack information encoding method according to claim 6, wherein The step of determining the function name corresponding to the stack information according to the debugging information entity comprises the following steps: determining the function name corresponding to the stack information in a combination of one or more of a link symbol name, a MIPS link symbol name and a source code name recorded in the debugging information entity.

8. The stack information encoding method according to any one of claims 1 to 5, characterized by, After the step of determining the debugging information entity containing the file address in the debugging meta information, the method further comprises the following steps: determining the file name and the line number corresponding to the stack information in debugging line number information associated with the debugging meta information.

9. The stack information encoding method according to any one of claims 1 to 5, characterized by, After the step of determining the debugging information entity containing the file address in the debugging meta information, the method further comprises the following steps: in a case where the type of the debugging information entity is a non-inline function type, and the determination of the function name corresponding to the stack information according to the debugging information entity fails, determining an associated debugging information entity according to offset information corresponding to specification information recorded in the debugging information entity; According to the associated debugging information entity, the function name corresponding to the stack information is determined, so as to obtain the symbolic result of the stack information.

10. The stack information encoding method according to any one of claims 1 to 5, characterized by, After the file address of the stack information in the symbolic file is determined, the method further includes: determining whether there is debugging line number information in the symbolic file; in the case where there is no debugging line number information in the symbolic file, determining an entry with the file address in the symbolic file, and adding the table index in the entry to the table base address to obtain a target index; determining a target symbol with an index one bit before the target index in the symbolic file, and determining the target symbol as the function name corresponding to the stack information.

11. A stack information symbolizing apparatus characterized by comprising: The method includes an address determination module, an entity determination module, an inline processing module, and a symbolic processing module, wherein: The address determination module is configured to obtain a symbolic file, debugging meta information, and stack information to be symbolically processed, and determine a file address of the stack information in the symbolic file; The entity determination module is configured to determine a debugging information entity containing the file address in the debugging meta information; The inline processing module is configured to, in the case where the type of the debugging information entity is an inline function type, determine an associated debugging information entity according to abstract origin information recorded in the debugging information entity; The symbolic processing module is configured to determine a function name corresponding to the stack information according to the associated debugging information entity, so as to obtain a symbolic result of the stack information.

12. A method of a symbolization service of stack information, characterized by, The method includes: receiving a symbolic request, and determining stack information corresponding to the symbolic request; performing symbolic processing on the stack information through a set symbolic script, to obtain a symbolic result corresponding to the stack information, wherein the symbolic script is configured to execute the stack information symbolization method according to any one of claims 1-10.

13. The method of claim 12, wherein After the stack information corresponding to the symbolic request is determined, the method further includes: searching for stack information cache information corresponding to the stack information in a local symbol cache, wherein the local symbol cache records symbolic result cache information corresponding to different stack information cache information; in the case where the stack information cache information corresponding to the symbolic request exists in the local symbol cache, determining the symbolic result cache information corresponding to the searched stack information cache information as the symbolic result corresponding to the stack information.

14. The method of claim 12, wherein After the stack information corresponding to the symbolic request is determined, the method further includes: performing address clustering processing on the stack information; correspondingly, the symbolic processing on the stack information through the set symbolic script includes: performing symbolic processing on the stack information after the address clustering processing through the set symbolic script.

15. A stack information symbolization device characterized by comprising: The method includes: a memory and one or more processors; the memory is used to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the stack information symbolization method according to any one of claims 1-10, or the symbolic service method according to any one of claims 12-14.

16. A non-transitory storage medium storing computer-executable instructions which, when executed by a processor of a device, cause the device to perform: The computer executable instructions, when executed by a computer processor, are for performing the stack information encoding method of any one of claims 1-10, or the encoding service method of any one of claims 12-14.

17. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the stack information encoding method of any one of claims 1-10, or the encoding service method of any one of claims 12-14.