olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1418978-3-2.patch

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