This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/13669] Infinite recursion in cp_print_value_fields
- From: "ryan at thoryk dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 16 Feb 2016 03:26:59 +0000
- Subject: [Bug gdb/13669] Infinite recursion in cp_print_value_fields
- Auto-submitted: auto-generated
- References: <bug-13669-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=13669
Ryan Thoryk <ryan at thoryk dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ryan at thoryk dot com
--- Comment #14 from Ryan Thoryk <ryan at thoryk dot com> ---
Created attachment 8990
--> https://sourceware.org/bugzilla/attachment.cgi?id=8990&action=edit
Simple recursion limit fix
I've been experiencing this issue very frequently when developing an app that
uses the Ogre 3D rendering engine, on Linux when using the Eclipse C++ IDE.
The test file crashes for me too. I've done tracing through the GDB code, and
added a recursion limit to the cp_print_value_fields function, which at least
alleviates the issue and prevents crashing. In my situation, I found that the
issue was that certain data structures are being interpreted as the wrong type,
mainly a class member's type being interpreted as the class itself. I don't
know if this is GDB's fault, or if there's a problem with the symbols.
For the question posted on here, GDB segfaults because it hits a stack
overflow. In my case, it recursed over 1000 times and eventually hit the stack
size limit, and crashed. If it simply hangs without segfaulting, you can kill
it with SIGKILL (kill -9), since the default SIGTERM doesn't help.
I've attached the very simple patch that prevents recursion over 100 levels,
and was made for GDB 7.10-1 (the current Debian Testing version).
--
You are receiving this mail because:
You are on the CC list for the bug.