Core Dump File Parsing
Description
Parse the core dump file.
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Notes
The GDB is required for core dump parsing. You need to install the GDB in advance by using package management (including apt-get install gdb or yum install gdb). For details about the installation procedure and usage, see GDB official documentation.
Command
asys analyze -r=coredump --exe_file=filename --core_file=filename --reg=reglevel --symbol=value --output=path
Parameters
- r: specifies the parsing mode. This parameter is mandatory. Set it to coredump. The process is interrupted and exits during task execution. When the software exits, errors such as Segmentation fault are reported. You can use this function to parse the core file generated by the core dump and obtain the stack file (*.txt file) in stackcore format for subsequent fault locating.
- exe_file: executable file for program core dump. Set this parameter to the file name containing the path. The core dump mode is mandatory. Ensure that the value matches the value of core_file. Otherwise, the parsing result is incorrect.
- core_file: core file generated when a program core dump occurs. Set this parameter to the file name containing the path. The core dump mode is mandatory. Ensure that the value matches exe_file. Otherwise, the parsing result is incorrect.
- reg: It specifies mode for adding register data for the core dump function. The value can only be 0, 1, or 2. The default value is 0. The parameter is optional in coredump mode.
- 0: Do not add register data.
- 1: Add one piece of register data for each thread.
- 2: Add register data to all thread stacks. (This operation will occupy a large number of host resources and is time-consuming.)
- symbol: It specifies the parsing mode of the core dump function. The value can only be 0 and 1. The default value is 0. The parameter is optional in coredump mode. If the address does not exist or stack overflow occurs, the asys tool may fail to parse the core dump function.
- 0: All lines with addresses are parsed into a stackcore file. Other lines are not parsed and Ignore is displayed.
- 1: Parse only in. () line. Other lines retain the original data of the GDB stack.
- output (optional): Its value is used as the prefix of the result output directory of the asys tool. That is, the final output directory is {output}/asys_output_timestamp. If the command does not contain the output parameter, the output is stored in the command execution directory. If the value of output is empty or invalid, the specified directory does not have the write permission, or the directory fails to be created, the asys tool exits and reports an error.
Usage Example and Output Description
- symbol is set to 0 (all address lines are parsed).
asys analyze -r=coredump --exe_file=atrace_test --core_file=core_atrace_test_001 --symbol=0 --output=$HOME/dfx_info
The following is an example of the parsed stackcore file. You can use the stackcore file parsing function of the asys tool to further parse the file.
[process] crash reason: SIGABRT crash pid: 37246 crash tid: 37246 [stack] Thread 1 (37246) #00 0x00007fbad83792bf 0x00007fbad830b000 /usr/local/python3.7.5/lib/libpython3.7m.so.1.0 #01 Ignore #02 0x00007fbad83d8c22 0x00007fbad830b000 /usr/local/python3.7.5/lib/libpython3.7m.so.1.0 #03 0x00007fbad83e9648 0x00007fbad830b000 /usr/local/python3.7.5/lib/libpython3.7m.so.1.0 ...... [maps] Start Addr End Addr Size Offset objfile 0x562677ed1000 0x562677ed2000 0x1000 0x0 /usr/local/python3.7.5/bin/python3.7 0x562677ed2000 0x562677ed3000 0x1000 0x1000 /usr/local/python3.7.5/bin/python3.7 0x562677ed3000 0x562677ed4000 0x1000 0x2000 /usr/local/python3.7.5/bin/python3.7 0x562677ed4000 0x562677ed5000 0x1000 0x2000 /usr/local/python3.7.5/bin/python3.7 ...... - symbol is set to 1 (only in ?? () lines () lines)
asys analyze -r=coredump --exe_file=atrace_test --core_file=core_atrace_test_002 --symbol=1 --output=$HOME/dfx_info
The following is an example of the parsed stackcore file. You can use the stackcore file parsing function of the asys tool to further parse the file.
[process] crash reason: SIGABRT crash pid: 37246 crash tid: 37246 [stack] Thread 1 (37246) #00 0x00007fbad83792bf in lookdict_unicode (value_addr=0x7ffea1e917e8, hash=<optimized out>, key=<optimized out>, mp=0x7fba98907fa0) at Objects/dictobject.c:811 #01 lookdict_unicode (mp=0x7fba98907fa0, key=<optimized out>, hash=<optimized out>, value_addr=0x7ffea1e917e8) at Objects/dictobject.c:783 #02 0x00007fbad83d8c22 in PyDict_GetItem (op=op@entry=0x7fba98907fa0, key=key@entry=0x7fba9a15b570) at Objects/dictobject.c:1327 #03 0x00007fbad83e9648 in _PyObject_GenericGetAttrWithDict (obj=obj@entry=0x7fba989083b0, name=name@entry=0x7fba9a15b570, dict=0x7fba98907fa0, dict@entry=0x0, suppress=suppress@entry=0) at Objects/object.c:1268 ...... [maps] Start Addr End Addr Size Offset objfile 0x562677ed1000 0x562677ed2000 0x1000 0x0 /usr/local/python3.7.5/bin/python3.7 0x562677ed2000 0x562677ed3000 0x1000 0x1000 /usr/local/python3.7.5/bin/python3.7 0x562677ed3000 0x562677ed4000 0x1000 0x2000 /usr/local/python3.7.5/bin/python3.7 0x562677ed4000 0x562677ed5000 0x1000 0x2000 /usr/local/python3.7.5/bin/python3.7 ......