public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
@ 2022-07-26  6:48 vries at gcc dot gnu.org
  2022-07-26  6:48 ` [Bug tdep/29408] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-26  6:48 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tdep/29408] [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
  2022-07-26  6:48 [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace vries at gcc dot gnu.org
@ 2022-07-26  6:48 ` vries at gcc dot gnu.org
  2022-08-04 10:34 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-07-26  6:48 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis.machado at arm dot com

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tdep/29408] [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
  2022-07-26  6:48 [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace vries at gcc dot gnu.org
  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
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-08-04 10:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14255
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14255&action=edit
Tentative patch

Fixes the failures:
...
Running /home/tdevries/gdb/src/gdb/testsuite/gdb.base/large-frame.exp ...

                === gdb Summary ===

# of expected passes            6
...

We do slightly overshoot:
...
$ gdb -q -batch ./outputs/gdb.base/large-frame/large-frame-O0 -ex "b func"
Breakpoint 1 at 0x400624
...
because according to the line info (which we can see if we compile
large-frame-2.c with debug info), the first insn after the prologue is
0x400620:
...
0000000000400610 <func>:
  400610:       d2880210        mov     x16, #0x4010                    //
#16400
  400614:       cb3063ff        sub     sp, sp, x16
  400618:       a9007bfd        stp     x29, x30, [sp]
  40061c:       910003fd        mov     x29, sp
  400620:       910043a0        add     x0, x29, #0x10
  400624:       97fffff0        bl      4005e4 <blah>
  400628:       52800000        mov     w0, #0x0                        // #0
  40062c:       a9407bfd        ldp     x29, x30, [sp]
  400630:       d2880210        mov     x16, #0x4010                    //
#16400
  400634:       8b3063ff        add     sp, sp, x16
  400638:       d65f03c0        ret
  40063c:       d503201f        nop
...
but that is a pre-existing problem.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tdep/29408] [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
  2022-07-26  6:48 [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace vries at gcc dot gnu.org
  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
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-08-04 13:05 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2022-August/191213.html

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tdep/29408] [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace
  2022-07-26  6:48 [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-08-04 13:05 ` vries at gcc dot gnu.org
@ 2022-08-04 13:24 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-08-04 13:24 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60adf22c1440723435262b9d867ebd76300c3325

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-04 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26  6:48 [Bug tdep/29408] New: [gdb, tdep/aarch64] FAIL: gdb.base/large-frame.exp: optimize=-O0: backtrace vries at gcc dot gnu.org
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

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