This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/1400: Seg fault when dereferencing 'this' pointer


>Number:         1400
>Category:       c++
>Synopsis:       Seg fault when dereferencing 'this' pointer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 27 18:38:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     rsteinke@w-link.net
>Release:        5.3-debian
>Organization:
>Environment:
Debian 'testing', as of 9/27/03
>Description:
When trying to debug a seg fault in an application, gdb itself
segfaults when I try to dereference the 'this' pointer to print the contents of an object. Since the application that is running under gdb has just seg faulted, the 'this' pointer may or may not point to valid memory.

Unfortunately, the application that's triggering this is rather complex, and I have yet to come up with a simple test case. Here's a backtrace from when I run gdb under gdb, with the application backtrace at the top for context:

#0  Eris::Room::recvSoundTalk(Atlas::Objects::Operation::Talk const&) (this=0x83497d0, 
    tk=@0x8361cd0) at Element.h:336
#1  0x40089b7e in SigC::ObjectSlot1_<void, Atlas::Objects::Operation::Talk const&, Eris::Room>::proxy(Atlas::Objects::Operation::Talk const&, void*) (p1=@0x8361cd0, s=0x82e9738)
    at object_slot.h:100
#2  0x0812078e in SigC::Signal1<void, Eris::PollData&, SigC::Marshal<void> >::emit_(Eris::PollData&, void*) (p1=@0x8361cd0, data=0x19005c) at signal.h:693
#3  0x401e1cb4 in wftk::Poll::emitPoll(wftk::PollData*) (this=0x8361cd4, data=0x19005c)
    at poll.cpp:163
#4  0x401e22fb in for_each<wftk::PollData*> (this=0x402326e0, func=
      {__pfn = 0x8361cd4, __delta = 0}, d=0xbffff520) at safe_set.h:87
#5  0x401e1c0c in wftk::Poll::poll(unsigned) (wait=1638492) at poll.cpp:151
#6  0x401eac42 in wftk::Application::poll(unsigned) (this=0xbffff910, wait=1638492)
    at application.cpp:324
#7  0x401eb2ac in wftk::Application::exec() (this=0xbffff910) at application.cpp:434
#8  0x0805b4ef in main (argc=1, argv=0xbffffad4) at uclient.cc:465
(gdb) print this
$1 = (Room * const) 0x83497d0
(gdb) print *this
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0813ad8c in gnuv3_baseclass_offset ()
(gdb) bt
#0  0x0813ad8c in gnuv3_baseclass_offset ()
#1  0x080fae3e in baseclass_offset ()
#2  0x080f2adf in cp_print_value_fields ()
#3  0x080f2208 in cp_print_value_fields ()
#4  0x080f16aa in c_val_print ()
#5  0x080a17e9 in val_print ()
#6  0x080f1dba in c_value_print ()
#7  0x080a184a in value_print ()
#8  0x080a2f94 in _initialize_valprint ()
#9  0x080a3c7c in print_address_demangle ()
#10 0x080a3ced in print_address_demangle ()
#11 0x08072b57 in _initialize_cli_dump ()
#12 0x08074489 in cmd_func ()
#13 0x080f4f36 in execute_command ()
#14 0x080bdee6 in async_disable_stdin ()
#15 0x080be553 in async_disable_stdin ()
#16 0x40043835 in rl_callback_read_char () from /lib/libreadline.so.4
#17 0x080bd84b in delete_timer ()
#18 0x080bddbd in stdin_event_handler ()
#19 0x080bd1b6 in delete_file_handler ()
#20 0x080bccc6 in _initialize_thread ()
#21 0x080bcd05 in gdb_do_one_event ()
#22 0x080f4bbb in do_catch_errors ()
#23 0x080f4a85 in throw_exception ()
#24 0x080f4bfb in catch_errors ()
#25 0x080853cd in tui_remove_hooks ()
#26 0x08085372 in tui_remove_hooks ()
#27 0x08070b28 in main ()
#28 0x080f4bbb in do_catch_errors ()
#29 0x080f4a85 in throw_exception ()
#30 0x080f4bfb in catch_errors ()
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) 


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]