Application crash positioning method and device, equipment, medium and product
By obtaining the exception address information in the crash stack and the target function address marked in the SDK file, accurately locate the cause of the application crash, solving the problem of low crash positioning efficiency in the existing technology, and achieving convenient and efficient crash positioning effect.
Patent Information
- Application Number
- CN202410937476.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-05
Smart Images

Figure CN118897748A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, equipment, medium and product for locating the crash of an application program. Background Art
[0002] Before an application is deployed to a smart terminal or during use, the application may crash. Based on this, it is usually necessary to determine whether the crash is caused by the application itself or by multiple SDK files integrated in the application, and which SDK caused the crash, so as to perform subsequent maintenance on the application.
[0003] The method adopted to solve the above problem is mainly to create at least one symbol set file corresponding to the application, and collect the class name and method name of the application to form a program file. The symbol set file is used to convert the garbled content in the stack information into the corresponding function call based on the stack information and the symbol set file when the application crashes, so as to locate the crash. Furthermore, based on the function call and the program file, information such as the SDK can be determined.
[0004] When implementing the technical solution based on the above method, the inventor found the following problems:
[0005] There may be multiple versions of an application. It is time-consuming and laborious to collect class names and method names in the SDK for each version. When the software crashes, it is necessary to locate the crash based on many class names and method names, which is inefficient. Summary of the invention
[0006] The present invention provides a method, device, equipment, medium and product for locating the crash of an application program, so as to achieve the effect of conveniently and efficiently locating the crash of an application program at a low cost.
[0007] In a first aspect, an embodiment of the present invention provides a method for locating a crash of an application program, the method comprising:
[0008] When an application is detected to be running abnormally, obtain the exception address information in the crash stack;
[0009] Based on the abnormal address information and the target function pre-marked in the SDK file, the target crash information causing the abnormal operation of the application is determined; wherein the target function includes the start address and the end address corresponding to the SDK file.
[0010] Furthermore, the method further comprises:
[0011] marking a target function in at least one SDK file associated with the application;
[0012] A start address is added to a start address function in the target function, and an end address is added to an end address function in the target function, so as to determine target crash information based on the target function and the exception address information.
[0013] Furthermore, the method further comprises:
[0014] During the running of the application, determining an offset address corresponding to the application;
[0015] When the SDK file is loaded, a memory address is allocated to the SDK file, so as to determine the real address of the SDK file based on the memory address and the offset address, and to determine the exception address information in the crash stack based on the real address when the application runs abnormally.
[0016] Furthermore, before obtaining the exception address information in the crash stack, the method further includes:
[0017] When running the SDK file, determining the address to be processed according to the memory address of the SDK file and the offset address;
[0018] When the application runs abnormally, the address to be processed is stored in the crash stack as the abnormal address information.
[0019] Further, the determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes:
[0020] When the start address in the target function is matched according to the exception address information, but the end address in the target function is not matched, the SDK file corresponding to the matched start address is used as the target crash information.
[0021] Further, the determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes:
[0022] When the starting address in the target function is matched according to the exception address information, and the ending address in the target function is matched, the target SDK file corresponding to the matched starting address and ending address and the associated SDK file associated with the target SDK file are used as the target crash information.
[0023] Further, the determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes:
[0024] When the start address and the end address in the target function are not matched according to the exception address information, it is determined that the target crash information is a crash caused by a non-SDK file.
[0025] Furthermore, the method further comprises:
[0026] The target crash information is persistently stored as a crash record, so that when the application is started again, the crash record is sent to the target system for display in the target system.
[0027] In a second aspect, an embodiment of the present invention further provides a device for locating a crash of an application program, the device comprising:
[0028] The exception information acquisition module is used to obtain the exception address information in the crash stack when an exception is detected in the application program operation;
[0029] The crash information locating module is used to determine the target crash information causing the application program to run abnormally based on the abnormal address information and the target function pre-marked in the SDK file; wherein the target function includes the start address and end address corresponding to the SDK file.
[0030] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0031] one or more processors;
[0032] a storage device for storing one or more programs,
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the crash location method of the application program as described in any one of the embodiments of the present invention.
[0034] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the crash location method of an application as described in any one of the embodiments of the present invention.
[0035] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, is used to execute the crash location method of an application as described in any one of the embodiments of the present invention.
[0036] The technical solution of the embodiment of the present invention can first obtain the exception address information in the crash stack when an abnormal operation of the application is detected. Further, the target crash information that caused the abnormal operation of the application can be determined by combining the exception address information and the target function pre-marked in the SDK file. This is because the target function mainly records the starting address and the ending address corresponding to the SDK file. Therefore, when the application calls the SDK file, it can be located whether the crash is caused by the SDK file based on the exception address information and the starting and ending addresses corresponding to the SDK file, so as to achieve the effect of accurate positioning. The above method solves the problem that the prior art needs to create symbol set files, class names and method names under different versions of the application, which is not only time-consuming and laborious, but also has a certain complexity in locating the crash information when the software crashes, resulting in a low crash positioning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 A schematic diagram of a process flow of a method for locating a crash of an application program provided by an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of a process flow of a method for locating a crash of an application program provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of a process flow of a method for locating a crash of an application program provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of a crash location device for an application program provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0044] Before introducing the present technical solution, a specific application scenario can be exemplified. At least one application can be installed in the target system. During the operation of each application, not only the information corresponding to the application itself is needed, but also the SDK file associated with the application may be called. If a crash occurs during the operation of the program, the target crash information can be determined based on the solution provided by the embodiment of the present invention, that is, it can be determined whether the crash is caused by the program itself or which SDK file causes the abnormal operation of the application. In this embodiment, the target system can be an IOS system. For example, if a terminal device uses the IOS system, the application can be installed on the terminal device. In this case, if the application crashes, the solution provided by the embodiment of the present invention can be used to locate the crash. Figure 1 A flowchart of a method for locating a crash of an application provided in an embodiment of the present invention is provided. This embodiment is applicable to situations where, when an application installed on a target system crashes, crash information can be determined at low cost and high efficiency. The method can be executed by a crash locating device for the application, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device, and the electronic device can be a mobile terminal or a PC, etc.
[0045] like Figure 1 The method of this embodiment includes:
[0046] S110 . When an application program is detected to be running abnormally, obtain abnormal address information in a crash stack.
[0047] Among them, if there is a flash back, no response for a long time, or other applications cannot continue to run during the application running, it can be preliminarily determined that the application is running abnormally. When the application runs abnormally, that is, there is a crash, the address information corresponding to the crash can be stored in the crash stack, that is, the crash stack is a storage stack that stores the corresponding address information when the application runs abnormally. The abnormal address information is the memory or memory address of the SDK file running when the application runs abnormally.
[0048] Specifically, during the running of the application, if an abnormal operation such as the application crashes or is unresponsive for a long time is detected, it means that the application is running abnormally. At this time, the exception address information of the SDK file or program corresponding to the abnormal operation of the application cached in the crash stack can be obtained.
[0049] In this embodiment, the method also includes: during the running of the application, determining the offset address corresponding to the application; when loading the SDK file, allocating a memory address to the SDK file, so as to determine the real address of the SDK file based on the memory address and the offset address, so as to determine the exception address information in the crash stack based on the real address when the application runs abnormally.
[0050] Among them, the ASLR mechanism can be introduced in the target system IOS system. The ASLR mechanism improves security by randomly allocating memory addresses each time an application is started. The advantage of this method is that the location of the application's executable file, heap, stack and other important data areas in the memory is different each time they are loaded. Furthermore, the offset address is the storage address corresponding to the code corresponding to the SDK file or the program itself loaded into the memory during operation. After the SDK file is loaded, the memory address is the storage address allocated for storing the SDK file. The real address is the address where the SDK file is actually stored.
[0051] Specifically, during the running of the application, the code corresponding to the application itself will be loaded, and at least one SDK file associated with the application will be loaded. When the code and / or at least one SDK file is loaded into the memory, a corresponding offset address can be randomly assigned to it, and it can be stored in the memory. When it is stored in the memory, a corresponding memory address can also be assigned to it. Based on the memory address and the offset address, the real address corresponding to the code or SDK file can be determined. The real address can be used as the exception address information in the crash stack.
[0052] In this embodiment, the advantage of using the above method to determine the exception address information is that it can avoid determining the class name, method name and symbol set file corresponding to the application under different versions, and only needs to combine the address information to determine its target crash information, which improves the convenience and efficiency of determining the target crash information. In this embodiment, before obtaining the exception address information in the crash stack, the method also includes: when running the SDK file, determining the address to be processed based on the memory address of the SDK file and the offset address; when the application runs abnormally, storing the address to be processed as the exception address information in the crash stack.
[0053] It can be understood that when the SDK file needs to be loaded during the running of the application, the SDK file can be loaded and stored in the memory. At this time, a memory address can be assigned to it so that when the SDK file is running, the SDK file can be stored based on the memory address. When an abnormality in the running of the application is detected, the address to be processed corresponding to the SDK file can be determined based on the memory address corresponding to the SDK file and the pre-assigned offset address. This address to be processed is used as the exception address information and stored in the crash stack.
[0054] S120 , determining target crash information causing the application program to run abnormally based on the exception address information and a target function pre-marked in the SDK file.
[0055] The target function includes the start address and end address corresponding to the SDK file. The target crash information includes the specific content that causes the application to run abnormally. Optionally, the specific content may include the address information corresponding to the SDK file that causes the application to run abnormally, or other information associated with the application to run abnormally.
[0056] Specifically, after obtaining the exception address information, the target functions corresponding to all pre-configured SDK files can be obtained, and the target crash information that causes the application to run abnormally can be determined. For example, the target crash information may be a crash caused by the SDK file and what the specific SDK file is, or the target crash information may be a crash caused by information associated with the SDK file, or a crash caused by the application itself.
[0057] It should be noted that since the SDK file includes the start address and the end address, based on the start address and the end address, as well as the exception address information in the crash stack, it is possible to determine whether the crash is caused by the SDK file or the program itself.
[0058] After obtaining the target crash information, the method further includes: persistently storing the target crash information as a crash record, so that when the application is started again, the crash record is sent to the target system for display in the target system.
[0059] It can be understood that after obtaining the target crash information, the target crash information can be persistently stored as a crash record. When the application is started again, optionally, the user clicks on the application again, and the crash record can be sent to the target system to display the target crash information in the target system. The advantage of displaying the target crash information is that it is convenient for users to quickly determine the cause of the abnormal operation of the application based on the target crash information, and the SDK file that caused the abnormal operation of the application, and which SDK file, so as to facilitate subsequent application maintenance.
[0060] The technical solution of the embodiment of the present invention can first obtain the exception address information in the crash stack when an abnormal operation of the application is detected. Further, the target crash information that caused the abnormal operation of the application can be determined by combining the exception address information and the target function pre-marked in the SDK file. This is because the target function mainly records the starting address and the ending address corresponding to the SDK file. Therefore, when the application calls the SDK file, it can be located whether the crash is caused by the SDK file based on the exception address information and the starting and ending addresses corresponding to the SDK file, so as to achieve the effect of accurate positioning. The above method solves the problem that the prior art needs to create symbol set files, class names and method names under different versions of the application, which is not only time-consuming and laborious, but also has a certain complexity in locating the crash information when the software crashes, resulting in a low crash positioning efficiency.
[0061] Figure 2 A flowchart of the crash location method of an application provided in an embodiment of the present invention. Based on the aforementioned embodiment, at least one SDK file associated with the application can be pre-marked so as to determine the crash information based on the mark. At the same time, the method of "determining the target crash information causing the abnormal operation of the application based on the exception address information and the target function pre-marked in the SDK file" can be further refined. The specific method can be found in the detailed description of the embodiment of the present invention. Among them, the technical terms that are the same as or corresponding to the aforementioned embodiment are not repeated here.
[0062] like Figure 2 As shown, the method includes:
[0063] S210: Mark a target function in at least one SDK file associated with the application.
[0064] You can insert SDKFuncBegainAddress() at the entrance of the key function of the SDK file, and insert SDKFuncEndAddress() at the exit of the key function. You can fill in the corresponding address information in the brackets. Use the above function inserted in the SDK file as the target function.
[0065] It should be noted that although the target function is inserted into the SDK file, its impact on the running of the SDK file is very low, that is, it will not affect the running of the application.
[0066] In this embodiment, after determining at least one SDK file associated with the application, the corresponding target function can be marked in the at least one SDK file. It should also be noted that at this time, the start address and end address of the SDK file have not been written into the target function.
[0067] S220 , adding a start address to a start address function in the target function, and adding an end address to an end address function in the target function, so as to determine target crash information based on the target function and the exception address information.
[0068] The start address and the end address may be written in the target function of the SDK file. After determining the abnormal address information, the target crash information may be determined based on the abnormal address information and the address information corresponding to the target function in each SDK file.
[0069] Specifically, after adding a target function to the SDK file, the start address and end address of the SDK file can be written in the target function. The advantage of this setting is that when an abnormality is detected in the application, the target crash information can be determined based on the abnormal address information and the start address and end address in the target function.
[0070] It should also be noted that in order to efficiently add the target function to each SDK file and write the start address and end address in the target function, a corresponding script can be created to achieve the effect of automatic writing of the target function.
[0071] Optionally, you can create a shell script, which can be named: insert_markers.sh. Based on the above script, you can automatically insert marker codes (target functions) into multiple methods of the SDK file. That is, based on the script traversal of all .m files (SDK files) in the specified directory, you can use the sed command to insert the target functions SDKFuncBegainAddress() and SDKFuncEndAddress() at the beginning and end positions of each SDK file. It can be understood that the target function can be automatically inserted into the SDK file, the starting address is written in the SDKFuncBegainAddress() of the target function, and the end address is written in the SDKFuncEndAddress() of the target function. Based on the above address and exception address information, determine the target crash information.
[0072] S230: When an application program is detected to be running abnormally, obtain abnormal address information in a crash stack.
[0073] It should be noted that there is a crash capture method inside the SDK file, which does not interfere with the host (application) exception capture processing. When an application is detected to be running abnormally, the abnormal operation can be an application running abnormality. At this time, the abnormal address information can be determined and the captured abnormal address information can be placed in the stack (crash stack) to obtain the abnormal address information from the crash stack.
[0074] S240, based on the abnormal address information and the target function pre-marked in the SDK file, determine the target crash information causing the abnormal operation of the application; wherein the target function includes the start address and the end address corresponding to the SDK file.
[0075] In this embodiment, the target crash information is determined based on the exception address information and the target function pre-marked in the SDK file, including: when the starting address in the target function is matched according to the exception address information, and the ending address in the target function is not matched, the SDK file corresponding to the matched starting address is used as the target crash information.
[0076] It can be understood that after obtaining the exception address information from the crash stack, the target functions in all SDK files can be traversed, and the target crash information can be determined based on the start address and end address in the target function.
[0077] Specifically, if the start address of the target function in a certain SDK file is matched based on the exception address information, but the end address in the target function is not matched, it means that the application may have crashed when the SDK file to which the target function belongs is running. At this time, the SDK file can be used as the target crash information. In actual applications, there may be other situations. Optionally, the target crash information is determined based on the exception address information and the target function pre-marked in the SDK file, including: when the start address in the target function is matched based on the exception address information, and the end address in the target function is matched, the target SDK file corresponding to the matched start address and end address and the associated SDK file associated with the target SDK file are used as the target crash information.
[0078] It can be understood that when the start address in the target function and the end address in the exception function are matched according to the exception address information, the SDK file to which the target function belongs and the associated SDK file associated with the target SDK file can be used as the target crash information.
[0079] In actual applications, there may be a situation where neither the starting address nor the ending address in the target function is matched. In this case, the target crash information can be determined as follows: when the starting address and the ending address in the target function are not matched according to the exception address information, it is determined that the target crash information is a crash caused by a non-SDK file.
[0080] It can be understood that: if the start address and the end address in the target function are not matched according to the exception address information, it means that the program crash is not caused by the SDK file. At this time, the target crash information may be an exception crash caused by a non-SDK file.
[0081] That is to say, the solution provided by the embodiment of the present invention can effectively identify and locate crashes that occur inside the SDK even in the absence of a symbol set file by implanting specific marking operations (target functions) at key points inside the SDK file, thereby achieving the effect of locating crashes at low cost. The technical solution provided by the embodiment of the present invention can pre-mark the target function in the SDK file before installing and running the application, and write the starting address and the ending address in the target function, so that when the application is installed and run on the terminal device, the abnormal operation of the application is detected, and the abnormal address information can be obtained from the crash stack, and then the target crash information can be determined based on the abnormal address information and the target function in the SDK file, that is, the crash is located, which solves the problem that the existing technology needs to determine the symbol set files and class methods corresponding to the application under different version types before locating the crash, and then locate the exception based on the symbol set files and class methods when the application runs abnormally, which has low efficiency and high cost, and achieves the technical effect of locating the exception conveniently and efficiently under low-cost conditions.
[0082] As an alternative embodiment to the above embodiment, Figure 3 A schematic diagram of a crash location method for an application program provided by an embodiment of the present invention can be determined. Technical terms that are the same as or corresponding to the above embodiments are not described in detail here.
[0083] See also Figure 3 The solution provided by the embodiment of the present invention can be applied to the crash location of any application installed in the IOS system.
[0084] Before the application is installed on the terminal device, a marker function may be defined in at least one SDK file associated with the application. Defining the marker function may include inserting a target function SDKFuncBegainAddress() at the entry of a key function of the SDK file, and inserting a target function SDKFuncEndAddress() marker at the exit of the key function.
[0085] When the application is running, the iOS system can load the SDK file used by the application into the memory, at which time a memory address will be assigned to the SDK file. At the same time, the iOS system can assign a random offset address to the binary module loaded into the memory. When the application is running, the real address corresponding to the SDK file can be determined based on the memory address and the offset address, that is, the address to be processed mentioned above.
[0086] It should also be noted that, in order to improve the convenience and efficiency of adding the target function to the SDK file, a shell script can be created to automatically add the target function to the key nodes of the SDK file based on the script. That is, an automatic marking method is inserted into the SDK file to mark the SDK file based on the automatic marking method.
[0087] During the running of the application, if it is detected that the application is running abnormally, the abnormal running can be regarded as an application running abnormality, and the address information captured by the exception can be written into the stack (crash stack) as the exception address information.
[0088] The exception address information in the crash stack can be analyzed and processed to determine the target crash information.
[0089] When the exception address information in the crash stack matches the SDKFuncBegainAddress() address in at least one SDK file, but does not match the SDKFuncEndAddress() address in the same SDK file, it can be determined that the crash occurred inside the SDK, and the target crash information is marked as an SDK crash log.
[0090] When the exception address information in the crash stack matches the SDKFuncBegainAddress() address in at least one SDK file and matches the SDKFuncEndAddress() method address in the same SDK file, the target crash information is marked as an SDK-associated crash log.
[0091] When the crash stack does not match the SDKFuncBegainAddress() address in at least one SDK file, it can be determined that the crash did not occur inside the SDK, and the target crash information is marked as a non-SDK crash log.
[0092] You can add fields to the crash log to identify whether it is an SDK crash record, and store the log data persistently. When the application is restarted, you can obtain the persistently stored data and report it to the backend system. The backend system can visualize the abnormal data based on the reported data.
[0093] The technical solution provided by the embodiment of the present invention can locate the crash of the application based on the target function and exception address information after implanting a lightweight target function at the function entry and exit of the SDK file, thereby achieving the effect of convenient exception location. Furthermore, by adopting the function implantation method to locate the exception, there is no need to create symbol set files for different versions of the application, which greatly improves the effectiveness and versatility of abnormal crash location in a changing development and release environment. Finally, it can reduce the time and labor cost of crash analysis and greatly improve the efficiency of crash location.
[0094] Figure 4 The present invention provides a schematic diagram of a structure of a crash location device for an application program according to an embodiment of the present invention. The device includes: an abnormal information acquisition module 310 and a crash information location module 320 .
[0095] Among them, the exception information acquisition module 310 is used to obtain the exception address information in the crash stack when an exception is detected in the application program; the crash information positioning module 320 is used to determine the target crash information that causes the application program to run abnormally based on the exception address information and the target function pre-marked in the SDK file; wherein the target function includes the starting address and ending address corresponding to the SDK file.
[0096] On the basis of the above technical solution, the device further comprises:
[0097] A function marking module, used for marking a target function in at least one SDK file associated with the application;
[0098] The address adding module is used to add a starting address to a starting address function in the target function and to add an ending address to an ending address function in the target function, so as to determine target crash information based on the target function and the abnormal address information.
[0099] On the basis of the above technical solutions, the device further includes:
[0100] An offset address acquisition module, used to determine an offset address corresponding to the application during the running of the application;
[0101] The real address determination module is used to allocate a memory address to the SDK file when loading the SDK file, so as to determine the real address of the SDK file based on the memory address and the offset address, and to determine the exception address information in the crash stack based on the real address when the application runs abnormally.
[0102] On the basis of the above technical solutions, the device further includes: a to-be-processed address determination module, which is used to determine the to-be-processed address according to the memory address of the SDK file and the offset address when running the SDK file;
[0103] The abnormal address storage module is used to store the address to be processed as the abnormal address information in the crash stack when the application runs abnormally.
[0104] On the basis of the above technical solutions, the crash information determination module is further used to:
[0105] When the start address in the target function is matched according to the exception address information, but the end address in the target function is not matched, the SDK file corresponding to the matched start address is used as the target crash information.
[0106] On the basis of the above technical solutions, the crash information determination module is further used to:
[0107] When the starting address in the target function is matched according to the exception address information, and the ending address in the target function is matched, the target SDK file corresponding to the matched starting address and ending address and the associated SDK file associated with the target SDK file are used as the target crash information.
[0108] On the basis of the above technical solutions, the crash information determination module is further used to:
[0109] When the start address and the end address in the target function are not matched according to the exception address information, it is determined that the target crash information is a crash caused by a non-SDK file.
[0110] Based on the above technical solutions, the device also includes: a crash information persistent storage module, which is used to persistently store the target crash information as a crash record, so that when the application is started again, the crash record is sent to the target system for display in the target system.
[0111] The technical solution of the embodiment of the present invention can first obtain the exception address information in the crash stack when an abnormal operation of the application is detected. Further, the target crash information that caused the abnormal operation of the application can be determined by combining the exception address information and the target function pre-marked in the SDK file. This is because the target function mainly records the starting address and the ending address corresponding to the SDK file. Therefore, when the application calls the SDK file, it can be located whether the crash is caused by the SDK file based on the exception address information and the starting and ending addresses corresponding to the SDK file, so as to achieve the effect of accurate positioning. The above method solves the problem that the prior art needs to create symbol set files, class names and method names under different versions of the application, which is not only time-consuming and laborious, but also has a certain complexity in locating the crash information when the software crashes, resulting in a low crash positioning efficiency.
[0112] The content synchronization device provided in the embodiment of the present invention can execute the crash location method of the application program provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0113] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0114] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 5 A block diagram of an exemplary electronic device 40 suitable for implementing exemplary embodiments of the present invention is shown. Figure 5 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0115] like Figure 5 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401).
[0116] Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0117] The electronic device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 40, including volatile and non-volatile media, removable and non-removable media.
[0118] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0119] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 407 generally perform the functions and / or methods of the embodiments described herein.
[0120] The electronic device 40 may also communicate with one or more external electronic devices 409 (e.g., keyboards, pointing devices, displays 410, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 40, and / or communicate with any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 411. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 412. As shown, the network adapter 412 communicates with other modules of the electronic device 40 via the bus 403. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0121] The processing unit 401 executes various functional applications and data processing by running the programs stored in the system memory 402, for example, implementing the crash location method of the application program provided in the embodiment of the present invention.
[0122] An embodiment of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a crash location method of an application program when executed by a computer processor.
[0123] The method includes:
[0124] When an application is detected to be running abnormally, obtain the exception address information in the crash stack;
[0125] Based on the abnormal address information and the target function pre-marked in the SDK file, the target crash information causing the abnormal operation of the application is determined; wherein the target function includes the start address and the end address corresponding to the SDK file. The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0126] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0127] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0128] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for locating application crashes. It is characterized in that include: When an application is detected to be running abnormally, obtain the exception address information in the crash stack; Based on the abnormal address information and the target function pre-marked in the SDK file, the target crash information causing the abnormal operation of the application is determined; wherein the target function includes the start address and the end address corresponding to the SDK file.
2. The method according to claim 1, It is characterized in that The method further comprises: marking a target function in at least one SDK file associated with the application; A start address is added to a start address function in the target function, and an end address is added to an end address function in the target function, so as to determine target crash information based on the target function and the exception address information.
3. The method according to claim 1, It is characterized in that The method further comprises: During the running of the application, determining an offset address corresponding to the application; When the SDK file is loaded, a memory address is allocated to the SDK file, so as to determine the real address of the SDK file based on the memory address and the offset address, and to determine the exception address information in the crash stack based on the real address when the application runs abnormally.
4. The method according to claim 3, It is characterized in that Before obtaining the exception address information in the crash stack, the method further includes: When running the SDK file, determining the address to be processed according to the memory address of the SDK file and the offset address; When the application runs abnormally, the address to be processed is stored in the crash stack as the abnormal address information.
5. The method according to claim 1, It is characterized in that The determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes: When the start address in the target function is matched according to the exception address information, but the end address in the target function is not matched, the SDK file corresponding to the matched start address is used as the target crash information.
6. The method according to claim 1, It is characterized in that The determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes: When the starting address in the target function is matched according to the exception address information, and the ending address in the target function is matched, the target SDK file corresponding to the matched starting address and ending address and the associated SDK file associated with the target SDK file are used as the target crash information.
7. The method according to claim 1, It is characterized in that The determining target crash information based on the exception address information and the target function pre-marked in the SDK file includes: When the start address and the end address in the target function are not matched according to the abnormal address information, it is determined that the content of the target crash information is description information of the crash caused by a non-SDK file.
8. The method according to claim 1, It is characterized in that The method further comprises: The target crash information is persistently stored as a crash record, so that when the application is started again, the crash record is sent to the target system for display in the target system.
9. A device for locating the crash of an application program, It is characterized in that include: The exception information acquisition module is used to obtain the exception address information in the crash stack when an exception is detected in the application program operation; The crash information locating module is used to determine the target crash information causing the application program to run abnormally based on the abnormal address information and the target function pre-marked in the SDK file; wherein the target function includes the start address and end address corresponding to the SDK file.
10. An electronic device, It is characterized in that The electronic device comprises: one or more processors; a storage device for storing 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 crash location method of the application program as described in any one of claims 1-8.
11. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the crash location method of an application program according to any one of claims 1 to 8 when executed by a computer processor.
12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program is used to execute the crash location method of an application program according to any one of claims 1 to 8.
