From 34ffaf66e9a52f3944d664126bedf05c1581b8dc Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 11 Apr 2018 19:43:28 -0400 Subject: [PATCH] * lib/asan-dg.exp: Don't run tests if ulimit -v is set. From-SVN: r259333 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/asan-dg.exp | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9bb1a703a2b..578e73b15e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-11 Jason Merrill + + * lib/asan-dg.exp (check_effective_target_fsanitize_address): False + if ulimit -v is set. + 2018-04-11 Bin Cheng PR testsuite/85190 diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp index 25f1de45879..39451b98a60 100644 --- a/gcc/testsuite/lib/asan-dg.exp +++ b/gcc/testsuite/lib/asan-dg.exp @@ -18,9 +18,24 @@ # code, 0 otherwise. proc check_effective_target_fsanitize_address {} { - return [check_no_compiler_messages fsanitize_address executable { + if ![check_no_compiler_messages fsanitize_address executable { int main (void) { return 0; } - }] + }] { + return 0; + } + + # asan doesn't work if there's a ulimit on virtual memory. + if ![is_remote target] { + if [catch {exec sh -c "ulimit -v"} ulimit_v] { + # failed to get ulimit + } elseif [regexp {^[0-9]+$} $ulimit_v] { + # ulimit -v gave a numeric limit + warning "skipping asan tests due to ulimit -v" + return 0; + } + } + + return 1; } proc asan_include_flags {} { -- 2.30.2