Not sure if this is already reported/fixed or if it's a bug or a
"feature". I have this program:
class Website1231231234
{
Website1231231234()
{
};
~Website1231231234();
};
Website1231231234::~Website1231231234()
{
int a = 42; // life, the universe
}
int main()
{
Website1231231234* web = new Website1231231234();
}
I compile it with this:
[EMAIL PROTECTED]:> g++ -g -ggdb z.cpp
When I set a breakpoint on the destructor without including closing
parens, I get a coredump from gdb:
[EMAIL PROTECTED]:> gdb a.out
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/obsolete/linuxthreads/libthread_db.so.1".
(gdb) break Website1231231234::~Website1231231234
*** glibc detected *** gdb: free(): invalid next size (fast): 0x0913b1d8 ***
======= Backtrace: =========
/lib/obsolete/linuxthreads/i686/libc.so.6[0x1bc42b]
/lib/obsolete/linuxthreads/i686/libc.so.6(__libc_free+0x6b)[0x1bc995]
gdb[0x80fdb7a]
gdb[0x80fdcb3]
gdb[0x80fef96]
gdb[0x80ff3f4]
gdb(decode_line_1+0xa0c)[0x80ffe9f]
gdb[0x80d43ad]
gdb[0x80d442a]
gdb[0x8084934]
gdb(catch_exceptions_with_msg+0x37)[0x8084a23]
gdb[0x80d4756]
gdb(execute_command+0x30b)[0x8084ea2]
gdb[0x8112f44]
gdb[0x81133b9]
gdb(rl_callback_read_char+0x54)[0x81ee75d]
gdb[0x811286b]
gdb[0x81120fe]
gdb[0x8111be2]
gdb(gdb_do_one_event+0x1a9)[0x8112447]
gdb[0x8084934]
gdb(catch_errors+0x48)[0x8084aed]
gdb[0x80c29d9]
gdb(current_interp_command_loop+0x2f)[0x810fbe3]
gdb[0x807b5fb]
gdb[0x8084934]
gdb(catch_errors+0x48)[0x8084aed]
gdb[0x807bd57]
gdb[0x8084934]
gdb(catch_errors+0x48)[0x8084aed]
gdb(gdb_main+0x31)[0x807b660]
gdb(main+0x31)[0x807b5e5]
/lib/obsolete/linuxthreads/i686/libc.so.6(__libc_start_main+0xab)[0x16d25f]
gdb[0x807b531]
======= Memory map: ========
00111000-0014f000 r-xp 00000000 fd:00 91397629 /usr/lib/libncurses.so.5.4
0014f000-00158000 rw-p 0003d000 fd:00 91397629 /usr/lib/libncurses.so.5.4
00158000-0027b000 r-xp 00000000 fd:00 28344392
/lib/obsolete/linuxthreads/i686/libc-2.3.5.so
0027b000-0027d000 r--p 00123000 fd:00 28344392
/lib/obsolete/linuxthreads/i686/libc-2.3.5.so
0027d000-0027f000 rw-p 00125000 fd:00 28344392
/lib/obsolete/linuxthreads/i686/libc-2.3.5.so
0027f000-00281000 rw-p 0027f000 00:00 0
00750000-00754000 r-xp 00000000 fd:00 28344411
/lib/obsolete/linuxthreads/libthread_db-1.0.so
00754000-00755000 r--p 00003000 fd:00 28344411
/lib/obsolete/linuxthreads/libthread_db-1.0.so
00755000-00756000 rw-p 00004000 fd:00 28344411
/lib/obsolete/linuxthreads/libthread_db-1.0.so
009cf000-009f2000 r-xp 00000000 fd:00 28344397
/lib/obsolete/linuxthreads/i686/libm-2.3.5.so
009f2000-009f3000 r--p 00022000 fd:00 28344397
/lib/obsolete/linuxthreads/i686/libm-2.3.5.so
009f3000-009f4000 rw-p 00023000 fd:00 28344397
/lib/obsolete/linuxthreads/i686/libm-2.3.5.so
00b48000-00b62000 r-xp 00000000 fd:00 28344437 /lib/ld-2.3.5.so
00b62000-00b63000 r--p 00019000 fd:00 28344437 /lib/ld-2.3.5.so
00b63000-00b64000 rw-p 0001a000 fd:00 28344437 /lib/ld-2.3.5.so
00c91000-00c93000 r-xp 00000000 fd:00 28345392 /lib/libdl-2.3.5.so
00c93000-00c94000 r--p 00001000 fd:00 28345392 /lib/libdl-2.3.5.so
00c94000-00c95000 rw-p 00002000 fd:00 28345392 /lib/libdl-2.3.5.so
00d2b000-00d34000 r-xp 00000000 fd:00 28345396
/lib/libgcc_s-4.0.2-20051126.so.1
00d34000-00d35000 rw-p 00009000 fd:00 28345396
/lib/libgcc_s-4.0.2-20051126.so.1
00d4c000-00d4d000 r-xp 00d4c000 00:00 0
08047000-082ae000 r-xp 00000000 fd:00 91394291 /usr/bin/gdb
082ae000-082bc000 rw-p 00266000 fd:00 91394291 /usr/bin/gdb
082bc000-082d6000 rw-p 082bc000 00:00 0
090e1000-09144000 rw-p 090e1000 00:00 0 [heap]
b7c00000-b7c21000 rw-p b7c00000 00:00 0
b7c21000-b7d00000 ---p b7c21000 00:00 0
b7de7000-b7de9000 rw-p b7de7000 00:00 0
b7de9000-b7def000 r--s 00000000 fd:00 91455791
/usr/lib/gconv/gconv-modules.cache
b7def000-b7fef000 r--p 00000000 fd:00 91397883
/usr/lib/locale/locale-archive
b7fef000-b7ff0000 rw-p b7fef000 00:00 0
b7ff5000-b7ff6000 rw-p b7ff5000 00:00 0
bf9e1000-bf9f6000 rw-p bf9e1000 00:00 0 [stack]
Abort (core dumped)
Architecture is RH4 / i686:
Linux blah.blah.com 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT
2005 i686 i686 i386 GNU/Linux
I do not get a coredump if I change the name by 1 byte e.g. class
Website12312312345, it produces this:
(gdb) break Website12312312345::~Website12312312345
[0] cancel
[1] all
[2] Website12312312345::~Website12312312345() at z.cpp:12
[3] Website12312312345::~Website12312312345$base() at z.cpp:12
>
And if I include the closing () all is fine -
(gdb) break Website1231231234::~Website1231231234()
#0 0x00e47311 in kill () from /lib/obsolete/linuxthreads/i686/libc.so.6
#1 0x00e46f81 in raise () from /lib/obsolete/linuxthreads/i686/libc.so.6
#2 0x00e484f3 in abort () from /lib/obsolete/linuxthreads/i686/libc.so.6
#3 0x00e7be4e in __libc_message () from
/lib/obsolete/linuxthreads/i686/libc.so.6
#4 0x00e8275b in _int_free () from
/lib/obsolete/linuxthreads/i686/libc.so.6
#5 0x00e82cc5 in free () from /lib/obsolete/linuxthreads/i686/libc.so.6
#6 0x080fd90a in _initialize_symmisc ()
#7 0x080fda43 in _initialize_symmisc ()
#8 0x080fed26 in _initialize_symmisc ()
#9 0x080ff194 in _initialize_symmisc ()
#10 0x080ffc3f in decode_line_1 ()
#11 0x080d416d in bpstat_print ()
#12 0x080d41ea in bpstat_print ()
#13 0x08084834 in throw_exception ()
#14 0x08084923 in catch_exceptions_with_msg ()
#15 0x080d4516 in resolve_sal_pc_list ()
#16 0x08084da2 in execute_command ()
#17 0x08112c94 in async_disable_stdin ()
#18 0x08113109 in async_disable_stdin ()
#19 0x081ede7d in rl_callback_read_char ()
#20 0x081125bb in delete_timer ()
#21 0x08111e6e in delete_file_handler ()
#22 0x08111952 in standard_macro_lookup ()
#23 0x08112197 in gdb_do_one_event ()
#24 0x08084834 in throw_exception ()
#25 0x080849ed in catch_errors ()
#26 0x080c2799 in _initialize_tui_hooks ()
#27 0x0810f953 in current_interp_command_loop ()
#28 0x0807b4fb in main ()
(gdb)
_______________________________________________
Bug-gdb mailing list
Bug-gdb@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb