From: Fabian Cenedese <Cenedese@indel.ch>
To: <gdb@sources.redhat.com>
Subject: RE: gdb 6.1.1 (PPC) crash (long) AND gdb crash in cp_print_class_method
Date: Thu, 02 Sep 2004 12:59:00 -0000 [thread overview]
Message-ID: <5.2.0.9.1.20040902143134.01d44e20@NT_SERVER> (raw)
In-Reply-To: <NUTMEGwwW2W9baQTlhr000010cb@NUTMEG.CAM.ARTIMI.COM>
> Gentlemen, you seem very likely to have stumbled across the same problem.
>There is clearly something very very wrong in the C++ demangling and pretty
>printing. Last time I checked the bfd demangler had no regressions in it,
>so I think it's fairly likely that something is stomping over the demangled
>string after it's been returned to cp_print_class_method by bfd, and this is
>causing a later failure when the damaged data is passed to strcmp or
>is_constructor_name. It might be possible to debug this by a clever
>combination of scripting and setting hardware memory watchpoints to try and
>catch anything changing the relevant memory area apart from the
>demangler....
Just out of curiosity I also tried gdb-5.3 on cygwin. This works without crashing:
GNU gdb 5.3
(gdb) ptype CMainTask
type = class CMainTask : public CINOSTask {
public:
CMainTask & operator=(CMainTask const &);
CMainTask(CMainTask const &);
virtual ~CMainTask(void);
CMainTask(char *, unsigned long, unsigned long);
virtual void Action(void);
}
So it looks like the error was introduced in stepping from 5.3 to 6.0.
> Fabian, about a point from your first email: the addresses in .stackdump
>files are always raw, even from a debug build of the code; the
>stackdump-writing code is quite simple and doesn't look them up for you.
>You can use 'addr2line' from binutils to decode the "Function" addresses it
>shows; check the man/info page for more.
Thanks for the hint, I've already wondered what this tool is for :) In this case
it was not necessary as I managed to get a backtrace with running gdb
in gdb. A short test showed that the addresses are the same as in this
backtrace.
(gdb) bt
#0 gnuv2_is_constructor_name (name=0x0)
at ../../gdb-6.1.1/gdb/gnu-v2-abi.c:56
#1 0x00488bf8 in is_constructor_name (name=0x0)
at ../../gdb-6.1.1/gdb/cp-abi.c:44
#2 0x004dda6c in c_type_print_base (type=0xa2b4b68, stream=0xa084088,
show=1, level=0) at ../../gdb-6.1.1/gdb/c-typeprint.c:952
#3 0x004dc816 in c_print_type (type=0xa2b4b68, varstring=0x716c4d "",
stream=0xa084088, show=1, level=0) at ../../gdb-6.1.1/gdb/c-typeprint.c:75
#4 0x004945af in type_print (type=0xa2b4b68, varstring=0x716c4d "",
stream=0xa084088, show=1) at ../../gdb-6.1.1/gdb/typeprint.c:109
#5 0x0049482a in ptype_command (typename=0xa05180e "CMainTask", from_tty=1)
at ../../gdb-6.1.1/gdb/typeprint.c:223
etc
But if memory corruption is the problem this is useless anyway. On the other hand
valgrind showed no error while loading the symbol file, only upon this exact command:
(gdb) file ~/tmp/dbg.x
Reading symbols from ~/tmp/dbg.x...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) ptype CMainTask
type = class CMainTask : public CINOSTask {
public:
CMainTask & operator=(CMainTask const &);
virtual ~CMainTask(void);
==26478== Invalid read of size 1
==26478== at 0x8171B62: gnuv2_is_constructor_name (gnu-v2-abi.c:56)
==26478== by 0x8085637: is_constructor_name (cp-abi.c:44)
==26478== by 0x8160D5B: c_type_print_base (c-typeprint.c:952)
==26478== by 0x815FAE5: c_print_type (c-typeprint.c:75)
==26478== by 0x815F57E: type_print (typeprint.c:109)
==26478== by 0x815F7F9: ptype_command (typeprint.c:223)
==26478== by 0x80ADF78: do_cfunc (cli-decode.c:57)
==26478== by 0x80AFE6B: cmd_func (cli-decode.c:1541)
==26478== by 0x807F7E5: execute_command (top.c:743)
==26478== by 0x810BC3E: command_handler (event-top.c:500)
==26478== by 0x810C084: command_line_handler (event-top.c:793)
==26478== by 0x81E0EA4: rl_callback_read_char (callback.c:123)
==26478== by 0x810B58A: rl_callback_read_char_wrapper (event-top.c:166)
==26478== by 0x810BB39: stdin_event_handler (event-top.c:416)
==26478== by 0x810AE1D: handle_file_event (event-loop.c:721)
==26478== by 0x810A8D8: process_event (event-loop.c:334)
==26478== by 0x810A937: gdb_do_one_event (event-loop.c:371)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x80BC733: tui_command_loop (tui-interp.c:150)
==26478== by 0x8108648: current_interp_command_loop (interps.c:277)
==26478== by 0x807A91A: captured_command_loop (main.c:97)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x807B2E3: captured_main (main.c:805)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x807B762: gdb_main (main.c:814)
==26478== by 0x807A8FD: main (gdb.c:35)
==26478== Address 0x0 is not stack'd, malloc'd or free'd
==26478==
==26478== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==26478== Access not within mapped region at address 0x0
==26478== at 0x8171B62: gnuv2_is_constructor_name (gnu-v2-abi.c:56)
==26478== by 0x8085637: is_constructor_name (cp-abi.c:44)
==26478== by 0x8160D5B: c_type_print_base (c-typeprint.c:952)
==26478== by 0x815FAE5: c_print_type (c-typeprint.c:75)
==26478== by 0x815F57E: type_print (typeprint.c:109)
==26478== by 0x815F7F9: ptype_command (typeprint.c:223)
==26478== by 0x80ADF78: do_cfunc (cli-decode.c:57)
==26478== by 0x80AFE6B: cmd_func (cli-decode.c:1541)
==26478== by 0x807F7E5: execute_command (top.c:743)
==26478== by 0x810BC3E: command_handler (event-top.c:500)
==26478== by 0x810C084: command_line_handler (event-top.c:793)
==26478== by 0x81E0EA4: rl_callback_read_char (callback.c:123)
==26478== by 0x810B58A: rl_callback_read_char_wrapper (event-top.c:166)
==26478== by 0x810BB39: stdin_event_handler (event-top.c:416)
==26478== by 0x810AE1D: handle_file_event (event-loop.c:721)
==26478== by 0x810A8D8: process_event (event-loop.c:334)
==26478== by 0x810A937: gdb_do_one_event (event-loop.c:371)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x80BC733: tui_command_loop (tui-interp.c:150)
==26478== by 0x8108648: current_interp_command_loop (interps.c:277)
==26478== by 0x807A91A: captured_command_loop (main.c:97)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x807B2E3: captured_main (main.c:805)
==26478== by 0x807F410: do_catch_errors (top.c:523)
==26478== by 0x807F28F: catcher (top.c:430)
==26478== by 0x807F46F: catch_errors (top.c:535)
==26478== by 0x807B762: gdb_main (main.c:814)
==26478== by 0x807A8FD: main (gdb.c:35)
==26478==
==26478== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 24 from 2)
==26478== malloc/free: in use at exit: 742482 bytes in 4289 blocks.
==26478== malloc/free: 10558 allocs, 6269 frees, 1079443 bytes allocated.
==26478== For a detailed leak analysis, rerun with: --leak-check=yes
==26478== For counts of detected errors, rerun with: -v
Segmentation fault
Thanks
bye Fabi
next prev parent reply other threads:[~2004-09-02 12:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-01 9:01 gdb 6.1.1 (PPC) crash (long) Fabian Cenedese
2004-09-01 9:18 ` Fabian Cenedese
2004-09-02 12:20 ` gdb 6.1.1 (PPC) crash (long) AND gdb crash in cp_print_class_method Dave Korn
2004-09-02 12:59 ` Fabian Cenedese [this message]
2004-09-02 14:07 ` Dave Korn
2004-09-02 22:48 ` Craig Jeffree
2004-09-07 14:41 ` Dave Korn
2004-09-02 11:59 ` gdb 6.1.1 (PPC) crash (long) Fabian Cenedese
2004-09-07 14:50 ` Daniel Jacobowitz
[not found] ` <5.2.0.9.1.20040907170934.01d457f8@NT_SERVER>
2004-09-07 17:02 ` Daniel Jacobowitz
2004-09-29 5:27 ` Craig Jeffree
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.2.0.9.1.20040902143134.01d44e20@NT_SERVER \
--to=cenedese@indel.ch \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox