|
crashrpt
|
Since v1.2.0, CrashRpt provides a tool named crprober.exe that can be used for automating crash report processing. To run the tool, go to bin directory and type crprober.exe in the command line.
bin folder and do not compile it yourself, you might experience some problems if Visual C++ 2010 Redistributable files are not installed on your machine. There may be error messages like 'The application configuration is incorrect' and so on. If you do not have Visual C++ 2010 Redistributable on your machine and do not want to install it, please compile the solution yourself as described in Compiling CrashRpt.Note that crprober.exe shouldn't be distributed to end users. They just won't be able to use it without symbol files.
The tool can be used to open error report files generated by any version of CrashRpt. However it works the best with reports created by version 1.1 and higher.
Typically an error report file contains an associated MD5 hash file. The crprober tool can perform integrity check using the MD5 hash file. When you receive a report using HTTP connection, the MD5 hash can be retrieved from 'md5' script argument. When you receive a report using E-mail, the hash is attached to the mail message. For more information, see Sending Error Reports.
The tool extracts information about the error report (its GUID, version of CrashRpt that generated the report, creation time in UTC format), the information about the application that sent the report (name, version, path to executable file, the list of loaded modules), information about the operating system (name, version, service pack, CPU info), and information about the exception (exception address, exception code, stack trace). It presents the extracted information in text form (creates a text file or writes to the terminal).
The error report can't be processed properly without symbol files (*.PDB) generated by Visual Studio for your application. You typically store the symbol files locally when preparing to software release. For more information, see Preparing to Software Release.
The crprober.exe is a console tool. It accepts several command line arguments. The arguments are listed in the table below:
| Name | Description |
| /? | Prints the usage help. |
| /f <input_file> | Required. Absolute or relative path to input ZIP file name. |
| /fmd5 <md5_file_or_dir> | Optional. Path to .md5 file containing MD5 hash for the <input_file> or directory name where to search for the .md5 file. If this parameter is omitted, the .md5 file is searched in the directory where <input_file> is located. |
| /o <out_file_or_dir> | Optional. Output file name or directory name. Or use empty name "" to direct output to terminal. If this parameter is omitted, output is not generated. |
| /sym <sym_search_dirs> | Optional. Symbol files search directory or list of directories separated with semicolon. If this parameter is omitted, symbol files are searched using the default search sequence. |
| /ext <extract_dir> | Optional. Specifies the directory where to extract all files contained in error report. If this parameter is omitted, files are not extracted. |
| /get <table_id> <column_id> <row_id> | Optional. Specifies the table ID, column ID and row index of the property to retrieve. If this parameter specified, the property is written to the output file or to terminal, as defined by /o parameter. For the list of properties you can retrieve, see Using CrashRptProbe API. |
The crprober tool can return one of the following return codes:
| Return Code | Meaning |
| 0 | OK. |
| 1 | Unexpected error. |
| 2 | Invalid command line argument. Ensure you pass correct parameters. |
| 3 | Integrity check failed (MD5 hash mismatch) |
| 4 | Error extracting file. Ensure the extraction path is correct. |
The following example processes the 'error_report.zip' file and writes output to the terminal. Symbol files are assumed to be located in 'D:\Symbol Files' directory.
The following example opens 'error_report.zip' file located in the current directory, performs integrity check using 'error_report.zip.md5' file and writes output to the 'error_report.zip.txt' file. Symbol files are assumed to be located in 'D:\Symbol Files' or in 'D:\MyApp\sym' directory.
The following example retrieves the application name from the error report and writes it to terminal:
The following example retrieves the count of rows in the MdmpModules table and writes it to terminal:
Let's assume you receive error reports over E-mail. To automate error reports extraction from E-mail attachments, you may use some extension of your mail program. For example, if you use Mozilla Thunderbird, you can use Attachment Extractor extension. You can configure the extension to determine the error report messages on the fly and extract email attachments (ZIP and MD5 files) to some folder.
When you have ZIP and MD5 files stored in the directory, you may want to process them all at once. You may want to process reports from the latest version of your application, ignoring all others. You may want to group similar error reports, for example, by stack trace of the exception thread. You may want to copy processed reports to some other directory, leaving not processed reports where they are. You also may want to move corrupted error reports to some folder, to move error reports not having exception information to another folder, and error reports not having symbols loaded for any stack frame to the third folder. You can automate this task using a batch (BAT) script.
Below an example batch script is presented (you can find the script in processing\scripts\postprocess.bat file).
When the script finishes, you will have similar error reports groupped in subfolders. The question is what group to start to analyze first? What groups contain the reports of errors occurring most often? The following simple Python script (you can find the script in processing\scripts\basic_stats.py file) can help you to answer this question by getting the count of .txt files in each subfolder and outputting the results into the text file.
The expected script output:
So, the 'subdir1' contains the reports about an error reported the most often. And the 'subdir5' contains the reports about an error reported the most rare.
1.8.12