svn commit: r320727 - head/contrib/netbsd-tests/lib/libc/stdio
Ngie Cooper
ngie at FreeBSD.org
Thu Jul 6 07:59:02 UTC 2017
Author: ngie
Date: Thu Jul 6 07:59:00 2017
New Revision: 320727
URL: https://svnweb.freebsd.org/changeset/base/320727
Log:
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.
Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.
MFC after: 1 month
MFC with: r320726
PR: 220502
Modified:
head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Thu Jul 6 07:45:20 2017 (r320726)
+++ head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Thu Jul 6 07:59:00 2017 (r320727)
@@ -127,6 +127,10 @@ ATF_TC_HEAD(snprintf_float, tc)
atf_tc_set_md_var(tc, "descr", "test that floating conversions don't"
" leak memory");
+#ifdef __FreeBSD__
+ atf_tc_set_md_var(tc, "require.memory", "64m");
+ atf_tc_set_md_var(tc, "require.user", "root");
+#endif
}
ATF_TC_BODY(snprintf_float, tc)
@@ -141,13 +145,16 @@ ATF_TC_BODY(snprintf_float, tc)
struct rlimit rl;
#ifdef __FreeBSD__
- atf_tc_expect_signal(SIGSEGV, "test segfaults; PR # 220502");
-#endif
-
+ rl.rlim_cur = rl.rlim_max = 32 * 1024 * 1024;
+ ATF_CHECK(setrlimit(RLIMIT_AS, &rl) != -1);
+ rl.rlim_cur = rl.rlim_max = 32 * 1024 * 1024;
+ ATF_CHECK(setrlimit(RLIMIT_DATA, &rl) != -1);
+#else
rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_AS, &rl) != -1);
rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_DATA, &rl) != -1);
+#endif
time(&now);
srand(now);
More information about the svn-src-all
mailing list