Bug 11555 - 100% CPU for minutes trying to print expresion
Summary: 100% CPU for minutes trying to print expresion
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.1
: P2 critical
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 19:56 UTC by jlquinn
Modified: 2022-10-21 17:03 UTC (History)
3 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:


Attachments
Stack trace while gdb is busy inserting breakpoint (1.55 KB, text/plain)
2010-04-30 14:38 UTC, Jens Elmenthaler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jlquinn 2010-04-28 19:56:19 UTC
I've build gdb 7.1 on Centos 5.4 x86_64 using the system compiler.  I'm trying
to debug a c++ application and moved to 7.1 to get past issues in 6.8.  However,
when I stop and try to print an expression, it literally takes minutes for gdb
to come back with the answer on a 4 core 3GHz server.

A snapshot is below.  The vector below is standard stl vector and tokenOffset is
just a struct.  I C-c'd it after 3 minutes.  It will eventually print the right
answer, but it takes a ridiculous amount of time.

6.8 and 7.0.1 work as expected on the same debug binaries.  I built 7.0.1 out of
the box as well as 7.1.  6.8 is the system gdb.


537       vector<tokenOffset> toks;
(gdb) 
539       unsigned prev_type = TOK_WHITESPACE;
(gdb) p toks.size()
Quit
(gdb) show ver
verbose  version  
(gdb) show version 
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb)
Comment 1 Sami Wagiaalla 2010-04-29 15:14:08 UTC
This might be the same issue as:
http://sourceware.org/bugzilla/show_bug.cgi?id=11408

could you try with this patch:
http://sourceware.org/bugzilla/attachment.cgi?id=4674&action=view
Comment 2 Jens Elmenthaler 2010-04-30 13:50:57 UTC
(In reply to comment #1)
> This might be the same issue as:
> http://sourceware.org/bugzilla/show_bug.cgi?id=11408
> could you try with this patch:
> http://sourceware.org/bugzilla/attachment.cgi?id=4674&action=view
bug11408 should already be fixed if I check out the latest gdb sources from 
7.1 branch, right (done today)? At least I found a ChangeLog saying this.
The sluggishness while stepping seems to be gone, but inserting a break point 
is still damn slow.
Comment 3 Sami Wagiaalla 2010-04-30 14:27:32 UTC
Okay looks like this is a different bug then.
Would you be able to make a small testcase to reproduce this ?
If not, could you get a stack trace of gdb while it is hung
Comment 4 Jens Elmenthaler 2010-04-30 14:38:24 UTC
Created attachment 4757 [details]
Stack trace while gdb is busy inserting breakpoint

Here is the stack trace. I will try to create an example.
Comment 5 jlquinn 2010-04-30 15:46:54 UTC
(In reply to comment #1)
> This might be the same issue as:
> http://sourceware.org/bugzilla/show_bug.cgi?id=11408
> 
> could you try with this patch:
> http://sourceware.org/bugzilla/attachment.cgi?id=4674&action=view

The patch appears to fix my problem.  Thanks!
Comment 6 Tom Tromey 2010-04-30 18:04:28 UTC
(In reply to comment #4)
> Created an attachment (id=4757)
> Stack trace while gdb is busy inserting breakpoint
> 
> Here is the stack trace. I will try to create an example.

This looks like:

http://sourceware.org/ml/gdb-patches/2010-04/msg00466.html

It would be interesting to know if that patch helps.
Comment 7 Jens Elmenthaler 2010-04-30 18:26:06 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > Created an attachment (id=4757)
> > Stack trace while gdb is busy inserting breakpoint
> > 
> > Here is the stack trace. I will try to create an example.
> This looks like:
> http://sourceware.org/ml/gdb-patches/2010-04/msg00466.html
> It would be interesting to know if that patch helps.
Yes, it helps. I had about 4000 partial symbol tables, and the line 
breakpoints used absolute paths.
Comment 8 Sami Wagiaalla 2010-05-04 14:24:01 UTC
I am unassigning this bug since the lookup problem is fixed.
It can be closed when the stat issued is fixed.
Comment 9 Tom Tromey 2022-10-21 17:03:19 UTC
I think this was fixed ages ago.