public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
Date: Tue, 26 Jul 2022 06:48:33 +0000	[thread overview]
Message-ID: <bug-29408-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29408

            Bug ID: 29408
           Summary: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp:
                    optimize=-O0: backtrace
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I'm running into:
...
FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
FAIL: gdb.base/large-frame.exp: optimize=-O1: backtrace
FAIL: gdb.base/large-frame.exp: optimize=-O2: backtrace
...

In more detail:
...
(gdb) PASS: gdb.base/large-frame.exp: optimize=-O0: continue to breakpoint:
blah
backtrace^M
#0  blah (a=0xffffffffabf0) at
/home/tdevries/gdb/src/gdb/testsuite/gdb.base/large-frame-1.c:24^M
#1  0x0000000000400628 in func ()^M
Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M
(gdb) FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
...

With this however, it passes:
...
diff --git a/gdb/testsuite/gdb.base/large-frame-2.c
b/gdb/testsuite/gdb.base/large-frame-2.c
index dd23c6da539..313a28c3790 100644
--- a/gdb/testsuite/gdb.base/large-frame-2.c
+++ b/gdb/testsuite/gdb.base/large-frame-2.c
@@ -20,7 +20,7 @@
 __attribute__ ((noinline)) int
 func (void)
 {
-  int a[4096];
+  int a[1];
   blah (a);
   return 0;
 }
...

Bisecting with the constant gives us a pass at 'a[1024-4]' and a fail at
a[1024-3].

Running with debug frame:
...
$ gdb -q -batch -iex "set debug frame 1" -iex "set trace-commands on" -x
./build/gdb/testsuite/outputs/gdb.base/large-frame/gdb.in.1 2>&1 | tee LOG
...
gives us the info that we run into the problems with unwinding:
...
    [frame] frame_id_eq:
l={stack=0xffffffffe330,code=0x0000000000400610,!special}, r={stack=\
0xffffffffe330,code=0x0000000000400610,!special} -> 1
...
at pc address 0x400610, which corresponds to func, and also (not shown here)
that the used unwinder is "aarch64 prologue".

Indeed with 'a[1024-4]' we have:
...
0000000000400610 <func>:
  400610:       d14007ff        sub     sp, sp, #0x1, lsl #12
...
and with 'a[1024-3]':
...
0000000000400610 <func>:
  400610:       d2820210        mov     x16, #0x1010                    //
#4112
  400614:       cb3063ff        sub     sp, sp, x16
...

So, does the aarch64 prologue analyzer fail at that point?  Checking with "set
debug aarch64 1" we get:
...
    [aarch64] aarch64_analyze_prologue: prologue analysis gave up addr=0x400614
opcode=0xcb3063ff
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-07-26  6:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26  6:48 vries at gcc dot gnu.org [this message]
2022-07-26  6:48 ` [Bug tdep/29408] " vries at gcc dot gnu.org
2022-08-04 10:34 ` vries at gcc dot gnu.org
2022-08-04 13:05 ` vries at gcc dot gnu.org
2022-08-04 13:24 ` vries at gcc dot gnu.org

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=bug-29408-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).