public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Subject: [pushed] gdb/testsuite: add max number of instructions check in gdb.base/unwind-on-each-insn.exp
Date: Sat, 22 Oct 2022 00:04:46 -0400	[thread overview]
Message-ID: <20221022040446.2312735-1-simon.marchi@polymtl.ca> (raw)

This test sends my CI in an infinite loop of failures.   We expect to
have a handful of iterations (5 on my development machine, where the
test passes fine)but the log shows that it went up to 104340 iterations:

    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id
    DUPLICATE: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id
    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: [string equal $fid $main_fid]
    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: get hexadecimal valueof "$pc"

Add a max instruction check, exit the loop if we reach 100 iterations.
This should allow the test to fail fast if there's a problem, but 100
iterations should be more than enough for when things are working.

Change-Id: I77978d593aca046068f9209272d82e1675ba17c2
---
 gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index 46bea800c1bb..faa6a1a3f064 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -149,6 +149,13 @@ for { set i_count 1 } { true } { incr i_count } {
 	    break
 	}
 
+	if { $i_count > 100 } {
+	    # We expect a handful of instructions, if we reach 100,
+	    # something is going wrong.  Avoid an infinite loop.
+	    fail "exceeded max number of instructions"
+	    break
+	}
+
 	gdb_test "stepi" ".*"
     }
 }

base-commit: 095e74caa783c9db83bc771510e7586bbc512397
-- 
2.38.0


WARNING: multiple messages have this Message-ID
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [pushed] gdb/testsuite: add max number of instructions check in gdb.base/unwind-on-each-insn.exp
Date: Sat, 22 Oct 2022 00:04:46 -0400	[thread overview]
Message-ID: <20221022040446.2312735-1-simon.marchi@polymtl.ca> (raw)
Message-ID: <20221022040446.Dvp8irbakL_AtWTFz7q7UB_GjN9yJ8RAbCvgucJkzy4@z> (raw)

This test sends my CI in an infinite loop of failures.   We expect to
have a handful of iterations (5 on my development machine, where the
test passes fine)but the log shows that it went up to 104340 iterations:

    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id
    DUPLICATE: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id
    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: [string equal $fid $main_fid]
    FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: get hexadecimal valueof "$pc"

Add a max instruction check, exit the loop if we reach 100 iterations.
This should allow the test to fail fast if there's a problem, but 100
iterations should be more than enough for when things are working.

Change-Id: I77978d593aca046068f9209272d82e1675ba17c2
---
 gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index 46bea800c1bb..faa6a1a3f064 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -149,6 +149,13 @@ for { set i_count 1 } { true } { incr i_count } {
 	    break
 	}
 
+	if { $i_count > 100 } {
+	    # We expect a handful of instructions, if we reach 100,
+	    # something is going wrong.  Avoid an infinite loop.
+	    fail "exceeded max number of instructions"
+	    break
+	}
+
 	gdb_test "stepi" ".*"
     }
 }

base-commit: 095e74caa783c9db83bc771510e7586bbc512397
-- 
2.38.0


             reply	other threads:[~2022-10-22  4:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22  4:04 Simon Marchi [this message]
2022-10-22  4:04 ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221022040446.2312735-1-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).