Skip to content

Unable to enable core dumps #166

@AdamDorwart

Description

@AdamDorwart

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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions