From: Bruce Korb Date: Wed, 17 Nov 2010 20:57:10 +0000 (-0800) Subject: Do an early malloc/free under Linux to bypass setrlimit bug X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cdbc611a5ef23702ae7478fe099d8b6dde4e817e;p=gnulib.git Do an early malloc/free under Linux to bypass setrlimit bug --- diff --git a/ChangeLog b/ChangeLog index 47d9c85d92..1a260574e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-16 Bruce Korb + + * 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 * libposix/bootstrap: generate libposix module file on the fly. diff --git a/tests/test-dprintf-posix2.c b/tests/test-dprintf-posix2.c index fd54070e34..2e1afe6108 100644 --- a/tests/test-dprintf-posix2.c +++ b/tests/test-dprintf-posix2.c @@ -64,6 +64,8 @@ main (int argc, char *argv[]) #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) diff --git a/tests/test-fprintf-posix3.c b/tests/test-fprintf-posix3.c index 6c0d5f2dae..d590a919a8 100644 --- a/tests/test-fprintf-posix3.c +++ b/tests/test-fprintf-posix3.c @@ -63,6 +63,8 @@ main (int argc, char *argv[]) #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)