public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields
@ 2012-02-07 12:11 orgads at gmail dot com
  2012-02-07 12:13 ` [Bug gdb/13669] " orgads at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-07 12:11 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

             Bug #: 13669
           Summary: Infinite recursion in cp_print_value_fields
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: orgads@gmail.com
    Classification: Unclassified


Created attachment 6199
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6199
Stack trace

cp_print_value_fields calls cp_print_static_field (cp-valprint.c:357), which in
turn calls cp_print_value_fields (cp-valprint.c:670).

I couldn't find a MWE, but this causes under some circumstances infinite
recursion...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
@ 2012-02-07 12:13 ` orgads at gmail dot com
  2012-02-07 12:55 ` andre.poenitz at nokia dot com
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-07 12:13 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

Orgad Shaneh <orgads at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |orgads at gmail dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
  2012-02-07 12:13 ` [Bug gdb/13669] " orgads at gmail dot com
@ 2012-02-07 12:55 ` andre.poenitz at nokia dot com
  2012-02-07 16:54 ` tromey at redhat dot com
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: andre.poenitz at nokia dot com @ 2012-02-07 12:55 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

Andre Poenitz <andre.poenitz at nokia dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andre.poenitz at nokia dot
                   |                            |com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
  2012-02-07 12:13 ` [Bug gdb/13669] " orgads at gmail dot com
  2012-02-07 12:55 ` andre.poenitz at nokia dot com
@ 2012-02-07 16:54 ` tromey at redhat dot com
  2012-02-07 20:43 ` orgads at gmail dot com
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at redhat dot com @ 2012-02-07 16:54 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-02-07 16:53:32 UTC ---
Without more information we can't really do anything about this.
There is some code in cp_print_static_field that is supposed to
prevent infinite loops here.  So, it would be interesting to see
why that isn't working.
Could you get a gdb backtrace from this?  I mean one with argument
values and local variables and the like?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (2 preceding siblings ...)
  2012-02-07 16:54 ` tromey at redhat dot com
@ 2012-02-07 20:43 ` orgads at gmail dot com
  2012-02-07 21:24 ` tromey at redhat dot com
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-07 20:43 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #2 from Orgad Shaneh <orgads at gmail dot com> 2012-02-07 20:42:10 UTC ---
Created attachment 6200
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6200
Local variables (some of them expanded)

Does this help?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (3 preceding siblings ...)
  2012-02-07 20:43 ` orgads at gmail dot com
