Skip to content
Permalink
Browse files

executor: do not call setrlimit(2) for RLIMIT_AS for NetBSD

Setting the limit caused abnormal failure during early init on NetBSD.
  • Loading branch information...
krytarowski authored and dvyukov committed Jan 14, 2019
1 parent 7ffdc16 commit 95485883f6451cd21e4f7643c32fad0b66bb134d
Showing with 5 additions and 3 deletions.
  1. +4 −2 executor/common_bsd.h
  2. +1 −1 pkg/csource/generated.go
@@ -280,9 +280,11 @@ static void sandbox_common()

// Some minimal sandboxing.
struct rlimit rlim;
#ifndef GOOS_openbsd
#ifdef GOOS_freebsd
// Documented bug in OpenBSD.
// This causes frequent random aborts on netbsd. Reason unknown.
// This causes frequent random aborts. Reason unknown.

// This also causes ENOMEM on NetBSD during early init.
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
#endif
@@ -647,7 +647,7 @@ static void sandbox_common()
if (setsid() == -1)
fail("setsid failed");
struct rlimit rlim;
#ifndef GOOS_openbsd
#ifdef GOOS_freebsd
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
#endif

0 comments on commit 9548588

Please sign in to comment.
You can’t perform that action at this time.