Bug 15519 - GDB 7.6 is 94x slower than GDB 7.5.1 using a certain core file
Summary: GDB 7.6 is 94x slower than GDB 7.5.1 using a certain core file
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.6
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-22 21:00 UTC by Paul Smith
Modified: 2013-06-27 22:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gprof output of FAST gdb run (220.18 KB, application/x-gzip)
2013-05-22 23:16 UTC, Paul Smith
Details
gprof output of SLOW gdb run (226.46 KB, application/x-gzip)
2013-05-22 23:19 UTC, Paul Smith
Details
pdf summary of call graph (34.81 KB, application/pdf)
2013-05-23 07:09 UTC, Phil Muldoon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Smith 2013-05-22 21:00:53 UTC
Please see this thread: http://sourceware.org/ml/gdb/2013-05/msg00074.html

I couldn't pick a particular component: the slowdown appears when running a macro on a core file from a C++ program; the macro walks through a list of objects referenced by another object.  Other core dumps from the same executable do not show this slowdown, and so far we haven't been able to reproduce it using live debugging.

Bisecting via Git declares the slowdown to have been introduced with this commit:

677b1bfabd372790dca4dad32fcb05dd77658728 is the first bad commit
commit 677b1bfabd372790dca4dad32fcb05dd77658728
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Nov 16 20:54:28 2012 +0000


I'll see if I can get more details.
Comment 1 Paul Smith 2013-05-22 23:16:32 UTC
Created attachment 7037 [details]
gprof output of FAST gdb run

This is the result of running gdb from the last "fast" commit, e8127d61d885e62b8cd3bde1d1d0989819295268.  GDB built with -g -pg.
Comment 2 Paul Smith 2013-05-22 23:19:28 UTC
Created attachment 7038 [details]
gprof output of SLOW gdb run

This is the result of running gdb from the first "slow" commit,
677b1bfabd372790dca4dad32fcb05dd77658728.  GDB built with -g -pg.
Comment 3 Phil Muldoon 2013-05-23 07:09:30 UTC
Created attachment 7039 [details]
pdf summary of call graph

Sometimes I find the summary graph produced by dot -Tpdf from the output provided by gprof2dot handy as a visual overview.  Was just looking at the output this morning out of curiosity and am attaching this file to see if it is useful for others looking at this bug
Comment 4 Sourceware Commits 2013-06-05 22:28:53 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	devans@sourceware.org	2013-06-05 22:28:52

Modified files:
	gdb            : ChangeLog cp-namespace.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.cp: derivation.cc derivation.exp 
Added files:
	gdb/testsuite/gdb.cp: derivation2.cc 

Log message:
	PR 15519
	* cp-namespace.c (find_symbol_in_baseclass): Call
	cp_lookup_symbol_in_namespace instead of cp_lookup_symbol_namespace.
	Check result of call to lookup_symbol_static.
	Call lookup_static_symbol_aux unconditionally.
	Call check_typedef on base types before accessing them.
	(cp_lookup_nested_symbol): Fix comment.
	
	testsuite/
	* gdb.cp/derivation2.cc: New file.
	* gdb.cp/derivation.cc (main): Call foo2.
	* gdb.cp/derivation.exp: Add tests for typedefs in another
	file, and when there's an active block.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15689&r2=1.15690
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cp-namespace.c.diff?cvsroot=src&r1=1.67&r2=1.68
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3685&r2=1.3686
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation2.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.cc.diff?cvsroot=src&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.exp.diff?cvsroot=src&r1=1.24&r2=1.25
Comment 5 Jan Kratochvil 2013-06-10 11:51:21 UTC
It seems to be fixed now, could you verify it, Paul?
Comment 6 Paul Smith 2013-06-10 15:23:06 UTC
Thanks Jan; I tested this morning's snapshot (7.6.50.20130610) and the massive slowdown is not there.  Nice!
Comment 7 Sourceware Commits 2013-06-27 22:18:35 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_6-branch
Changes by:	devans@sourceware.org	2013-06-27 22:18:33

Modified files:
	gdb            : ChangeLog cp-namespace.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.cp: derivation.cc derivation.exp 
Added files:
	gdb/testsuite/gdb.cp: derivation2.cc 

Log message:
	PR 15519
	* cp-namespace.c (find_symbol_in_baseclass): Call
	cp_lookup_symbol_in_namespace instead of cp_lookup_symbol_namespace.
	Check result of call to lookup_symbol_static.
	Call lookup_static_symbol_aux unconditionally.
	Call check_typedef on base types before accessing them.
	(cp_lookup_nested_symbol): Fix comment.
	
	testsuite/
	* gdb.cp/derivation2.cc: New file.
	* gdb.cp/derivation.cc (main): Call foo2.
	* gdb.cp/derivation.exp: Add tests for typedefs in another
	file, and when there's an active block.
	
	testsuite/
	* gdb.cp/derivation.exp: Make tests have unique names.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.55&r2=1.15260.2.56
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cp-namespace.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.65.2.1&r2=1.65.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.3580.2.22&r2=1.3580.2.23
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation2.cc.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=NONE&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.cc.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/derivation.exp.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.24&r2=1.24.2.1