Bug 9541 - Bogus "warning: can't find linker symbol for virtual table for 'Foo' value" messages
Summary: Bogus "warning: can't find linker symbol for virtual table for 'Foo' value" m...
Status: RESOLVED DUPLICATE of bug 11990
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.7
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-26 23:28 UTC by vz-gdb
Modified: 2013-03-06 20:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vz-gdb 2008-03-26 23:28:01 UTC
[Converted from Gnats 2436]

gdb gives extremely annoying error messages like this:

(gdb) p child
$1 = (warning: can't find linker symbol for virtual table for `wxWindow' value
warning: can't find linker symbol for virtual table for `wxWindow' value
class wxWindow *) 0x7b35b0

when the "vtable for wxWindow" symbol is in a shared library used by the application and not the main executable itself.
In spite of the warning, you can work with the value just fine (e.g. dereference and print it). I don't know if the warning indicates any other deep problems but if not, it would be great if this warning could just be suppressed.

Thanks in advance!

P.S. My main system uses gdb 6.4.90-debian, but the problem is exactly the same with 6.7.1-debian

Release:
6.7.1-debian

Environment:
Debian Linux under amd64

How-To-Repeat:
I don't provide a test case because this would require several files (shared library defining a class with virtual functions, application using it, makefile, ...) while normally any existing case like this should result in those warnings. But if you can't reproduce the problem please let me know and I'll try to work on a test case. Thanks!
Comment 1 Tom Tromey 2012-11-28 17:43:21 UTC
This has been reported before but never with a test case.
I don't know how to reproduce it.
Does it still fail with a newer gdb?
If so can you make a small test case?
Comment 2 vz-gdb 2012-11-28 19:26:13 UTC
(In reply to comment #1)
> This has been reported before but never with a test case.
> I don't know how to reproduce it.

Unfortunately me neither. I've never seen it in small test applications.

> Does it still fail with a newer gdb?
> If so can you make a small test case?

I've seen it just recently with 7.2.50.20100904-cvs (still Debian, x86-64, using wxWidgets shared libraries) and I can retest it with a later version if it can help, but I unfortunately have no idea how to reproduce this in a simple test case. Please let me know if you'd like me to test with the latest gdb nevertheless.
Comment 3 Tom Tromey 2012-11-28 20:22:44 UTC
(In reply to comment #2)
> Please let me know if you'd like me to test with the latest gdb
> nevertheless.

It's worth a try.
Comment 4 vz-gdb 2012-11-29 20:03:04 UTC
I can confirm that the problem still exists with 7.5.50.20121129-cvs version (built from sources without any special configure options under bog standard x64 Debian system). I didn't see it with wxWindow yet but just showing the value of some random window pointer I see the following:

(gdb) p *this
$4 = (wxNumberEntryDialog) {
  <wxDialog> = {
    <wxDialogBase> = {
      <wxTopLevelWindow> = {
        <wxTopLevelWindowGTK> = {
          <wxTopLevelWindowBase> = {
            <wxNavigationEnabled<wxNonOwnedWindow>> = {
              <wxNonOwnedWindow> = {
                <wxNonOwnedWindowBase> = {
                  <wxWindow> = {
                    <wxWindowBase> = {
...
                      m_font = warning: can't find linker symbol for virtual table for `wxFont' value
{
                        <wxFontBase> = {
                          <wxGDIObject> = {
                            <wxObject> = {
                              _vptr.wxObject = 0x67e510 <_ZTV6wxFont@@WXU_2.9+16>,
                              m_refData = 0x0
                            },
                          },
                        },
                      },
                      m_backgroundColour = warning: can't find linker symbol for virtual table for `wxColour' value
{
                        <wxColourBase> = {
                          <wxGDIObject> = {
                            <wxObject> = {
                              _vptr.wxObject = 0x67b330 <_ZTV8wxColour@@WXU_2.9+16>,
                              m_refData = 0x0
                            },
                          }, <No data fields>},
                      },
...
(gdb) p this->m_font
$5 = warning: can't find linker symbol for virtual table for `wxFont' value
warning: can't find linker symbol for virtual table for `wxFont' value
{
  <wxFontBase> = {
    <wxGDIObject> = {
      <wxObject> = {
        _vptr.wxObject = 0x67e510 <_ZTV6wxFont@@WXU_2.9+16>,
        m_refData = 0x0
      },
    },
  },
}

AFAICS there is absolutely nothing special about wxFont and wxColour classes compared to many others that it doesn't seem to have problems with.

Please let me know if there is anything else I can do to help finding this bug.
Comment 5 Tom Tromey 2013-03-06 20:05:28 UTC
Most likely a dup.

*** This bug has been marked as a duplicate of bug 11990 ***