I downloaded and compiled gdb-7.1, and found it to be unusable for me. Whereas
gdb-7.0.1 worked well, 7.1 will often freeze when doing simple things like
setting a new breakpoint at a specified line number. An strace of the gdb
process shows it to be spinning hard, calling the lseek() syscall over and over
(several thousand times is typical), before completing. Setting a breakpoint
can take anywhere from 5 seconds to several minutes, with the CPU hard-spinning
the whole time. This is entirely reproducible for me, I have just to set a
breakpoint at main(), run my debugging binary, then type "b 200" to add another
breakpoint at line 200 in the source module holding main. This takes several
seconds in 7.1, and is effectively instantaneous in 7.0.1. I have also seen it
hang when asked to print the value of a local variable.
I compiled gdb from sources, using gcc-4.2.4.
I realize that the git tree isn't fine-grained to individual commits, but having
the bisection ought still to help. The bad behaviour first appears at revision
f03d5cd98559bdc7ee93b72383d9e50999310a97. It was fixed at revision
f89f0ae081112db5dfad6264f481e6ca88b4d252, but unfortunately that revision is not
in the 7.1 release.
I've had to revert to 7.0.1 because of this bug.
Thanks for the git bisect. I can back-port
f89f0ae081112db5dfad6264f481e6ca88b4d252 and related fixes to be put into 7.1.1
Can you give me a small reproducer so I can find out what the problem was
exactly and verify the fix ?
I've been trying to find a non-proprietary binary that exhibits the behaviour.
So far, it is quite reproducible on every binary I build for work, but that code
is not publicly available.
My KDE builds generate similar-sized binaries (50+ MB debugging binaries on
x86_64), and are built on the same compiler, but don't exhibit this behaviour.
It's seems to be something subtle, I'm still trying to find some way for others
to reproduce the problem.
Created attachment 4674 [details]
could you try this branch:
$ git clone git://sourceware.org/git/archer.git
$ cd archer
$ git checkout archer-swagiaal-temp-71patch
this is 7.1 with the patch. I have also attached the patch if that is preferable.
I applied the patch from the attachment, and the problem no longer appears in my
(reproducible) test cases. I'm closing the bug. Thank you.
Awesome!.. I'll post the fix upstream
Subject: Bug 11408
Module name: src
Changes by: email@example.com 2010-04-08 17:15:12
gdb : ChangeLog buildsym.c cp-namespace.c
gdb/testsuite : ChangeLog
gdb/testsuite/gdb.cp: gdb2384-base.cc gdb2384-base.h
PR 11408: Backport using_directives memory leak fix.
2010-04-08 Sami Wagiaalla <firstname.lastname@example.org>
* cp-namespace.c (cp_add_using): Deleted.
(cp_add_using_directive): Use obstack allocations.
Merged the function cp_add_using into this one.
Added 'struct obstack *' argument.
* cp-support.h: Updated.
* dwarf2read.c (read_import_statement): Updated.
* buildsym.c (finish_block): Reset using_directives pointer
after block initialization.
2010-03-22 Sami Wagiaalla <email@example.com>
* gdb.cp/gdb2384-base.h: Created 'namespace B'.
* gdb.cp/gdb2384-base.cc: Use 'namespace B'.
*** Bug 11890 has been marked as a duplicate of this bug. ***
*** Bug 11316 has been marked as a duplicate of this bug. ***
This still happens for me with gdb 7.2.