diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2017-07-06 07:59:00 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2017-07-06 07:59:00 +0000 |
commit | 1c227d0049bd21f68905b91e84f3bdbd606f9a3d (patch) | |
tree | a796bcf22be6310dd31765fe0a180be4428af6db | |
parent | 1f73e6d88857c1c39c95fea98775b6897316c08b (diff) | |
download | src-1c227d0049bd21f68905b91e84f3bdbd606f9a3d.tar.gz src-1c227d0049bd21f68905b91e84f3bdbd606f9a3d.zip |
: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
Notes
Notes:
svn path=/head/; revision=320727
-rw-r--r-- | contrib/netbsd-tests/lib/libc/stdio/t_printf.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/netbsd-tests/lib/libc/stdio/t_printf.c b/contrib/netbsd-tests/lib/libc/stdio/t_printf.c index 4cb19fe82513..5fda26ea2720 100644 --- a/contrib/netbsd-tests/lib/libc/stdio/t_printf.c +++ b/contrib/netbsd-tests/lib/libc/stdio/t_printf.c @@ -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); |