From: Srinath Avadhanula <srinathava@gmail.com>
To: gdb@sourceware.org
Subject: Massive slowdown printing values in gdb-7.1
Date: Mon, 06 Sep 2010 23:27:00 -0000 [thread overview]
Message-ID: <AANLkTinOCNYXVaU5S99zAH8BO12omJeGOzriLm9bmNxw@mail.gmail.com> (raw)
Hi,
I have been testing gdb 7.1 lately and have noticed that under some
circumstances (which I have been unable to reproduce with a simple
program), it is taking extremely long (~ 30 seconds) to print a simple
expreession such as
(gdb) p s->graph
where s is a symbol of type "SubsystemBlock" and graph is a sub-field
of the structure SubsystemBlock. This used to be pretty much
instantaneous in gdb 6.8.
I tried the sampling method described at [1] to find out where gdb
might be spending the most time. I found out that the five times I
interrupted gdb in the middle of the printing, I got almost the same
stack:
----------------- %< ---------------------------
#0 0x00000000004556d5 in strcmp_iw_ordered (string1=0x29eda318
"pir::PathBalanceChecker::visit(pir::BlockComp&)",
string2=0x7fffab13ade0 "getenv::graph") at utils.c:2740
#1 0x000000000050ce85 in lookup_partial_symbol (pst=<value optimized
out>, name=0x7fffab13ade0 "getenv::graph", linkage_name=0x0,
global=<value optimized out>, domain=VAR_DOMAIN) at symtab.c:1801
#2 0x000000000050d5d6 in lookup_symbol_aux_psymtabs (block_index=0,
name=0x7fffab13ade0 "getenv::graph", linkage_name=0x0,
domain=VAR_DOMAIN) at symtab.c:1607
#3 0x00000000005c2df1 in lookup_symbol_file (name=0x7fffab13ade0
"getenv::graph", linkage_name=0x0, block=0x296e67f0,
domain=VAR_DOMAIN, anonymous_namespace=0) at cp-namespace.c:504
#4 0x00000000005c301f in cp_lookup_symbol_in_namespace
(namespace=0xe3f1cd0 "getenv", name=0x2b086410 "graph",
linkage_name=0x0, block=0x296e67f0, domain=VAR_DOMAIN) at
cp-namespace.c:278
#5 0x00000000005c310b in cp_lookup_symbol_imports (scope=0x29eda318
"pir::PathBalanceChecker::visit(pir::BlockComp&)", name=0x7fffab13ade0
"getenv::graph", linkage_name=0x24 <Address 0x24 out of bounds>,
block=0x1, domain=VAR_DOMAIN, search_parents=45746864) at
cp-namespace.c:325
#6 0x00000000005c32bd in cp_lookup_symbol_imports (scope=0x1706a5c0
"std", name=0x2b086410 "graph", linkage_name=0x0, block=0x296e67f0,
domain=VAR_DOMAIN, search_parents=0) at cp-namespace.c:370
#7 0x00000000005c32bd in cp_lookup_symbol_imports (scope=0x2966da80
"SubsystemBlock", name=0x2b086410 "graph", linkage_name=0x0,
block=0x296e67f0, domain=VAR_DOMAIN, search_parents=1) at
cp-namespace.c:370
#8 0x00000000005c3320 in cp_lookup_symbol_namespace (scope=0x2966da80
"SubsystemBlock", name=0x2b086410 "graph", linkage_name=0x0,
block=0x296e67f0, domain=VAR_DOMAIN, search_parents=1) at
cp-namespace.c:405
#9 0x000000000050d9fd in lookup_symbol_aux (name=<value optimized
out>, block=0x2966d760, domain=VAR_DOMAIN, lang=language_cplus,
is_a_field_of_this=0x7fffab13b06c) at symtab.c:1406
----------------- %< ---------------------------
The strange thing about this stack is that the object "s" is of time
SubsystemBlock and the graph field is a direct sub-field of that
structure. However, gdb seems to be doing all sorts of lookups in
various unrelated namespaces: for example in
pir::PathBalanceChecker::visit etc. I don't know why gdb would be
looking at that symbol at all when attempting to print "s->graph".
Is this a known issue? I could provide more information if someone
could tell me what.
Regards,
Srinath
[1] http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux
next reply other threads:[~2010-09-06 23:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 23:27 Srinath Avadhanula [this message]
2010-09-06 23:31 ` Joel Brobecker
2010-09-07 1:23 ` Srinath Avadhanula
2010-09-07 1:36 ` Joel Brobecker
2010-09-07 2:18 ` Srinath Avadhanula
2010-09-07 16:24 ` Tom Tromey
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=AANLkTinOCNYXVaU5S99zAH8BO12omJeGOzriLm9bmNxw@mail.gmail.com \
--to=srinathava@gmail.com \
--cc=gdb@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