Hi Jim, > setrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 > getrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
No brk() calls. It looks really like GCC has optimized out the two malloc() calls. And indeed, with a recent GCC 4.7 snapshot I reproduce the problem. A workaround would be to use -fno-builtin-malloc. But I can just as well disable the optimization in the test: 2012-02-04 Bruno Haible <br...@clisp.org> get-rusage-as, get-rusage-data tests: Avoid test failure with gcc-4.7. * tests/test-get-rusage-as.c (main): Assign the malloc() results to global variables. * tests/test-get-rusage-data.c (main): Likewise. Reported by Jim Meyering. --- tests/test-get-rusage-as.c.orig Sat Feb 4 12:58:13 2012 +++ tests/test-get-rusage-as.c Sat Feb 4 12:51:53 2012 @@ -23,6 +23,9 @@ #include "macros.h" +void *memchunk1; +void *memchunk2; + int main () { @@ -30,11 +33,11 @@ value1 = get_rusage_as (); - malloc (0x88); + memchunk1 = malloc (0x88); value2 = get_rusage_as (); - malloc (0x281237); + memchunk2 = malloc (0x281237); value3 = get_rusage_as (); --- tests/test-get-rusage-data.c.orig Sat Feb 4 12:58:13 2012 +++ tests/test-get-rusage-data.c Sat Feb 4 12:52:38 2012 @@ -23,6 +23,9 @@ #include "macros.h" +void *memchunk1; +void *memchunk2; + int main () { @@ -30,11 +33,11 @@ value1 = get_rusage_data (); - malloc (0x88); + memchunk1 = malloc (0x88); value2 = get_rusage_data (); - malloc (0x281237); + memchunk2 = malloc (0x281237); value3 = get_rusage_data ();