On Tue, Apr 3, 2018 at 1:23 PM, Jason Merrill <ja...@redhat.com> wrote:
> On Tue, Apr 3, 2018 at 12:56 PM, Jason Merrill <ja...@redhat.com> wrote:
>> On Mon, Mar 26, 2018 at 4:01 PM, Jason Merrill <ja...@redhat.com> wrote:
>>>
>>> On Mon, Mar 26, 2018 at 2:55 PM, Andreas Schwab <sch...@linux-m68k.org>
>>> wrote:
>>> > On Mär 26 2018, Jakub Jelinek <ja...@redhat.com> wrote:
>>> >> On Mon, Mar 26, 2018 at 08:33:41PM +0200, Andreas Schwab wrote:
>>> >>> On Mär 26 2018, Jason Merrill <ja...@redhat.com> wrote:
>>> >>>
>>> >>> >     if [catch {exec sh ulimit -v} ulimit_v] {
>>> >>>
>>> >>> expect1.1> exec sh ulimit -v
>>> >>> sh: ulimit: No such file or directory
>>> >>>     while executing
>>> >>> "exec sh ulimit -v"
>>> >>
>>> >> Perhaps
>>> >>       if [catch {exec sh -c ulimit -v} ulimit_v] {
>>> >
>>> > expect1.1> exec sh -c ulimit -v
>>> > unlimited
>>> > expect1.2> exec sh -c {ulimit -v}
>>> > 4194304
>>>
>>> OK, so
>>>
>>> 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
>>>         return
>>>     }
>>> }
>>
>> This version adds a warning.  OK for trunk?

And this one puts the check in asan_init rather than its users.  OK?
commit 8b2e4c11607171426da477d6a81225e333c0b735
Author: Jason Merrill <ja...@redhat.com>
Date:   Fri Mar 23 11:14:50 2018 -0400

            * lib/asan-dg.exp (asan_init): Don't run tests if ulimit -v is set.

diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp
index 25f1de45879..11a96ad000a 100644
--- a/gcc/testsuite/lib/asan-dg.exp
+++ b/gcc/testsuite/lib/asan-dg.exp
@@ -89,6 +89,17 @@ proc asan_init { args } {
     global asan_saved_TEST_ALWAYS_FLAGS
     global asan_saved_ALWAYS_CXXFLAGS
 
+    # 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 -code return
+	}
+    }
+
     set link_flags ""
     if ![is_remote host] {
 	if [info exists TOOL_OPTIONS] {

Reply via email to