memguard icon indicating copy to clipboard operation
memguard copied to clipboard

Unable to enable core dumps

Open AdamDorwart opened this issue 8 months ago • 0 comments

Describe the bug The documentation says

Core dumps are disabled by default. If you absolutely require them, you can enable them by using unix.Setrlimit to set RLIMIT_CORE to an appropriate value.

However the DisableCoreDumps calls unix.Setrlimit(unix.RLIMIT_CORE, &unix.Rlimit{Cur: 0, Max: 0}) which sets the hard limit at 0. Any future calls to unix.Setrlimit that attempt to raise Cur/Max will result in an operation not permitted. This also applies to any children processes (exec.Command).

Either the library should only set the soft limit or disabling coredumps should be configurable.

To Reproduce Steps to reproduce the behaviour:

  1. Use memguard
  2. Attempt a unix.Setrlimit(unix.RLIMIT_CORE, &unix.Rlimit{Cur: 1, Max: 1})

AdamDorwart avatar May 18 '25 17:05 AdamDorwart