aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2 3

Author Topic: undefined reference to `non-virtual thunk  (Read 25242 times)

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
undefined reference to `non-virtual thunk
« on: April 28, 2011, 07:44:25 PM »

aMule SVN with wx trunk, Ubuntu 11.4 with gcc 4.5 (default in 11.4) fails with
Code: [Select]
Building libmuleappcore.a
Linking amule
amule-ChatSelector.o:(.rodata._ZTV12CChatSession[vtable for CChatSession]+0x7b0): undefined reference to `non-virtual thunk to wxTextCtrlBase::overflow(int)'
amule-ChatSelector.o:(.rodata._ZTV12CChatSession[vtable for CChatSession]+0x7d8): undefined reference to `non-virtual thunk to wxTextCtrl::GetLineLength(long) const'
amule-ChatSelector.o:(.rodata._ZTV12CChatSession[vtable for CChatSession]+0x7e0): undefined reference to `non-virtual thunk to wxTextCtrl::GetLineText(long) const'
... a lot more of these...
./libmuleappgui.a(libmuleappgui_a-MuleTextCtrl.o):(.rodata._ZTV13CMuleTextCtrl[vtable for CMuleTextCtrl]+0x7b0): undefined reference to `non-virtual thunk to wxTextCtrlBase::overflow(int)'
./libmuleappgui.a(libmuleappgui_a-MuleTextCtrl.o):(.rodata._ZTV13CMuleTextCtrl[vtable for CMuleTextCtrl]+0x7d8): undefined reference to `non-virtual thunk to wxTextCtrl::GetLineLength(long) const'
./libmuleappgui.a(libmuleappgui_a-MuleTextCtrl.o):(.rodata._ZTV13CMuleTextCtrl[vtable for CMuleTextCtrl]+0x7e0): undefined reference to `non-virtual thunk to wxTextCtrl::GetLineText(long) const'
... a lot more of these...
WTF? Anybody have an idea? Compilation works with MSVC.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: undefined reference to `non-virtual thunk
« Reply #1 on: April 28, 2011, 08:21:46 PM »

What's the purpose of CMuleTextCtrl in the first place?
Code: [Select]
/**
 * This class is a slightly improved wxTextCtrl that supports the traditional
 * popup-menu usually provided by text-ctrls. It provides the following options:
 *  - Cut
 *  - Copy
 *  - Paste
 *  - Clear
 *  - Select All
 *
 * Other than that, it acts exactly like an ordinary wxTextCtrl.
 */

Windows: it creates a custom popup with less options than the wxTextCtrl
Linux: both popups of wxTextCtrl and CMuleTextCtrl are identical.
(That's with wx 2.8 in both cases.)
Can we ditch this?

wxTextCtrl doesn't like to be derived from in 2.9 apparently. A quick slash-CMuleTextCtrl-out leaves just the errors for the CChatSession which also derives from it. Could be changed from inheritance to composition, maybe that would work around the problem.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: undefined reference to `non-virtual thunk
« Reply #2 on: April 28, 2011, 10:28:52 PM »

How about 2.8? Does it also have the same popups?

Also, we have to keep Mac in mind, and by "we" I mean "I".
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: undefined reference to `non-virtual thunk
« Reply #3 on: April 28, 2011, 11:08:02 PM »

(That's with wx 2.8 in both cases.)
I couldn't check popups in 2.9 because it didn't compile...

This is fucked up utterly.
I got it compiled now (changing the chatsession), and now it segfaults in
Code: [Select]
bool CamuleAppCommon::InitCommon(int argc, wxChar ** argv)
{
theApp->SetAppName(wxT("aMule"));
And gdb says:
Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x000000000044b05a in __gnu_cxx::__exchange_and_add (__mem=0xfffffffffffffff8,
    __val=-1) at /usr/include/c++/4.5/ext/atomicity.h:46
46   { return __sync_fetch_and_add(__mem, __val); }
(gdb) bt full
#0  0x000000000044b05a in __gnu_cxx::__exchange_and_add (
    __mem=0xfffffffffffffff8, __val=-1)
    at /usr/include/c++/4.5/ext/atomicity.h:46
No locals.
#1  0x000000000044b0ef in __gnu_cxx::__exchange_and_add_dispatch (
    __mem=0xfffffffffffffff8, __val=-1)
    at /usr/include/c++/4.5/ext/atomicity.h:79
No locals.
#2  0x000000000044f2c4 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose (this=0xffffffffffffffe8, __a=...)
    at /usr/include/c++/4.5/bits/basic_string.h:235
No locals.
#3  0x000000000044f56e in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign (this=0xe4a780, __str=...)
    at /usr/include/c++/4.5/bits/basic_string.tcc:250
        __a = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}
        __tmp = 0xe69468 "aMule"
#4  0x000000000044ed73 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator= (this=0xe4a780, __str=...)
    at /usr/include/c++/4.5/bits/basic_string.h:533
---Type <return> to continue, or q <return> to quit---
No locals.
#5  0x000000000044c633 in wxString::operator= (this=0xe4a780, stringSrc=...)
    at /home/martin/amule/wx291/inst/include/wx-2.9/wx/string.h:1923
No locals.
#6  0x00000000006f2ece in wxAppConsoleBase::SetAppName (this=0xe4a680,
    name=...) at /home/martin/amule/wx291/inst/include/wx-2.9/wx/app.h:145
No locals.
#7  0x00000000006ef73b in CamuleAppCommon::InitCommon (this=0xe4a960, argc=1,
    argv=0xec96f0) at ../../trunk/src/amuleAppCommon.cpp:212
        linksPassed = 140737488343840
        logfileName = {m_printable = {static npos = 18446744073709551615,
            static ms_cache = warning: static field's value depends on the current frame - bad debug info?

/build/buildd/gdb-7.2/gdb/findvar.c:427: internal-error: read_var_value: Assertion `frame' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

