Bug 110495 - Object and static class member causes infinite recursion.
Object and static class member causes infinite recursion.
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
1
All Linux
medium Severity high
: ---
: ---
Assigned To: Elena Zannoni
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-20 04:02 EST by Ralph Loader
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-29 03:08:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralph Loader 2003-11-20 04:02:58 EST
gdb can go into an infinite recursion printing static members of a C++
object.

With this source file:
------------------------------------------
struct derived;

struct base
{
  static derived bar;
};

struct derived : base
{
};

derived base::bar;

base foo;

int main()
{
  return 0;
}
---------------------------------
break main, run, and then print foo gives and output ending:

 = {<base> = {static bar = {<base> = {static bar = {<base> = {static
bar = {<base> = {static bar = {<base> = {static bar = {<base> =
{static bar = {<base> = {static bar = {<base> = {static bar = {<base>
= {static bar = {<base> = {static bar = {<base> = {static bar =
{<base> = {static bar = {<base> = {static bar = {<base> = {static bar
= {<base> = {static bar = {<base> = {static bar = {<base> = {static
bar = {<base> = {static bar = {<base> = {static bar = {<base> =
{static bar = {<base> = {static bar = {<base> = {static bar = {<base>
= {static bar = {<base> = {static bar = {<base> = {static bar =
{<base> = {static bar = {<base> = {static bar = {<base> = {static bar
= {<base> = {static bar = {<base> = {static bar = {<base> = {static
bar = {<base> = {static bar = {<base> = {static bar = {<base> =
{static bar = {<base> = {static bar = {<base> = {static bar = {<base>
= {static bar = {<base> = {static bar = {<base> = {static bar =
{<base> = {static bar = {<base> = {static bar = {<base> = {static bar
= {<base> = {static bar = {<base> = {static bar = {<base> = {static
bar = {<base> = {static bar = {<base> = {static bar = {<base> =
{static bar = {<base> = {static bar = {<base> = {static bar = {<base>
= {static bar = {<base> = {static bar = {<base> = {static bar =
{<base> = {static bar = {<base> = {static bar = {<base> = {static bar
= {<base> = {static bar = {<base> = {static bar = {<base> = {static
bar = {<base> = {static bar = {<base> = {static barSegmentation fault


I don't actually understand why gdb always attempts to print static
class members while printing an object.  I've never found it useful
and it clutters the display.
Comment 1 Elena Zannoni 2004-01-13 15:42:06 EST
have you tried setting the printing of static members to OFF?

(gdb) set print static-members off

does that get you any further?

Comment 2 Ralph Loader 2004-01-14 00:07:49 EST
Yes, the bug only happens if static-members is not turned off.
Comment 3 Ralph Loader 2005-08-29 03:08:16 EDT
This bug appears to have been fixed upstream

Note You need to log in before you can comment on or make changes to this bug.