-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content: linux coredumps #545
base: master
Are you sure you want to change the base?
Conversation
Deploying interrupt with
|
Latest commit: |
cf79987
|
Status: | ✅ Deploy successful! |
Preview URL: | https://81a3bc5b.interrupt.pages.dev |
Branch Preview URL: | https://blake-linux-coredumps.interrupt.pages.dev |
### Summary Add an article covering the cause, layout, and use of Linux coredumps in `memfaultd`.
502a76a
to
cf79987
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass!
expands to the PID of the crashing process. More information on the available | ||
expansions can be found in the `man core`[^man_core] page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other expansions that you think are useful, or are these basically the only two you use?
|
||
![]({% img_url linux-coredump/elf-core-layout.png %}) | ||
|
||
The above image gives us a very high level view of the layout of a coredump. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have a good chunk of info on the header, lets give it its own section:
The above image gives us a very high level view of the layout of a coredump. The | |
### ELF Header | |
The above image gives us a very high level view of the layout of a coredump. To start, the |
} Elf32_Phdr; | ||
``` | ||
|
||
Here is a brief breakdown of the fields in the program header: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since p_flags
is omitted:
Here is a brief breakdown of the fields in the program header: | |
Here is a brief breakdown of the fields we care about in the program header: |
The first two fields of the segment are fairly self explanatory, they represent | ||
the size of both the name and the descriptor. The `name` field is a string that | ||
represents the type of note. The `desc` field is a structure that contains the | ||
actual data of the note. The type field tells us what type of note we are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual data of the note. The type field tells us what type of note we are | |
actual data of the note. The `type` field tells us what type of note we are |
represent either the stack, heap, or any other segment of memory that was loaded | ||
into the process. | ||
|
||
## `procfs` Shallow Dive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking this section would fit better after core_pattern, or within core_pattern? Feels slightly out of place here
Now you're probably wondering, why did we go through all of this trouble to end | ||
up with a file that's largely the same as what the kernel would have produced? | ||
Well for one it allows us to add metadata to the coredump, but it also sets the | ||
stage for more advanced coredump handling in the future that we'll cover in the | ||
the next article. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great, I like the anticipation of reader questions a lot
Summary
Add an article covering the cause, layout, and use
of Linux coredumps in
memfaultd
.