http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55679
--- Comment #17 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-12-16 21:41:25 UTC --- (In reply to comment #15) > The absence of RLIMIT_AS support on darwin appears to be a longstanding > issue... > > http://lists.apple.com/archives/Unix-porting/2007/Apr/msg00026.html > > and really should be fixed since SUSv3 Unix (which darwin claims to be) > demands > it. I have investigated the behavior of get/setrlimit(RLIMIT_AS...): (1) looking at sys/resource.h it appears that RLIMIT_AS is an (undocumented) alias of RLIMIT_RSS. (2) RLIMIT_AS seems to be correctly gotten/set by get/setrlimit. (3) However this does seems to affect the behavior of malloc. The following patch fixes the failure --- ../_clean/gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c 2012-12-13 11:08:19.000000000 +0100 +++ gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c 2012-12-16 21:11:59.000000000 +0100 @@ -2,7 +2,7 @@ /* { dg-do run { target setrlimit } } */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ -/* { dg-shouldfail "asan" } */ +/* { dg-shouldfail "asan" { ! *-*-darwin* } } */ #include <stdlib.h> #include <assert.h> @@ -18,4 +18,4 @@ int main(int argc, char **argv) { return 0; } -/* { dg-output "AddressSanitizer is unable to mmap" } */ +/* { dg-output "AddressSanitizer is unable to mmap" { xfail *-*-darwin* } } */