This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/17764] New: Excessive seeking when reading debug data pegs the CPU @100%
- From: "mrsam at courier-mta dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sat, 27 Dec 2014 15:45:55 +0000
- Subject: [Bug gdb/17764] New: Excessive seeking when reading debug data pegs the CPU @100%
- Auto-submitted: auto-generated
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.