diff options
author | Dawid Potocki <dawid@dawidpotocki.com> | 2024-03-05 14:09:27 +1300 |
---|---|---|
committer | Dawid Potocki <dawid@dawidpotocki.com> | 2024-03-05 20:34:15 +1300 |
commit | 063e15900bda8453fb0fc6751e78d064501ccbae (patch) | |
tree | a4cd5f01dbca33a262333aff10e1e035217a30c8 /externals/breakpad/docs/linux_core_handler.md | |
parent | 537296095ab24eddcb196b5ef98004f91de9c8c2 (diff) |
Diffstat (limited to 'externals/breakpad/docs/linux_core_handler.md')
-rw-r--r-- | externals/breakpad/docs/linux_core_handler.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/externals/breakpad/docs/linux_core_handler.md b/externals/breakpad/docs/linux_core_handler.md new file mode 100644 index 0000000000..558940f2b6 --- /dev/null +++ b/externals/breakpad/docs/linux_core_handler.md @@ -0,0 +1,39 @@ +# How To Use Breakpad As a Coredump Handler on Linux + +This document presents a way to use Breakpad in order to generate +minidumps system wide on Linux. + +Please refer to [Linux starter guide](./linux_starter_guide.md) if +instead you want to integrate breakpad into your application. + +## Motivation + +When working on an embedded system, disk and memory space is often +limited and when a process crashes it must be restarted as soon as +possible. Sometime saving a full coredump takes to much time or +consumes too much space. + +## Breakpad Core Handler + +In such case the program `core_handler` can be use to generate +minidumps instead of coredumps. `core_handler` reads the firsts +sections of the coredump (where the various threads are described) +generated by Linux from the standard input and then directly reads +`/proc/<pid>/mem` to reconstruct the stacktraces. + +One can test it with: + +``` +# echo "|/usr/libexec/core_handler %P /var/lib/minidump/%e-%i.md" > + /proc/sys/kernel/core_pattern +# echo 1 > /proc/sys/kernel/core_pipe_limit +``` + +Be aware that a real world integration would likely require further +customization and so `core_handler` can be wrapped into a script (for +example to change the permission of the minidump file or to signal the +presence of the minidump to another service). + +Please refer to +[core(5)](https://man7.org/linux/man-pages/man5/core.5.html) for more +details. |