public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27593] New: Scrolling up can be extremely slow.
@ 2021-03-17 10:55 edd at theunixzoo dot co.uk
  2021-03-17 10:58 ` [Bug gdb/27593] " edd at theunixzoo dot co.uk
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: edd at theunixzoo dot co.uk @ 2021-03-17 10:55 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27593
           Summary: Scrolling up can be extremely slow.
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: edd at theunixzoo dot co.uk
  Target Milestone: ---

It seems that Bug #26024 (Cannot scroll up in asm view) has now been fixed, but
I notice that there are scenarios where scrolling up is extremely slow.

I have an 85MB crashing Rust binary here. If I run it to the crash the
backtrace is:
```
Thread 1 "tests-014a21cc2" received signal SIGABRT, Aborted.
0x00007ffff7b367bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff7b367bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff7b21535 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff7b78508 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7b7ec1a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007ffff7b7f184 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00005555557c7151 in ?? ()
#6  0x00005555557c6cc4 in ?? ()
#7  0x00005555557c63f1 in ?? ()
#8  0x00005555557c2987 in ?? ()
#9  0x00005555557d62d3 in ?? ()
#10 0x00005555557c0f33 in ?? ()
#11 0x00005555557c1182 in ?? ()
#12 0x00005555557bee09 in tests::main () at
/home/vext01/research/yorick/yk/tests/src/lib.rs:1
```

Switching to asm layout in the top frame (#0), scroll up works well.

Moving down the stack, #1 through #4 all scroll up fine too.

In #5 however, scrolling up one line:
  - Takes about 20 seconds.
  - Causes one CPU core to be pegged at 100% during this time.
  - Blocks the GDB TUI in the meantime.

The same happens for #6 through #12 (inclusive).

I had postured that, gdb has to do some kind of search when the file for a
frame's code is unknown, but #12 being slow to scroll disproves this.

This occurs on gdb-10.1 and the current (as of today) git code.

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

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

* [Bug gdb/27593] Scrolling up can be extremely slow.
  2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
@ 2021-03-17 10:58 ` edd at theunixzoo dot co.uk
  2021-03-17 16:47 ` ssbssa at sourceware dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: edd at theunixzoo dot co.uk @ 2021-03-17 10:58 UTC (permalink / raw)
  To: gdb-prs

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

Edd Barrett <edd at theunixzoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |edd at theunixzoo dot co.uk

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

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

* [Bug gdb/27593] Scrolling up can be extremely slow.
  2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
  2021-03-17 10:58 ` [Bug gdb/27593] " edd at theunixzoo dot co.uk
@ 2021-03-17 16:47 ` ssbssa at sourceware dot org
  2021-03-17 16:58 ` edd at theunixzoo dot co.uk
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2021-03-17 16:47 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
I think, when scrolling up, gdb starts disassembling from the beginning of the
function.
And frames #5 - #11 apparently don't belong to some executable or shared
library, so the search for the function beginning takes so long.

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

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

* [Bug gdb/27593] Scrolling up can be extremely slow.
  2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
  2021-03-17 10:58 ` [Bug gdb/27593] " edd at theunixzoo dot co.uk
  2021-03-17 16:47 ` ssbssa at sourceware dot org
@ 2021-03-17 16:58 ` edd at theunixzoo dot co.uk
  2021-03-17 17:21 ` ssbssa at sourceware dot org
  2022-03-06 17:34 ` [Bug tui/27593] " tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: edd at theunixzoo dot co.uk @ 2021-03-17 16:58 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Edd Barrett <edd at theunixzoo dot co.uk> ---
Thanks for the fast response.

I was about to say "why can't it disassemble backwards", but that's not really
doable on variable-length opcodes.

If it can't be optimised, then perhaps there could be some kind of "function
start cache" so that the cost is only paid once? Probably needs some user
feedback also?

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

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

* [Bug gdb/27593] Scrolling up can be extremely slow.
  2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
                   ` (2 preceding siblings ...)
  2021-03-17 16:58 ` edd at theunixzoo dot co.uk
@ 2021-03-17 17:21 ` ssbssa at sourceware dot org
  2022-03-06 17:34 ` [Bug tui/27593] " tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2021-03-17 17:21 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Hannes Domani <ssbssa at sourceware dot org> ---
Thinking about it a bit more, it's probably not the looking for the function
beginning, but the disassembling itself that's so slow.

I do have an example where I can reproduce the slowness when scrolling up (it's
just 1 second, but still), so I will try to profile this and see what's the
exact reason.

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

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

* [Bug tui/27593] Scrolling up can be extremely slow.
  2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
                   ` (3 preceding siblings ...)
  2021-03-17 17:21 ` ssbssa at sourceware dot org
@ 2022-03-06 17:34 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-03-06 17:34 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
          Component|gdb                         |tui

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

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

end of thread, other threads:[~2022-03-06 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 10:55 [Bug gdb/27593] New: Scrolling up can be extremely slow edd at theunixzoo dot co.uk
2021-03-17 10:58 ` [Bug gdb/27593] " edd at theunixzoo dot co.uk
2021-03-17 16:47 ` ssbssa at sourceware dot org
2021-03-17 16:58 ` edd at theunixzoo dot co.uk
2021-03-17 17:21 ` ssbssa at sourceware dot org
2022-03-06 17:34 ` [Bug tui/27593] " tromey at sourceware dot 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).