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