neondatabase/neon · warning

WARNING: disable cores setrlimit failed: %s

Error message

WARNING: disable cores setrlimit failed: %s

What it means

The neon Postgres extension calls setrlimit(RLIMIT_CORE, 0) at startup to suppress core dumps, because the process holds pageserver and WAL credentials that must not land on disk (the call is skipped only in WALPROPOSER_LIB simulation mode). If the syscall fails, typically EPERM in restricted sandboxes, only this warning is printed and startup continues; core dumps are then simply not guaranteed to be disabled.

Source

Thrown at pgxn/neon/neon_utils.c:138

/*
 * Disables core dump for the current process.
 */
void
disable_core_dump()
{
	struct rlimit rlim;

#ifdef WALPROPOSER_LIB			/* skip in simulation mode */
	return;
#endif

	rlim.rlim_cur = 0;
	rlim.rlim_max = 0;
	if (setrlimit(RLIMIT_CORE, &rlim))
	{
		int			save_errno = errno;

		fprintf(stderr, "WARNING: disable cores setrlimit failed: %s", strerror(save_errno));
	}
}

#ifndef WALPROPOSER_LIB

/*
 * On macOS with a libcurl that has IPv6 support, curl_global_init() calls
 * SCDynamicStoreCopyProxies(), which makes the program multithreaded. An ideal
 * place to call curl_global_init() would be _PG_init(), but Neon has to be
 * added to shared_preload_libraries, which are loaded in the Postmaster
 * process. The Postmaster is not supposed to become multithreaded at any point
 * in its lifecycle. Postgres doesn't have any good hook that I know of to
 * initialize per-backend structures, so we have to check this on any
 * allocation of a CURL handle.
 *
 * Free the allocated CURL handle with curl_easy_cleanup(3).
 *
 * https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies

View on GitHub (pinned to 8f60b04da4)

Solutions

  1. No functional action needed; the warning is informational
  2. To keep core suppression guaranteed, allow the setrlimit syscall in the container or seccomp profile
  3. Alternatively disable core dumps at the orchestrator level (ulimit in the unit file, core pattern, securityContext)
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Running the neon extension or safekeeper components under seccomp or container profiles that deny setrlimit; LSM or runtime policies restricting rlimit changes; platforms with limited rlimit support.

Common situations: Hardened Kubernetes pods with restricted seccomp or AppArmor; gVisor or Kata sandboxed runtimes; CI containers with tightened privilege sets. Functionality is unaffected; only the core-dump policy is.


AI-assisted analysis of neondatabase/neon@8f60b04da4 (2026-08-16). Data as JSON: /api/errors/9081c5c4667c934c. Report an issue: GitHub.