Bug 8701 - Infinite recursion causing gdb seg fault
Summary: Infinite recursion causing gdb seg fault
Status: RESOLVED WORKSFORME
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-24 14:38 UTC by elliott_c
Modified: 2010-03-12 23:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
infinite_recursion.tar.gz (3.23 KB, application/octet-stream)
, elliott_c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description elliott_c 2004-03-24 14:38:01 UTC
[Converted from Gnats 1596]

When using gdb with ddd to debug a C++ program built with TAO (The ACE ORB) v1.3a p4 (available at http://downloads.ociweb.com/TAO-1.3a/ACE+TAO-1.3a_with_latest_patches.tar.gz) gdb gets a segmentation fault due to an infinite recursion.

Release:
GNU gdb 6.0

Environment:
Linux Redhat 7.3 with gcc 3.2.1

How-To-Repeat:
This may be difficult to repeat as I do not have a simple test case, but here are the steps:

1) Download TAO 1.3a p4 at the location given in the description.
2) Build TAO.
3) Build the attached source
4) Run badrtcorba2 (and it will core dump)
5) Load the core using ddd as the debugger interface
6) Go up 3 frames and hold the mouse over the this pointer

I'm sorry I don't have a simple test case.
Comment 1 elliott_c 2004-03-24 14:38:01 UTC
Fix:
The attached patch file for valops.c detects the infinite recursion and exits the function with a value of zero.  I have tested it and it works great with the patch.
Comment 2 Keith Seitz 2010-03-12 23:54:29 UTC
Believe it or not, the TAO/ACE tarball is still available, and it does indeed
build on Fedora 11. Unfortunately, when I run the sample application, it does
not crash/produce a core file.

However, I played with the resultant executable, stepping into it for quite some
time and printing lots of variables (and info func), and I was unable to get GDB
6.8 to misbehave.

Looking at the proposed patch, it seems to me that the reported problem could
very well have been a compiler error (not saying it is, just that it could be).
I used the Fedora 11 GCC (4.4.1 vintage) during my testing.

I can only assume that whatever was wrong, it was fixed a long time ago.