aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Gorecki <dgr@semihalf.com>2021-12-20 05:27:12 +0000
committerWojciech Macek <wma@FreeBSD.org>2021-12-20 05:28:20 +0000
commit4f741801d86089a1c5d631ba1e0f1421cdcf7a7e (patch)
tree761f60311983a17db2ebc7f0cc303bf1a23c1120
parent18048b6e3cb647f2a18e1e51df1cf86a90fc6802 (diff)
downloadsrc-4f741801d86089a1c5d631ba1e0f1421cdcf7a7e.tar.gz
src-4f741801d86089a1c5d631ba1e0f1421cdcf7a7e.zip
t_setrlimit: Adjust resource limit to 20M
With ASLR enabled by default, RLIMIT_STACK test fails due to the fact that default stack gap can be as big as 15M. Because of that the resource limit of 4M results in test program receiving SIGSEGV immediately after exiting the setrlimit syscall. Since the idea of this test is to check if rlim_cur does not extend past rlim_max, adjusting the resource limit to 20M should not invalidate the test results. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D33116
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
index d5c50155e6dd..e7e294cb5df3 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
@@ -554,7 +554,11 @@ ATF_TC_BODY(setrlimit_stack, tc)
atf_tc_skip("https://bugs.freebsd.org/259969");
/* Ensure soft limit is not bigger than hard limit */
+#ifdef __FreeBSD__
+ res.rlim_cur = res.rlim_max = 20971520;
+#else
res.rlim_cur = res.rlim_max = 4192256;
+#endif
ATF_REQUIRE(setrlimit(RLIMIT_STACK, &res) == 0);
ATF_REQUIRE(getrlimit(RLIMIT_STACK, &res) == 0);
ATF_CHECK(res.rlim_cur <= res.rlim_max);