aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-03-07 13:48:47 +0100
committerMike Frysinger <vapier@gentoo.org>2016-11-12 00:44:33 -0500
commit36234ceda21820d2f874067553e7faae763a40cf (patch)
treee2e009b052d385a5c6d73bffd8cb76bf29218a1e
parent5af60b38e45f490fde467b4db137fed153ad961b (diff)
downloadglibc-36234ceda21820d2f874067553e7faae763a40cf.zip
glibc-36234ceda21820d2f874067553e7faae763a40cf.tar.gz
glibc-36234ceda21820d2f874067553e7faae763a40cf.tar.bz2
test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648]
With older kernels, it is mostly ineffective because it causes malloc to switch from sbrk to mmap (potentially invalidating malloc testing compared to what real appliations do). With newer kernels which have switched to enforcing RLIMIT_DATA for mmap as well, some test cases will fail in an unintended fashion because the limit which was set previously does not include room for all mmap mappings. (cherry picked from commit 900056024b75eae8b550d7fee1dec9e71f28344e) (cherry picked from commit e6eea05ee7bc49dbe9531620595fd7f6ca587dcd)
-rw-r--r--test-skeleton.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/test-skeleton.c b/test-skeleton.c
index a2edf83..7ab3529 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -428,23 +428,6 @@ main (int argc, char *argv[])
setrlimit (RLIMIT_CORE, &core_limit);
#endif
-#ifdef RLIMIT_DATA
- /* Try to avoid eating all memory if a test leaks. */
- struct rlimit data_limit;
- if (getrlimit (RLIMIT_DATA, &data_limit) == 0)
- {
- if (TEST_DATA_LIMIT == RLIM_INFINITY)
- data_limit.rlim_cur = data_limit.rlim_max;
- else if (data_limit.rlim_cur > (rlim_t) TEST_DATA_LIMIT)
- data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT,
- data_limit.rlim_max);
- if (setrlimit (RLIMIT_DATA, &data_limit) < 0)
- printf ("setrlimit: RLIMIT_DATA: %m\n");
- }
- else
- printf ("getrlimit: RLIMIT_DATA: %m\n");
-#endif
-
/* We put the test process in its own pgrp so that if it bogusly
generates any job control signals, they won't hit the whole build. */
if (setpgid (0, 0) != 0)