code:debugging
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| code:debugging [2015/11/11 17:28] – phil | code:debugging [2020/03/29 12:32] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 74: | Line 74: | ||
| (gdb) core-file /proc/kcore | (gdb) core-file /proc/kcore | ||
| </ | </ | ||
| + | |||
| + | ====== Enable Core-Dumps ====== | ||
| + | |||
| + | If running a segfaulting program with '' | ||
| + | feasible, enabling core-dumps and analyzing the dump later may be an option. | ||
| + | First, enable core dumps by setting maximum dump file size to something larger | ||
| + | than zero (or, as shown here, unlimited): | ||
| + | < | ||
| + | $ ulimit -c unlimited | ||
| + | </ | ||
| + | Dump output is controlled via '' | ||
| + | // | ||
| + | //further specified and is in fact a bit outdated since // | ||
| + | //supports format specifiers. These are: | ||
| + | |||
| + | | %< | ||
| + | | %% | output one ' | ||
| + | | %p | pid | | ||
| + | | %P | global pid (init PID namespace) | | ||
| + | | %i | tid | | ||
| + | | %I | global tid (init PID namespace) | | ||
| + | | %u | uid (in initial user namespace) | | ||
| + | | %g | gid (in initial user namespace) | | ||
| + | | %d | dump mode, matches PR_SET_DUMPABLE and / | ||
| + | | %s | signal number | | ||
| + | | %t | UNIX time of dump | | ||
| + | | %h | hostname | | ||
| + | | %e | executable filename (may be shortened) | | ||
| + | | %E | executable path | | ||
| + | | %< | ||
| + | |||
| + | It is highly advisable to change // | ||
| + | //core// because the segfaulting process may not be allowed to write to its | ||
| + | current working directory (or it is not known). So better set an absolute path, | ||
| + | such as /// | ||
| + | may contain sensitive data! | ||
| + | |||
| ====== Links ====== | ====== Links ====== | ||
| * http:// | * http:// | ||
| Line 79: | Line 116: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | |||
code/debugging.txt · Last modified: by 127.0.0.1
