Automatic fault positioning method based on Qt multi-process framework
By combining breakpad instrumentation and event queue monitoring within the Qt multi-process framework, along with out-of-process monitoring services, automatic capture and parsing of fault information is achieved. This solves the problems of complexity and inefficiency in fault location, and improves the accuracy and efficiency of fault location.
Patent Information
- Application Number
- CN202411038225.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-08
AI Technical Summary
In the Qt multi-process framework, software fault location is difficult, especially since faults are difficult to trace, reproduce, and are not real-time in notification and information processing is not timely, making fault location complex and inefficient.
An automatic fault location method based on the Qt multi-process framework is adopted. By encapsulating breakpad instrumentation and event queue monitoring within the process and combining them with monitoring services outside the process, fault logs are automatically captured and parsed to generate readable stack information.
It enables timely capture and automatic parsing of fault information, reduces user operation requirements, improves the efficiency and accuracy of fault location, and reduces manpower and time costs.
Smart Images

Figure CN118916236A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault monitoring and positioning, and in particular to an automatic fault positioning method based on a Qt multi-process framework. Background Art
[0002] When software crashes and exits during operation, the following situations often occur, making it difficult to locate the software failure and making it impossible to repair the software quality problem.
[0003] 1) There is no evidence to prove the failure
[0004] On the one hand, after the software runs and exits due to an error, no available information is recorded, and the module and code where the error occurred cannot be identified. On the other hand, the software operation and operation logs are logs that record the software status and important operations. They can only be output when the software runs normally, and only cover some functions and process nodes of the software, and cannot cover all function codes. In many cases, the software operation logs and operation logs cannot reflect the actual situation of the fault and cannot be directly used as the basis for fault location.
[0005] 2) The fault phenomenon is difficult to reproduce
[0006] There are many types of software failures. In many cases, even if the same operation is performed and the same data is input, the failure phenomenon may not occur. In addition, some failures have a low probability of occurrence, such as abnormal values and critical value processing problems, which take days, weeks or even longer to occur, making it very difficult to troubleshoot the failure.
[0007] 3) Fault notification lacks real-time performance
[0008] In a multi-process framework, some process plug-ins may not have an interface or the interface is not open. When a process software fails, the software stops working, resulting in business dysfunction. If the user is not notified in time, the function will continue to be unavailable, resulting in a series of subsequent losses for a long time, causing the loss to expand.
[0009] 4) Fault information is not processed in time
[0010] If the user fails to handle the software failure in time, when he reviews the failure status after a period of time, he can no longer remember the specific time of the failure, the operations performed, the input data and the status. Inaccurate description of the failure timing and failure phenomenon will bring more uncertainty to the location of software failures. In addition, some important logs may be overwritten or deleted by other logs, resulting in the loss of failure information, making it difficult to locate the failure.
[0011] One of the traditional methods for locating software faults is to use detailed logging to add running records at the entry and exit of important functions. When a software fault occurs, by checking the log file, if it is found that the log is only recorded at the function entry, but not at the exit, the function fault can be located. However, this method will only locate the function, not the specific line of code, and if the function is called frequently, a large number of logs will be recorded, resulting in a large amount of hard disk resources being occupied. A large amount of log information being written to the hard disk will also cause low software operation efficiency.
[0012] In addition, the operating system itself can monitor the status of running software and record software error information. When core file generation is enabled in the Linux system, software exceptions can be automatically captured and core files can be generated. This file can be parsed using the GDB command and a readable error stack can be generated. However, this operation requires the user to manually search the core file output directory, find the corresponding core file, and then enter the GDB debugging command to parse the file content. This operation is very complex and requires high user operation. In addition, when the operating system is restarted or the hard disk space is insufficient, the core file will be automatically deleted, resulting in the loss of error logs.
[0013] The Google team has invested a lot of effort in software fault location and developed the breakpad monitoring module, which can be embedded in the software code project, automatically monitor and capture error information, and generate dmp error log files. However, this method also requires the cooperation of multiple tools, the input of complex instructions, and the parsing and conversion of dmp files to obtain readable specific fault information, which generally requires professional personnel to complete. Summary of the invention
[0014] In order to solve the existing technical problems, the present invention provides a method for automatically locating faults based on a Qt multi-process framework.
[0015] The specific contents of the present invention are as follows: a method for automatic fault location based on a Qt multi-process framework, including breakpad plugging monitoring, event queue monitoring and monitoring services. In the process, the breakpad plugging monitoring and event queue monitoring mechanisms are encapsulated in the process base class to complete the monitoring and output of fault information in the process; outside the process, a separate monitoring service is used to scan the fault log output by the plugging in the process and the fault log captured by the operating system, and the fault log is automatically parsed by a script to generate readable stack information.
[0016] Furthermore, in the framework kernel, the process base class QApplication is derived, and the instrumentation monitoring and event queue monitoring mechanisms are integrated into the derived class SympApplication. The steps include:
[0017] Step 1: In the class constructor, call the breakpad initialization function, set the output log file path and name, create a breakpad callback function, and capture the error information to the specified file through the callback function;
[0018] Step 2: Rewrite the notify callback function of SympApplication, add a try / catch exception capture mechanism in the function, record the object name, event type and other information of the exception event, and log it, and return true to prevent the event from going down;
[0019] Step 3: Use the derived class SympApplication to replace the framework process execution program base class QApplication, and use the SympApplication class to complete the internal instrumentation monitoring of the framework process;
[0020] Step 4: Integrate SympApplication into the plug-in base class ExecativePlugin, and create a SympApplication class object in the constructor of the plug-in base class to complete the internal instrumentation monitoring of the process plug-in.
[0021] Furthermore, when the framework process is started, the monitoring service is started, and the process information is synchronized with the monitoring service, the steps include:
[0022] Step 1: Create shared memory when the framework starts and establish a cross-process communication mechanism;
[0023] Step 2: Start the monitoring service process;
[0024] Step 3: Collect the framework and business plug-in process information, package them and write them into shared memory;
[0025] Step 4: When the process in the framework changes, repackage the process information and write it into the shared memory;
[0026] Step 5: When closing the framework, close the monitoring service at the same time.
[0027] Further, the process information transmitted by the monitoring service timing synchronization framework is monitored, and the fault log information of each process is scanned regularly, and the error log is automatically parsed and displayed. The steps include:
[0028] Step 1: Connect to the shared memory and read the process information in the shared memory into the process list;
[0029] Step 2: According to the process information in the process list, obtain the corresponding dmp file and core file directory, start the timer, scan the corresponding log file directory, and obtain the newly generated log file of the corresponding process;
[0030] Step 3: Assemble the command script according to the log file type, parse the file through script execution, and generate readable stack information;
[0031] Step 4: Pop up the interface to visualize the stack text.
[0032] Furthermore, the process of step 2, the timed scanning, includes:
[0033] The scanning process of the dmp format fault log file includes the following:
[0034] (1) Get the dmp log file directory: According to the plug-in organization structure in the framework, get the dmp log file output directory of each process;
[0035] (2) Scan dmp files: Start the timer and scan each dmp file directory regularly to obtain all file information in the directory, including file name and generation time information;
[0036] (3) Information comparison: extract the process number from the log file name and compare it with the current process number; obtain the log file generation time and compare it with the current computer time. If the extracted process number is the same as the process number of the current process, and the difference between the file generation time and the current time is within the threshold range, it means that a new dmp file has been scanned, and go to step 3;
[0037] The scanning process of the core format fault log file includes:
[0038] (1) Obtain the output parameters of the operating system core file: call the operating system command "cat / proc / sys / kernel / core_pattern" to obtain the output directory and file name format of the operating system core file;
[0039] (2) Scan core files: Start the timer to scan the core file directory of the operating system regularly, filter the files starting with "core", and obtain all the core files in the directory;
[0040] (3) Extract core file information: Get the file name of each core file and extract the corresponding process number from the file name;
[0041] (4) Information comparison: The process number is compared with the process number in the process information list. If the process number is included in the process list, it means that the log file is generated by the framework or a plug-in process. If the difference between the file generation time and the current time is within the threshold range, it means that a new core file has been scanned, and the process goes to step 3.
[0042] Furthermore, step three of parsing the file includes:
[0043] For dmp format log files, the extracted information includes module call relationship and call stack:
[0044] (1) Module call relationship analysis: You need to use the tools provided in Breakpad. The operation includes two steps: software symbol extraction and call relationship file generation:
[0045] (11) Software symbol extraction: call the dump_syms tool to extract the process software symbol information into the temp.sym file;
[0046] (12) Generate call relationship file: Call the minidump_stackwalk tool and use the temp.sym generated in step (11) to parse the call relationship information in the dmp file and output it to a text file;
[0047] (2) Call stack analysis: This requires the cooperation of the breakpad tool and the gdb tool. First, use the breakpad tool to convert the file into a core format file, then call the gdb debugging command to parse the readable stack information. The specific operation process is as follows:
[0048] (21) Format conversion: Call the minidump-2-core tool to convert the dmp format to the core format and output it to the cortemp file;
[0049] (22) Stack analysis: call the gdb debugging command to extract the current error stack and function information from the converted core file;
[0050] For core format log files, directly call the gdb command to parse the call stack.
[0051] Furthermore, in step 4, the parsing results of different log files of the same process are displayed in the same interface.
[0052] Furthermore, the monitoring service periodically connects to the shared memory. If the shared memory connection fails, the monitoring service needs to continue running for a period of time to scan whether there is any fault log of the framework. If no new fault log is scanned, the monitoring service will exit automatically.
[0053] The present invention combines the characteristics of a multi-process application integration framework, encapsulates the fault monitoring and locating function at the framework platform layer, uniformly monitors the framework and business plug-in processes, and monitors and locates process software fault information from both the in-process and out-of-process levels through both instrumentation monitoring and external monitoring, thereby achieving timely capture of error information during software operation, and completing automatic parsing and real-time display of error information. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The specific implementation of the present invention will be further explained below in conjunction with the accompanying drawings.
[0055] Figure 1 It is the technical framework of the automatic fault location method based on the Qt multi-process framework of the present invention;
[0056] Figure 2 This is a schematic diagram of the implementation mechanism of in-process encapsulation and out-of-process monitoring services;
[0057] Figure 3 To implement the inheritance relationship of the program class;
[0058] Figure 4 Monitor processing flow for event queues;
[0059] Figure 5 Working principle of fault monitoring service;
[0060] Figure 6 It is the core file name format description;
[0061] Figure 7 It is the fault information display interface. DETAILED DESCRIPTION
[0062] Combination Figure 1-Figure 7 The technical solution of the automatic fault location method based on the Qt multi-process framework of the present invention is as follows:
[0063] The present invention is based on the Qt plug-in multi-process framework, and encapsulates all fault monitoring and positioning functions within the framework platform. Among them, in-process fault monitoring is encapsulated in the framework kernel, including event queue monitoring and plug-in monitoring; out-of-process monitoring uses a separate service process, which is started and stopped by the framework. The technical architecture is as follows Figure 1 The information is supplemented at both the internal and external levels of the process, and the fault information is automatically captured, analyzed and displayed. The implementation scheme is as follows Figure 2As shown. The present invention completes fault information capture by combining three means: breakpad plugging, event queue monitoring and monitoring service. Among them, the engineering QApplication class of native Qt is derived, and the breakpad and event queue monitoring mechanism are encapsulated in the derived class, and encapsulated into the framework process and business plug-in base class, and all processes have fault plugging monitoring capabilities. Monitor the event queue, capture abnormal events and tolerate faults, reduce some event errors to warnings, and improve the stability of software operation. Start an independent monitoring process, and use shared memory as a separate cross-process communication. It can monitor all processes of the framework process and the business plug-in, and when the communication mechanism within the framework process and the framework fails, it can independently complete the log scanning and parsing functions. The fault location mechanism is fully encapsulated in the framework platform layer to achieve comprehensive isolation from the business function. No interface call is required when developing the business plug-in, and no design considerations in this regard are required.
[0064] 1. In-process monitoring
[0065] In-process monitoring uses class inheritance and function encapsulation methods to extend the native execution program engineering class of the process and encapsulate the monitoring process inside the extended class, such as Figure 3 As shown in the figure, QApplication is the base class of Qt execution program, SympApplication is the derived class of QApplication, and the breakpad monitoring and exception queue monitoring functions are integrated in the SympApplication class.
[0066] The integrated instrumentation monitoring and event queue monitoring methods are as follows:
[0067] 1. Instrumentation monitoring
[0068] In the project constructor, initialize the breakpad object, specify the output directory and file name, and call the breakpad interface to create an exception event callback handler. During the software running process, breakpad will automatically capture the error stack information and output it to the specified file through callback.
[0069] 2. Event Queue Monitoring
[0070] In the SympApplication class, rewrite the base class notify callback virtual function, monitor the process event queue through the try / catch method, and capture the exception information in the event queue. When the exception event thrown by the Qt bottom layer is captured, the relevant exception information is obtained and recorded in the alarm log, and fault tolerance is performed by blocking the event from going down to prevent the error from further expanding. The processing process is as follows: Figure 4 shown.
[0071] The present invention adopts an abnormal event queue monitoring mechanism, which can tolerate the exceptions thrown by the Qt bottom layer to a certain extent, reduce software errors to warnings, and improve the robustness of the software. By combining multiple technical routes such as abnormal event queue monitoring and plugging monitoring, it is possible to achieve the association and complementarity of fault information, support more types, and provide more comprehensive information, which is more conducive to software maintenance personnel to determine and repair the specific location of the fault.
[0072] 2. Out-of-process monitoring
[0073] The out-of-process monitoring is completed by a separate fault monitoring service software, which cooperates with the framework process to complete information synchronization, log file scanning, automatic information analysis and prompt information display. The working principle is as follows: Figure 5 shown.
[0074] 1. Framework working process
[0075] When the application integration framework is started, in addition to loading the business plug-in, it is also necessary to start the fault monitoring service software and synchronize the information of each process to the service software. When the plug-in in the framework changes (load, unload), the information of each process needs to be updated to the fault monitoring service software. The main processing process is as follows:
[0076] Step 1: When the framework main process starts, it first establishes a data cache through shared memory technology. This cache will become the data transmission channel between the fault monitoring service.
[0077] Step 2: Start the fault monitoring service software.
[0078] Step 3: After the framework is started, the process number, software name, process file name and other information of the main process itself and each process plug-in are packaged and written into the shared memory.
[0079] Step 4: When the process managed by the framework changes, the information of each process is rewritten into the shared memory to update the data.
[0080] Step 5: When closing the framework, close the fault monitoring service software.
[0081] 2. Working process of fault monitoring service software
[0082] After the fault monitoring service software is started, it is necessary to synchronize process information from the shared memory at regular intervals, scan fault log files at regular intervals, automatically parse newly scanned fault log files, generate readable stack information files, and display them on the interface. The specific working process is as follows:
[0083] Step 1: Synchronize process information. Read data in shared memory regularly, obtain framework and each business process information, and save it in the process information list.
[0084] Step 2: Periodically scan fault log files in dmp and core formats.
[0085] The dmp format fault log file is automatically generated by breakpad after capturing error information and stored in the corresponding plug-in log directory. The file scanning process is as follows:
[0086] 1) Get the dmp log file directory: According to the plug-in organization structure in the framework, get the dmp log file output directory of each process.
[0087] 2) Scan files: Start the timer and scan each dmp file directory regularly to obtain all file information in the directory, including file name and generation time information.
[0088] 3) Information comparison: Extract the process number from the log file name and compare it with the current process number; obtain the log file generation time and compare it with the current computer time. If the extracted process number is the same as the process number of the current process, and the difference between the file generation time and the current time is within the threshold range, it means that a new dmp file has been scanned, and go to step 3.
[0089] The core format fault log file is generated by the Linux operating system itself and stored in a unified directory. The scanning process of the core file is as follows:
[0090] 1) Get the output parameters of the operating system core file: Call the operating system command "cat / proc / sys / kernel / core_pattern" to get the output directory and file name format of the operating system core file. For the core file name format generated by the Linux system, see Figure 6 .
[0091] 2) Scan core files. Start the timer to scan the core file directory of the operating system regularly, filter the files starting with "core", and obtain all the core files in the directory.
[0092] 3) Extract core file information: Get the file name of each core file and extract the corresponding process number from the file name.
[0093] 4) Information comparison: Compare the process number with the process number in the process information list. If the process list contains the process number, it means that the log file is generated by the framework or a plug-in process. If the difference between the file generation time and the current time is within the threshold range, it means that a new core file has been scanned, and go to step 3.
[0094] Step 3: Extract the newly scanned fault file. In this step, you need to select the corresponding command according to the log file format to form a command script string. By automatically running the command script, the information is automatically extracted and parsed.
[0095] For dmp format log files, the extractable information includes module call relationship and call stack.
[0096] 1) Module call relationship analysis.
[0097] The call relationship includes the call relationship between modules (dynamic libraries), which assists software maintenance personnel in determining the overall operation logic between modules and identifying the faulty software module. The call relationship analysis requires the use of the tools provided in breakpad, and the operation includes two steps: software symbol extraction and call relationship file generation:
[0098] (1) Software symbol extraction. Call the dump_syms tool to extract the process software symbol information into the temp.sym file. The command format is as follows:
[0099] dump_syms process file name>temp.sym
[0100] (2) Generate a call relationship file. Call the minidump_stackwalk tool and use the temp.sym generated in (1) to parse the call relationship information in the dmp file and output it to a text file. The command format is as follows:
[0101] minidump_stackwalk dmp file name temp.sym> call relationship file
[0102] 2) Call stack parsing.
[0103] The call stack reflects the function call relationship of each module, including the called function name and code line. Stack parsing requires the cooperation of breakpad tool and gdb tool. First, use breakpad tool to convert the file into core format file, then call gdb debugging command to parse the readable stack information. The specific operation process is as follows:
[0104] (1) Format conversion. Call the minidump-2-core tool to convert the dmp format to the core format and output it to the cortemp file. The command format is as follows:
[0105] minidump-2-core dmp filename -o cortemp
[0106] (2) Stack analysis. Call the gdb debugging command to extract the current error stack and function information from the converted core file (cortemp). The command format is as follows:
[0107] gdb process file name cortemp-batch-command gdbcmd.gdb|tee parsed stack file
[0108] Among them, gdbcmd.gdb is the gdb debugging parameter file, which saves the parameters required for gdb to automatically parse commands, usually "bt".
[0109] For core format log files, directly call the gdb command to parse the call stack. The command format is as follows:
[0110] gdb process file name core file name-batch-command gdbcmd.gdb|tee parsed stack file
[0111] Step 4: Information association and display.
[0112] After the log file is parsed, the software reads the output file content and automatically pops up an interface to display it. If the dmp file and the core file are from the same process, they represent fault logs generated by the same process. At this time, the software associates the error information with the same prompt interface for display. The interface effect is as follows: Figure 7 As shown (left: dmp file parsing information; right: core file parsing information).
[0113] Step 5, service exit. Under normal circumstances, the fault monitoring service will be closed by the framework. However, if a fault occurs during the operation of the framework process or it exits abnormally (being killed), the service will not be closed. Therefore, the fault monitoring service needs to connect to the shared memory regularly to check whether the framework process is running normally. If the shared memory connection fails, it means that the framework process has exited abnormally, but the monitoring service has not been closed normally. In this case, the monitoring service needs to continue to run for a period of time to scan whether there are any fault logs generated by the framework. If no new fault logs are scanned, it will exit automatically.
[0114] Through a separate monitoring service, not only can each business process plug-in be monitored, but also the main process of the framework can be monitored to achieve monitoring of all processes. The monitoring service and the framework use a separate cross-process communication mechanism to avoid the problem of not being able to work properly when the framework process fails or the internal data exchange mechanism of the framework fails. When the framework fails, the fault monitoring service can still run independently and continue to capture, parse, and display the framework fault information. Automatic script processing can be used to automatically extract and display error information without the need for other command operations, reducing the user's operation requirements; the information can be extracted and displayed within a few seconds after the fault occurs, and the fault information can be located quickly and efficiently. In addition, there is no need for conventional fault reproduction, fault reasoning and other processes, which greatly reduces the manpower and time costs required for fault location.
[0115] The breakpad plugging technology and Qt event queue monitoring technology adopted by the present invention support cross-platform and can support multiple operating systems. The core file monitoring mechanism is based on the Linux kernel and can support a full range of domestic systems such as Zhongbiao Qilin and Yinhe Qilin. The fault monitoring and positioning function is encapsulated in the bottom layer of the framework, and the fault monitoring and positioning and display are completed uniformly through the framework, which is completely isolated from the business layer. The business layer has no related calling interface, and there is no need to consider related designs when developing business plug-ins.
[0116] Many specific details are described in the above description to facilitate a full understanding of the present invention. However, the above description is only a preferred embodiment of the present invention. The present invention can be implemented in many other ways different from those described herein, so the present invention is not limited to the specific implementation disclosed above. At the same time, any person familiar with the art can make many possible changes and modifications to the technical solution of the present invention using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A method for automatic fault location based on Qt multi-process framework, Features: It includes breakpad instrumentation, event queue monitoring and monitoring services. Within the process, the breakpad instrumentation monitoring and event queue monitoring mechanisms are encapsulated in the process base class to complete the monitoring and output of fault information within the process; outside the process, a separate monitoring service is used to scan the fault logs output by the instrumentation within the process and the fault logs captured by the operating system, and the fault logs are automatically parsed through scripts to generate readable stack information.
2. The automatic fault location method based on the Qt multi-process framework according to claim 1, Features: In the framework kernel, the process base class QApplication is derived, and the instrumentation monitoring and event queue monitoring mechanisms are integrated into the derived class SympApplication. The steps include: Step 1: In the class constructor, call the breakpad initialization function, set the output log file path and name, create a breakpad callback function, and capture the error information to the specified file through the callback function; Step 2: Rewrite the notify callback function of SympApplication, add a try / catch exception capture mechanism in the function, record the object name, event type and other information of the exception event, and log it, and return true to prevent the event from going down; Step 3: Use the derived class SympApplication to replace the framework process execution program base class QApplication, and use the SympApplication class to complete the internal instrumentation monitoring of the framework process; Step 4: Integrate SympApplication into the plug-in base class ExecativePlugin, and create a SympApplication class object in the constructor of the plug-in base class to complete the internal instrumentation monitoring of the process plug-in.
3. The automatic fault location method based on the Qt multi-process framework according to claim 1, Features: When the framework process starts, the monitoring service is started and the process information is synchronized with the monitoring service. The steps include: Step 1: Create shared memory when the framework starts and establish a cross-process communication mechanism; Step 2: Start the monitoring service process; Step 3: Collect the framework and business plug-in process information, package them and write them into shared memory; Step 4: When the process in the framework changes, repackage the process information and write it into the shared memory; Step 5: When you close the framework, close the monitoring service at the same time.
4. The automatic fault location method based on the Qt multi-process framework according to claim 1, Features: Monitor the process information transmitted by the service timing synchronization framework, and regularly scan the fault log information of each process, and automatically parse and display the error log. The steps include: Step 1: Connect to the shared memory and read the process information in the shared memory into the process list; Step 2: According to the process information in the process list, obtain the corresponding dmp file and core file directory, start the timer, scan the corresponding log file directory, and obtain the newly generated log file of the corresponding process; Step 3: Assemble the command script according to the log file type, parse the file through script execution, and generate readable stack information; Step 4: Pop up the interface to visualize the stack text.
5. The automatic fault location method based on the Qt multi-process framework according to claim 4, Features: Step 2 The process of scheduled scanning includes: The scanning process of the dmp format fault log file includes the following: (1) Get the dmp log file directory: According to the plug-in organization structure in the framework, get the dmp log file output directory of each process; (2) Scan dmp files: Start the timer and scan each dmp file directory regularly to obtain all file information in the directory, including file name and generation time information; (3) Information comparison: extract the process number from the log file name and compare it with the current process number; obtain the log file generation time and compare it with the current computer time. If the extracted process number is the same as the process number of the current process, and the difference between the file generation time and the current time is within the threshold range, it means that a new dmp file has been scanned, and go to step 3; The scanning process of the core format fault log file includes: (1) Obtain the output parameters of the operating system core file: call the operating system command "cat / proc / sys / kernel / core_pattern" to obtain the output directory and file name format of the operating system core file; (2) Scan core files: Start the timer to scan the core file directory of the operating system regularly, filter the files starting with "core", and obtain all the core files in the directory; (3) Extract core file information: Get the file name of each core file and extract the corresponding process number from the file name; (4) Information comparison: The process number is compared with the process number in the process information list. If the process number is included in the process list, it means that the log file is generated by the framework or a plug-in process. If the difference between the file generation time and the current time is within the threshold range, it means that a new core file has been scanned, and the process goes to step 3.
6. The automatic fault location method based on the Qt multi-process framework according to claim 4, Features: Step 3: parsing the file includes: For dmp format log files, the extracted information includes module call relationship and call stack: (1) Module call relationship analysis: You need to use the tools provided in Breakpad. The operation includes two steps: software symbol extraction and call relationship file generation: (11) Software symbol extraction: call the dump_syms tool to extract the process software symbol information into the temp.sym file; (12) Generate call relationship file: Call the minidump_stackwalk tool and use the temp.sym generated in step (11) to parse the call relationship information in the dmp file and output it to a text file; (2) Call stack analysis: This requires the cooperation of the breakpad tool and the gdb tool. First, use the breakpad tool to convert the file into a core format file, then call the gdb debugging command to parse the readable stack information. The specific operation process is as follows: (21) Format conversion: Call the minidump-2-core tool to convert the dmp format to the core format and output it to the cortemp file; (22) Stack analysis: call the gdb debugging command to extract the current error stack and function information from the converted core file; For core format log files, directly call the gdb command to parse the call stack.
7. The automatic fault location method based on the Qt multi-process framework according to claim 4, Features: In step 4, the parsing results of different log files for the same process are displayed in the same interface.
8. The automatic fault location method based on the Qt multi-process framework according to claim 4, Features: The monitoring service periodically connects to the shared memory. If the shared memory connection fails, the monitoring service needs to continue running for a period of time to scan whether there are any framework fault logs. If no new fault logs are scanned, the monitoring service will exit automatically.
Citation Information
Cited By
Hotspot detection method and system based on domestic Shenwei platform
CN119782130A
Hotspot detection method and system based on domestic Shenwei platform
CN119782130B
