This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: c++/1417: crash when printing variables
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 10 Oct 2003 17:38:01 -0000
- Subject: Re: c++/1417: crash when printing variables
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR c++/1417; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: birgir.sigurjonsson@roxar.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/1417: crash when printing variables
Date: Fri, 10 Oct 2003 13:34:17 -0400
On Fri, Oct 10, 2003 at 11:38:05AM -0000, birgir.sigurjonsson@roxar.com wrote:
>
> >Number: 1417
> >Category: c++
> >Synopsis: crash when printing variables
> >Confidential: no
> >Severity: critical
> >Priority: high
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Fri Oct 10 11:48:01 UTC 2003
> >Closed-Date:
> >Last-Modified:
> >Originator: birgir.sigurjonsson@roxar.com
> >Release: GNU gdb 6.0 configured as "i686-pc-linux-gnu".
> >Organization:
> >Environment:
> Linux asterix 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
> Thread model: posix
> gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
> GNU gdb 6.0
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
> >Description:
> (gdb) list
> 26
> 27 MyBiggi::Ptr
> 28 MyBiggi::Create() {
> 29 return new MyBiggi();
> 30 }
> 31
> 32
> 33 int
> 34 main(int argc, char **argv) {
> 35 MyBiggi::Ptr bs = MyBiggi::Create();
>
> If I do print bs I get the following
> $1 = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> = {<Ptr> =
> until
> ---Type <return> to continue, or q <return> to quit---
>
> At last in the end
>
> Segmentation fault (core dumped)
This is a nasty little namespace/nesting bug. The Ptr class inherits
from another class whose basename is also Ptr. GDB doesn't know that
they're different and sees a loop.
This will eventually start working. In the meantime, it would be nice
if GDB didn't crash. I'll post a patch for that.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer