Discussion:
[Bug c++/23908] New: "There is no member named" error until parent object pointer is printed
aboya at igalia dot com
2018-11-22 15:48:52 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23908

Bug ID: 23908
Summary: "There is no member named" error until parent object
pointer is printed
Product: gdb
Version: 8.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: aboya at igalia dot com
Target Milestone: ---

How to reproduce:

1. Build WebKitGTK in debug mode (extremely time consuming), r238414 (git:
060dcd214145c39f4e53af7539139a3f86ff8836).
2. Run `WEB_PROCESS_CMD_PREFIX="/usr/bin/gdbserver localhost:7123"
Tools/Scripts/run-minibrowser --debug --gtk --enable-mediasource=true

3. In another terminal run `gdb` and type the following commands:

(gdb) set sysroot
(gdb) target remote localhost:7123
(gdb) b SourceBuffer::sourceBufferPrivateAppendComplete
Function "SourceBuffer::sourceBufferPrivateAppendComplete" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (SourceBuffer::sourceBufferPrivateAppendComplete) pending.
(gdb) c
Continuing.
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
Missing separate debuginfo for /lib64/libGL.so.1
Try: dnf --enablerepo='*debug*' install
/usr/lib/debug/.build-id/d9/a3825ff49f0524e876b87663b2b6d910ad0fa3.debug
Missing separate debuginfo for /lib64/libEGL.so.1
Try: dnf --enablerepo='*debug*' install
/usr/lib/debug/.build-id/e4/9cc3052c3910a1dfd0ead7328e68d8dda3dc40.debug
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
[...]
[New Thread 6318.6560]

Thread 1 "WebKitWebProces" hit Breakpoint 1, non-virtual thunk to
WebCore::SourceBuffer::sourceBufferPrivateAppendComplete(WebCore::SourceBufferPrivateClient::AppendResult)
()
at ../../Source/WebCore/Modules/mediasource/SourceBuffer.h:140
140 void sourceBufferPrivateAppendComplete(AppendResult) final;
Missing separate debuginfos, use: dnf debuginfo-install
elfutils-libelf-0.174-1.fc29.x86_64 libXxf86vm-1.1.4-10.fc29.x86_64
libedit-3.1-24.20170329cvs.fc29.x86_64 libevent-2.1.8-3.fc29.x86_64
libseccomp-2.3.3-3.fc29.x86_64 libxshmfence-1.3-3.fc29.x86_64
llvm-libs-7.0.0-2.fc29.x86_64 ncurses-libs-6.1-8.20180923.fc29.x86_64
sssd-client-2.0.0-4.fc29.x86_64
(gdb) s
WebCore::SourceBuffer::sourceBufferPrivateAppendComplete (this=0x0,
result=WebCore::SourceBufferPrivateClient::AppendSucceeded) at
../../Source/WebCore/Modules/mediasource/SourceBuffer.cpp:653
653 {
(gdb)

Thread 1 "WebKitWebProces" hit Breakpoint 1,
WebCore::SourceBuffer::sourceBufferPrivateAppendComplete (this=0x7ffe636c6300,
result=WebCore::SourceBufferPrivateClient::AppendSucceeded)
at ../../Source/WebCore/Modules/mediasource/SourceBuffer.cpp:654
654 if (isRemoved())
(gdb) p this->m_source->m_mediaElement
There is no member named m_mediaElement.
(gdb) p this->m_source->m_mediaElement
There is no member named m_mediaElement.
(gdb) p this->m_source->m_mediaElement
There is no member named m_mediaElement.
(gdb) p this->m_source
$1 = (WebCore::MediaSource *) 0x7fff4f015000
(gdb) p this->m_source->m_mediaElement
warning: RTTI symbol not found for class 'WebCore::MediaSource'
$2 = (WebCore::HTMLMediaElement *) 0x7fff4f2008d0
(gdb) p this->m_source->m_mediaElement->m_mediaSource
warning: RTTI symbol not found for class 'WebCore::MediaSource'
$3 = {static isRefPtr = <optimized out>, m_ptr = 0x7fff4f015000}

Notice how printing this->m_source->m_mediaElement does not work until the
pointer to the object containing it is printed. This reproduces every time.

I tried replicating the issue with a single .cpp file with three plain structs,
but that case worked fine. Of course, WebKit introduces a lot more complexity
and places things can go wrong for gdb.

System information:

g++ (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)
GNU gdb (GDB) Fedora 8.2-3.fc29
Fedora 29
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...