Linux中的核心转储文件是什么?它提供什么信息? [英] What is a core dump file in Linux? What information does it provide?
问题描述
它基本上是使用的进程地址空间(从 mm_struct
结构,其中包含所有的虚拟内存区域)以及任何其他支持信息 * a ,在它崩溃时。
例如,假设您尝试取消引用NULL指针并接收SEGV信号,导致退出。作为该过程的一部分,操作系统会尝试将您的信息写入一个文件以供以后验证分析。
您可以将核心文件加载到调试器中可执行文件(例如,用于符号和其他调试信息),并尝试发现导致问题的原因。
* a :在内核版本2.6.38中, fs / exec.c / do_coredump()
是一个负责核心转储的人,你可以看到它通过了信号号码,退出代码和寄存器。它反过来将信号编号和寄存器传递给二进制格式(ELF,a.out等)转储器。
ELF转储器是 fs / binfmt_elf.c / elf_core_dump()
,您可以看到它在 fs / binfmt_elf.c / fill_note_info()
,然后返回输出进程空间。 p>
What is a core dump file in linux? What all information does it provide?
It's basically the process address space in use (from the mm_struct
structure which contains all the virtual memory areas), and any other supporting information*a, at the time it crashed.
For example, let's say you try to dereference a NULL pointer and receive a SEGV signal, causing you to exit. As part of that process, the operating system tries to write your information to a file for later post-mortem analysis.
You can load the core file into a debugger along with the executable file (for symbols and other debugging information, for example) and poke around to try and discover what caused the problem.
*a: in kernel version 2.6.38, fs/exec.c/do_coredump()
is the one responsible for core dumps and you can see that it's passed the signal number, exit code and registers. It in turn passes the signal number and registers to a binary-format-specific (ELF, a.out, etc) dumper.
The ELF dumper is fs/binfmt_elf.c/elf_core_dump()
and you can see that it outputs non-memory-based information, like thread details, in fs/binfmt_elf.c/fill_note_info()
, then returns to output the process space.
这篇关于Linux中的核心转储文件是什么?它提供什么信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!