-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Labels
Description
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})