Skip to content

Commit

Permalink
Merge pull request systemd#22448 from poettering/coredump-raise-sizes
Browse files Browse the repository at this point in the history
coredump: raise limits
  • Loading branch information
yuwata authored Feb 8, 2022
2 parents 217a610 + 56c29ba commit 5573ed2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions man/coredump.conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@

<listitem><para>The maximum size in bytes of a core which will be processed. Core dumps exceeding
this size may be stored, but the backtrace will not be generated. Like other sizes in this same
config file, the usual suffixes to the base of 1024 are allowed (B, K, M, G, T, P, and E).</para>
config file, the usual suffixes to the base of 1024 are allowed (B, K, M, G, T, P, and E). Defaults
to 1G on 32bit systems, 32G on 64bit systems.</para>

<para>Setting <varname>Storage=none</varname> and <varname>ProcessSizeMax=0</varname>
disables all coredump handling except for a log entry.</para>
Expand All @@ -96,8 +97,9 @@
<term><varname>ExternalSizeMax=</varname></term>
<term><varname>JournalSizeMax=</varname></term>

<listitem><para>The maximum (compressed or uncompressed) size in bytes of a core to be saved. Unit
suffixes are allowed just as in <option>ProcessSizeMax=</option>.</para></listitem>
<listitem><para>The maximum (compressed or uncompressed) size in bytes of a core to be saved in
separate files on disk (default: 1G on 32bit, 32G on 64bit systems) or in the journal (default:
10M). Unit suffixes are allowed just as in <option>ProcessSizeMax=</option>.</para></listitem>

<para><varname>ExternalSizeMax=infinity</varname> sets the core size to unlimited.</para>
</varlistentry>
Expand Down
10 changes: 8 additions & 2 deletions src/coredump/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@
#include "uid-alloc-range.h"
#include "user-util.h"

/* The maximum size up to which we process coredumps */
#define PROCESS_SIZE_MAX ((uint64_t) (2LLU*1024LLU*1024LLU*1024LLU))
/* The maximum size up to which we process coredumps. We use 1G on 32bit systems, and 32G on 64bit systems */
#if __SIZEOF_POINTER__ == 4
#define PROCESS_SIZE_MAX ((uint64_t) (1LLU*1024LLU*1024LLU*1024LLU))
#elif __SIZEOF_POINTER__ == 8
#define PROCESS_SIZE_MAX ((uint64_t) (32LLU*1024LLU*1024LLU*1024LLU))
#else
#error "Unexpected pointer size"
#endif

/* The maximum size up to which we leave the coredump around on disk */
#define EXTERNAL_SIZE_MAX PROCESS_SIZE_MAX
Expand Down

0 comments on commit 5573ed2

Please sign in to comment.