# HG changeset patch # User Bruce Korb # Date 1290027430 28800 # Node ID bd4da34974de1247a03029ddff3105eef340faa5 # Parent 2a17d7ccdcc0fd0ea9c1c25ad8661d1326700a49 Do an early malloc/free under Linux to bypass setrlimit bug diff --git a/ChangeLog b/ChangeLog --- 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 --- 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) diff --git a/tests/test-fprintf-posix3.c b/tests/test-fprintf-posix3.c --- 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)