]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 7 Mar 2016 12:48:47 +0000 (13:48 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 30 May 2016 10:48:09 +0000 (12:48 +0200)
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)

ChangeLog
test-skeleton.c

index 88ad53a6a10f940a5805e791de538b9c6c06b4f0..2da868aa133ea5ce2a494aacf61c1167541f84cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-07  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #19648]
+       * test-skeleton.c (main): Do not set RLIMIT_DATA.
+
 2016-05-23  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #20111]
index a2edf836b7663a31e70b3995b60916004f68ece1..7ab3529c68d5116f45d2f951ebe37ff9ff26c110 100644 (file)
@@ -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)