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