asan doesn't work under ulimit -v, which I want to use on shared hosts to avoid causing trouble with runaway processes. There doesn't seem to be a way within expect to access getrlimit/setrlimit, so in this patch I call out to the shell to test the current limit, and give up if I get back a number (rather than "unlimited" or an error message).
Thoughts?
commit e11e83293d6be03105eae16e92b00de591f4850e Author: Jason Merrill <ja...@redhat.com> Date: Fri Mar 23 11:14:50 2018 -0400 * gcc.dg/asan/asan.exp: Don't run tests if ulimit -v is set. * g++.dg/asan/asan.exp: Likewise. diff --git a/gcc/testsuite/g++.dg/asan/asan.exp b/gcc/testsuite/g++.dg/asan/asan.exp index 4ee8dd98697..a22d2ac5e20 100644 --- a/gcc/testsuite/g++.dg/asan/asan.exp +++ b/gcc/testsuite/g++.dg/asan/asan.exp @@ -24,6 +24,13 @@ load_lib asan-dg.exp dg-init asan_init +# asan doesn't work if there's a ulimit on virtual memory. +if ![is_remote target] { + if [regexp {^[0-9]+$} "[exec ulimit -v]"] { + return + } +} + # Main loop. if [check_effective_target_fsanitize_address] { gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/asan/*.c]] "" "" diff --git a/gcc/testsuite/gcc.dg/asan/asan.exp b/gcc/testsuite/gcc.dg/asan/asan.exp index 7b669056a97..bfe36e524dd 100644 --- a/gcc/testsuite/gcc.dg/asan/asan.exp +++ b/gcc/testsuite/gcc.dg/asan/asan.exp @@ -26,6 +26,13 @@ load_lib asan-dg.exp dg-init asan_init +# asan doesn't work if there's a ulimit on virtual memory. +if ![is_remote target] { + if [regexp {^[0-9]+$} "[exec ulimit -v]"] { + return + } +} + # Main loop. if [check_effective_target_fsanitize_address] { gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/asan/*.c]] "" ""