@ 2012-02-07 21:24 ` tromey at redhat dot com
  2012-02-08 10:29 ` orgads at gmail dot com
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at redhat dot com @ 2012-02-07 21:24 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2012-02-07 21:23:07 UTC ---
(In reply to comment #2)
> Created attachment 6200 [details]
> Local variables (some of them expanded)
> 
> Does this help?

Not really.  It has a lot of extraneous information but also is missing
some important things.

In particular, it woudl be good to see more than two frames.
In cp_print_static_field, "addr" is optimized out; but this is
one of the important values to see.
In cp_print_value_fields, there is a union in the struct value
that is printed as just {...} -- but we want to see the address that
is stored there.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (4 preceding siblings ...)
  2012-02-07 21:24 ` tromey at redhat dot com
@ 2012-02-08 10:29 ` orgads at gmail dot com
  2012-02-08 11:14 ` orgads at gmail dot com
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-08 10:29 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #4 from Orgad Shaneh <orgads at gmail dot com> 2012-02-08 10:28:30 UTC ---
Created attachment 6203
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6203
Locals - more expansions

Is this better?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (5 preceding siblings ...)
  2012-02-08 10:29 ` orgads at gmail dot com
@ 2012-02-08 11:14 ` orgads at gmail dot com
  2012-02-08 18:02 ` tromey at redhat dot com
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-08 11:14 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #5 from Orgad Shaneh <orgads at gmail dot com> 2012-02-08 11:13:25 UTC ---
Created attachment 6204
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6204
Full backtrace

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (6 preceding siblings ...)
  2012-02-08 11:14 ` orgads at gmail dot com
@ 2012-02-08 18:02 ` tromey at redhat dot com
  2012-02-09  8:03 ` orgads at gmail dot com
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at redhat dot com @ 2012-02-08 18:02 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #6 from Tom Tromey <tromey at redhat dot com> 2012-02-08 18:01:56 UTC ---
Thanks.  The full backtrace was helpful but not quite helpful enough :(

I guess I would step through the logic in cp_print_value_fields,
specifically the code related to "dont_print_statmem".  It is hard to
say for sure, but it seems that maybe this code could be resetting
the obstack that is used to record which objects have already been
printed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (7 preceding siblings ...)
  2012-02-08 18:02 ` tromey at redhat dot com
@ 2012-02-09  8:03 ` orgads at gmail dot com
  2012-02-09  8:07 ` orgads at gmail dot com
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-09  8:03 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #7 from Orgad Shaneh <orgads at gmail dot com> 2012-02-09 08:02:53 UTC ---
One more thing - This only happens when I *step out* of a specific static
inline function (NTBoardInterface::Instance()).

If I step normally, it works fine.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (8 preceding siblings ...)
  2012-02-09  8:03 ` orgads at gmail dot com
@ 2012-02-09  8:07 ` orgads at gmail dot com
  2014-09-12 23:07 ` sergiodj at redhat dot com
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: orgads at gmail dot com @ 2012-02-09  8:07 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #8 from Orgad Shaneh <orgads at gmail dot com> 2012-02-09 08:06:25 UTC ---
Just tested again, it reproduces even if this function is not inline.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (9 preceding siblings ...)
  2012-02-09  8:07 ` orgads at gmail dot com
@ 2014-09-12 23:07 ` sergiodj at redhat dot com
  2015-03-05  2:54 ` daniel.lopez999 at gmail dot com
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: sergiodj at redhat dot com @ 2014-09-12 23:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13669

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sergiodj at redhat dot com

--- Comment #9 from Sergio Durigan Junior <sergiodj at redhat dot com> ---
Hi, is this problem still happening?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (10 preceding siblings ...)
  2014-09-12 23:07 ` sergiodj at redhat dot com
@ 2015-03-05  2:54 ` daniel.lopez999 at gmail dot com
  2015-03-05  3:06 ` daniel.lopez999 at gmail dot com
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: daniel.lopez999 at gmail dot com @ 2015-03-05  2:54 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13669

Daniel Lopez <daniel.lopez999 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.lopez999 at gmail dot com

--- Comment #10 from Daniel Lopez <daniel.lopez999 at gmail dot com> ---
Created attachment 8166
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8166&action=edit
Daniel - test program

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (11 preceding siblings ...)
  2015-03-05  2:54 ` daniel.lopez999 at gmail dot com
@ 2015-03-05  3:06 ` daniel.lopez999 at gmail dot com
  2015-03-05  3:11 ` daniel.lopez999 at gmail dot com
  2015-03-05 20:43 ` daniel.lopez999 at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: daniel.lopez999 at gmail dot com @ 2015-03-05  3:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #11 from Daniel Lopez <daniel.lopez999 at gmail dot com> ---
Created attachment 8167
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8167&action=edit
Daniel - debug session including backtrace

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (12 preceding siblings ...)
  2015-03-05  3:06 ` daniel.lopez999 at gmail dot com
@ 2015-03-05  3:11 ` daniel.lopez999 at gmail dot com
  2015-03-05 20:43 ` daniel.lopez999 at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: daniel.lopez999 at gmail dot com @ 2015-03-05  3:11 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #12 from Daniel Lopez <daniel.lopez999 at gmail dot com> ---
I've got a reproducible example of this.

Compile attached "Daniel - test program" with
  g++ -std=c++0x -g main.cpp -omain

Start gdb
  gdb main

Put a breakpoint on line 53
  return ref;  // <-- stop here, then run 'finish'

Then run 'finish' as the comment says. After a second or so gdb segfaults.

An example of my stack trace is in "Daniel - debug session including
backtrace". It's stuck in the same two functions that Orgad mentioned.

I'm working with gdb 7.9 on Arch Linux, and 7.7 in an Ubuntu VM.

(Just as an aside, would anyone have an idea why in the Ubuntu VM this simply
causes gdb to exit back to the shell with "Segmentation fault (core dumped)"
and I can try again and so on, whereas on the Arch machine it hangs leaving the
gdb process in uninterruptible sleep state - preventing new gdb sessions from
running - and I can't figure out how to get rid of it except restarting the
machine?)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug gdb/13669] Infinite recursion in cp_print_value_fields
  2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
                   ` (13 preceding siblings ...)
  2015-03-05  3:11 ` daniel.lopez999 at gmail dot com
@ 2015-03-05 20:43 ` daniel.lopez999 at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: daniel.lopez999 at gmail dot com @ 2015-03-05 20:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13669

--- Comment #13 from Daniel Lopez <daniel.lopez999 at gmail dot com> ---
Whoops, you don't necessarily need the "-std=c++0x" when compiling, by the way,
that's a hangover from an earlier, less stripped-down version of the test
program.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-03-05  3:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 12:11 [Bug gdb/13669] New: Infinite recursion in cp_print_value_fields orgads at gmail dot com
2012-02-07 12:13 ` [Bug gdb/13669] " orgads at gmail dot com
2012-02-07 12:55 ` andre.poenitz at nokia dot com
2012-02-07 16:54 ` tromey at redhat dot com
2012-02-07 20:43 ` orgads at gmail dot com
2012-02-07 21:24 ` tromey at redhat dot com
2012-02-08 10:29 ` orgads at gmail dot com
2012-02-08 11:14 ` orgads at gmail dot com
2012-02-08 18:02 ` tromey at redhat dot com
2012-02-09  8:03 ` orgads at gmail dot com
2012-02-09  8:07 ` orgads at gmail dot com
2014-09-12 23:07 ` sergiodj at redhat dot com
2015-03-05  2:54 ` daniel.lopez999 at gmail dot com
2015-03-05  3:06 ` daniel.lopez999 at gmail dot com
2015-03-05  3:11 ` daniel.lopez999 at gmail dot com
2015-03-05 20:43 ` daniel.lopez999 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).