From af6df5f4a591ea3216d80fb34694a3c292e9b51e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 23 May 2019 00:38:14 +0200 Subject: [PATCH] Revert "Limit resources when running tests" This reverts commit 9567bbe65fc64c870ea5e7925c809ba70c4a896b. --- configure.ac | 3 +-- test/default/cmptest.h | 33 --------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/configure.ac b/configure.ac index 9a8fa74a..e1fceada 100644 --- a/configure.ac +++ b/configure.ac @@ -554,7 +554,7 @@ AC_SUBST(CFLAGS_AESNI) AC_SUBST(CFLAGS_PCLMUL) AC_SUBST(CFLAGS_RDRAND) -AC_CHECK_HEADERS([sys/mman.h sys/random.h sys/resource.h intrin.h]) +AC_CHECK_HEADERS([sys/mman.h sys/random.h intrin.h]) AC_MSG_CHECKING([if _xgetbv() is available]) AC_LINK_IFELSE( @@ -796,7 +796,6 @@ AC_FUNC_ALLOCA AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_CHECK_FUNCS([arc4random arc4random_buf]) AC_CHECK_FUNCS([mmap mlock madvise mprotect]) - AC_CHECK_FUNCS([setrlimit]) AC_MSG_CHECKING(for getrandom with a standard API) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ diff --git a/test/default/cmptest.h b/test/default/cmptest.h index edffe822..1ecc5cd9 100644 --- a/test/default/cmptest.h +++ b/test/default/cmptest.h @@ -14,19 +14,9 @@ #include #include -#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_SETRLIMIT) -# include -# include -# include -#endif - #include "sodium.h" #include "quirks.h" -#ifndef MAX_MEMORY_TESTS -# define MAX_MEMORY_TESTS 67108864 -#endif - #ifdef __EMSCRIPTEN__ # undef TEST_SRCDIR # define TEST_SRCDIR "/test-data" @@ -47,25 +37,6 @@ int xmain(void); static unsigned char *guard_page; -static int set_resource_limits(void) -{ - int res = 0; - -#if defined(RLIM_INFINITY) && defined(HAVE_SETRLIMIT) - struct rlimit limits; - - limits.rlim_cur = limits.rlim_max = MAX_MEMORY_TESTS; -# ifdef RLIMIT_AS - res |= setrlimit(RLIMIT_AS, &limits); -# endif -# ifdef RLIMIT_DATA - res |= setrlimit(RLIMIT_DATA, &limits); -# endif -#endif - - return res; -} - #ifdef BENCHMARKS # include @@ -165,8 +136,6 @@ int main(void) unsigned long long ts_end; unsigned int i; - (void) set_resource_limits(); - if (sodium_init() != 0) { return 99; } @@ -202,8 +171,6 @@ int main(void) unsigned char *_guard_page; int c; - (void) set_resource_limits(); - if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) { perror("fopen(" TEST_NAME_RES ")"); return 99;