changeset 14111:bd4da34974de

Do an early malloc/free under Linux to bypass setrlimit bug
author Bruce Korb <bkorb@gnu.org>
date Wed, 17 Nov 2010 12:57:10 -0800
parents 2a17d7ccdcc0
children aa63a2324d15
files ChangeLog tests/test-dprintf-posix2.c tests/test-fprintf-posix3.c
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-16  Bruce Korb  <bkorb@gnu.org>
+
+	* tests/test-dprintf-posix2.c (main): call malloc & free before
+	setrlimit under Linux.  Avoid setrlimit/malloc interaction bug.
+	* tests/test-fprintf-posix3.c: ditto
+
 2010-11-16  Bruce Korb  <bkorb@gnu.org>
 
 	* libposix/bootstrap: generate libposix module file on the fly.
--- a/tests/test-dprintf-posix2.c
+++ b/tests/test-dprintf-posix2.c
@@ -64,6 +64,8 @@
 #endif
   /* On Linux systems, malloc() is limited by RLIMIT_AS.  */
 #ifdef RLIMIT_AS
+  free (malloc (0x88));
+
   if (getrlimit (RLIMIT_AS, &limit) < 0)
     return 77;
   if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > MAX_ALLOC_TOTAL)
--- a/tests/test-fprintf-posix3.c
+++ b/tests/test-fprintf-posix3.c
@@ -63,6 +63,8 @@
 #endif
   /* On Linux systems, malloc() is limited by RLIMIT_AS.  */
 #ifdef RLIMIT_AS
+  free (malloc (0x88));
+
   if (getrlimit (RLIMIT_AS, &limit) < 0)
     return 77;
   if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > MAX_ALLOC_TOTAL)