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:
- Use memguard
- Attempt a
unix.Setrlimit(unix.RLIMIT_CORE, &unix.Rlimit{Cur: 1, Max: 1})
Describe the bug
The documentation says
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 tounix.Setrlimitthat 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:
unix.Setrlimit(unix.RLIMIT_CORE, &unix.Rlimit{Cur: 1, Max: 1})