public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17764] New: Excessive seeking when reading debug data pegs the CPU @100%
@ 2014-12-27 15:46 mrsam@courier-mta.com
  2014-12-27 15:52 ` [Bug gdb/17764] " jan.kratochvil at redhat dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: mrsam@courier-mta.com @ 2014-12-27 15:46 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17764
           Summary: Excessive seeking when reading debug data pegs the CPU
                    @100%
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: mrsam@courier-mta.com

GNU gdb (GDB) Fedora 7.8.1-30.fc21 spins at 100% cpu for over a minute, trying
to swallow a shared library:

Attaching to program: /proc/7919/exe, process 7919
Reading symbols from /home/mrsam/src/libcxxw-work/.libs/libcxxw.so.0...

[ ... about a minute later ... ] done.
Loaded symbols for /home/mrsam/src/libcxxw-work/.libs/libcxxw.so.0

Eventually gdb finishes loading, and everything's fine past that point. Looking
at the strace, for every 4096 bytes worth of, what's apparently the debug data,
gdb then proceed and seek to the same file position, exactly 256 times before
it reads the next 4096 bytes.

Seems like there 'ought to be a way to make this go faster.

It's a fairly big library, so it's understandable that it will take some time
to swallow this:

[mrsam@octopus libcxxw-work]$ size .libs/libcxxw.so.0.0.0
   text       data        bss        dec        hex    filename
14018479     411936       3608    14434023     dc3ee7    .libs/libcxxw.so.0.0.0
[mrsam@octopus libcxxw-work]$ ls -l .libs/libcxxw.so.0.0.0
-rwxr-xr-x 1 mrsam mrsam 60242156 Dec 27 10:27 .libs/libcxxw.so.0.0.0

But when gdb tries to read this, it's burning up the CPU, without much cause,
like this:

[256 seeks to the same file position total ]

lseek(8, 8781824, SEEK_SET)             = 8781824
lseek(8, 8781824, SEEK_SET)             = 8781824
lseek(8, 8781824, SEEK_SET)             = 8781824
read(8, "\377%B\350 some boring debug data"..., 4096) = 4096
lseek(8, 8785920, SEEK_SET)             = 8785920
lseek(8, 8785920, SEEK_SET)             = 8785920
lseek(8, 8785920, SEEK_SET)             = 8785920

[ ... 256 more seeks to another file position, total ... ]

lseek(8, 8785920, SEEK_SET)             = 8785920
lseek(8, 8785920, SEEK_SET)             = 8785920
read(8, "\377%B\340u more boring debug data"..., 4096) = 4096
lseek(8, 8790016, SEEK_SET)             = 8790016
lseek(8, 8790016, SEEK_SET)             = 8790016
lseek(8, 8790016, SEEK_SET)             = 8790016

[ another 256 seeks, and like that, for another minute or so... ]

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


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

end of thread, other threads:[~2014-12-30 16:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-27 15:46 [Bug gdb/17764] New: Excessive seeking when reading debug data pegs the CPU @100% mrsam@courier-mta.com
2014-12-27 15:52 ` [Bug gdb/17764] " jan.kratochvil at redhat dot com
2014-12-27 16:21 ` dje at google dot com
2014-12-27 17:09 ` mrsam@courier-mta.com
2014-12-27 17:43 ` dje at google dot com
2014-12-27 18:27 ` mrsam@courier-mta.com
2014-12-27 18:44 ` jan.kratochvil at redhat dot com
2014-12-27 18:45 ` jan.kratochvil at redhat dot com
2014-12-28  0:08 ` mrsam@courier-mta.com
2014-12-28 14:40 ` jan.kratochvil at redhat dot com
2014-12-29 15:53 ` hjl.tools at gmail dot com
2014-12-29 23:43 ` mrsam@courier-mta.com
2014-12-29 23:53 ` hjl.tools at gmail dot com
2014-12-30  1:23 ` mrsam@courier-mta.com
2014-12-30 16:27 ` hjl.tools at gmail dot com

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