From cdbc611a5ef23702ae7478fe099d8b6dde4e817e Mon Sep 17 00:00:00 2001 From: Bruce Korb Date: Wed, 17 Nov 2010 12:57:10 -0800 Subject: [PATCH] Do an early malloc/free under Linux to bypass setrlimit bug --- ChangeLog | 6 ++++++ tests/test-dprintf-posix2.c | 2 ++ tests/test-fprintf-posix3.c | 2 ++ 3 files changed, 10 insertions(+) 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) -- 2.39.5