|
|
8ae002 |
commit 900056024b75eae8b550d7fee1dec9e71f28344e
|
|
|
8ae002 |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
8ae002 |
Date: Mon Mar 7 13:48:47 2016 +0100
|
|
|
8ae002 |
|
|
|
8ae002 |
test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648]
|
|
|
8ae002 |
|
|
|
8ae002 |
With older kernels, it is mostly ineffective because it causes malloc
|
|
|
8ae002 |
to switch from sbrk to mmap (potentially invalidating malloc testing
|
|
|
8ae002 |
compared to what real appliations do). With newer kernels which
|
|
|
8ae002 |
have switched to enforcing RLIMIT_DATA for mmap as well, some test
|
|
|
8ae002 |
cases will fail in an unintended fashion because the limit which was
|
|
|
8ae002 |
set previously does not include room for all mmap mappings.
|
|
|
8ae002 |
|
|
|
8ae002 |
Index: b/test-skeleton.c
|
|
|
8ae002 |
===================================================================
|
|
|
8ae002 |
--- a/test-skeleton.c
|
|
|
8ae002 |
+++ b/test-skeleton.c
|
|
|
8ae002 |
@@ -356,23 +356,6 @@ main (int argc, char *argv[])
|
|
|
8ae002 |
setrlimit (RLIMIT_CORE, &core_limit);
|
|
|
8ae002 |
#endif
|
|
|
8ae002 |
|
|
|
8ae002 |
-#ifdef RLIMIT_DATA
|
|
|
8ae002 |
- /* Try to avoid eating all memory if a test leaks. */
|
|
|
8ae002 |
- struct rlimit data_limit;
|
|
|
8ae002 |
- if (getrlimit (RLIMIT_DATA, &data_limit) == 0)
|
|
|
8ae002 |
- {
|
|
|
8ae002 |
- if (TEST_DATA_LIMIT == RLIM_INFINITY)
|
|
|
8ae002 |
- data_limit.rlim_cur = data_limit.rlim_max;
|
|
|
8ae002 |
- else if (data_limit.rlim_cur > (rlim_t) TEST_DATA_LIMIT)
|
|
|
8ae002 |
- data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT,
|
|
|
8ae002 |
- data_limit.rlim_max);
|
|
|
8ae002 |
- if (setrlimit (RLIMIT_DATA, &data_limit) < 0)
|
|
|
8ae002 |
- printf ("setrlimit: RLIMIT_DATA: %m\n");
|
|
|
8ae002 |
- }
|
|
|
8ae002 |
- else
|
|
|
8ae002 |
- printf ("getrlimit: RLIMIT_DATA: %m\n");
|
|
|
8ae002 |
-#endif
|
|
|
8ae002 |
-
|
|
|
8ae002 |
/* We put the test process in its own pgrp so that if it bogusly
|
|
|
8ae002 |
generates any job control signals, they won't hit the whole build. */
|
|
|
8ae002 |
setpgid (0, 0);
|