I'd say, wx guys should take awhile before trying to release a 2.9.2 .
And it also STILL doesn't compile static, so I head to mess around with ldconfig, LD_LIBRARY_PATH, whatever.  >:(
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: undefined reference to `non-virtual thunk
« Reply #4 on: April 29, 2011, 02:20:05 AM »

You don't have to do that if you use --with-wxdir=

Anyway, make sure you didn't change a header and didn't make clean, just in case.

(also that error looks familiar...)
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #5 on: April 29, 2011, 03:38:32 AM »

A month ago I found aMule unusable with wx 2.9. Also wx is not compilable against GTK head (3.0)

IMHO we should wait a least until wx is compilable against gtk-3.0 before trying to debug it.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #7 on: April 29, 2011, 03:18:57 PM »

http://www.google-melange.com/gsoc/project/google/gsoc2011/john_chain/12001
Good. In fact not a lot of things had to be done, I almost managed to compile wx against gtk-3.0 in a few hours, mainly deprecated stuff, etc...
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: undefined reference to `non-virtual thunk
« Reply #8 on: April 29, 2011, 04:23:23 PM »

Anyway, make sure you didn't change a header and didn't make clean, just in case.
Checked out wx fresh, built it and aMule fresh (with TextCtrl patches). Same. Removed that line, next crash on a wxString == . With gdb crash again. Looks like all wxString ops are fucked.

Duuhh.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: undefined reference to `non-virtual thunk
« Reply #9 on: April 29, 2011, 08:47:10 PM »

You know, this is strange. I don't think we're approaching it right. What does that error (non-virtual thunk) mean anyway? So far I have only been able to see reports of it being a COMPILER bug.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #10 on: April 29, 2011, 08:58:57 PM »

My guess is that you are linking c++ libraries built with gcc 4.4 and 4.5.

Note that the C++ ABI may change between releases. Stu, try to recompile everything with the same compiler version and try again.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #11 on: April 29, 2011, 09:01:51 PM »

By everything of course I mean just C++ libraries. C-only stuff should be OK.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: undefined reference to `non-virtual thunk
« Reply #12 on: April 29, 2011, 10:47:30 PM »

Stu, try to recompile everything with the same compiler version and try again.
If by "everything" you mean "wx and aMule" - I did just that. For cryptopp and zlib I just installed libdev packages though.
I didn't supply a compiler to any configure either, it's just the plain gcc shipping with Nutty (which is 4.5).
I used the same technique for building with wx 2.8.12 which works fine.

Wait a moment. 2.8.12 I built static, so no dll hell (or .so hell). With 2.9 this didn't work. I got some really strange error message. Probably the same thunk junk. Since static didn't work before either I shrugged it off and rebuilt dynamic.
Might I be mixing in something that ships with Ubuntu?

I think I'll check if my Morose Mungo still works and rebuild the whole crap there.

What does that error (non-virtual thunk) mean anyway?
I think I read in the wx doku that some control classes can't be overloaded because some functions are not declared virtual. So that's why I tried not overloading it which at least makes it compile. No idea if the strange compiler error and the string crash are even related.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: undefined reference to `non-virtual thunk
« Reply #13 on: April 29, 2011, 10:54:13 PM »

Yeah but; do wx samples break too?
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: undefined reference to `non-virtual thunk
« Reply #14 on: April 30, 2011, 12:02:31 AM »

I get the same error here. 2.8.12 works fine, 2.9.2 (svn) fails. All I could find about this error in the short time I have now, is that compilation might succeed with gcc3 even though it fails with gcc4. I'll test it sometime soon.

<edit>...and that it might be related to virtual functions of a class being split over multiple source files. None of these informations can be depended on, though</edit>
« Last Edit: April 30, 2011, 12:05:13 AM by GonoszTopi »
Logged
concordia cum veritate
Pages: [1] 2 3