public inbox for
 help / color / mirror / Atom feed
From: Mark Wielaard <>
Cc: Mark Wielaard <>
Subject: [PATCH] tests: skip '(null)' symname frames in backtrace tests
Date: Sat,  4 Mar 2023 22:35:34 +0100	[thread overview]
Message-ID: <> (raw)

Some setups might have some frames for unknown (null) functions
in the thread backtrace. Skip these frames instead of failing

    * tests/backtrace.c (callback_verify): Check and skip nulls_seen.

Signed-off-by: Mark Wielaard <>
 tests/backtrace.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/backtrace.c b/tests/backtrace.c
index afc12fb9..55555301 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -90,6 +90,14 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
   Dwfl_Module *mod;
+  /* Skip frames for which there isn't a function name.  */
+  static int nulls_seen = 0;
+  if (symname == NULL)
+    {
+      nulls_seen++;
+      return;
+    }
+  frameno -= nulls_seen;
   /* See case 4. Special case to help out simple frame pointer unwinders. */
   static bool duplicate_sigusr2 = false;
   if (duplicate_sigusr2)

                 reply	other threads:[~2023-03-04 21:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

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

  git send-email \ \ \ \

* 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).