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 21072 times)

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #15 on: April 30, 2011, 12:05:28 AM »

Ok, I can't upgrade to 11.04 yet, I'll try to reproduce it when I can update.

As I understand, this has nothing to do with compiling static, the same error happens with dynamic libs, right?

Does compiling with gcc 4.4 solves it? You may use galternatives aliases or CC= env to do that.

Stu, Debian/Ubuntu debs plan to deprecate static linking, you may not agree but it is their choice :(

Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: undefined reference to `non-virtual thunk
« Reply #16 on: April 30, 2011, 03:35:59 AM »

Error also happens on MacOSX 10.6.5, with... i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Logged

Stu Redman

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

The thunk error or the crash?
Mind, I worked around the thunk error in 10546, if anybody wants to reproduce it use an older version.
The crash is bothering me way more.
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 #18 on: April 30, 2011, 03:57:30 PM »

Tried it with Ubuntu 10.10 (gcc 4.4). Identical behavior.
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 #19 on: April 30, 2011, 04:51:52 PM »

You don't have to do that if you use --with-wxdir=
Does not help. ldconfig is still required.
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 #20 on: April 30, 2011, 05:23:10 PM »

No it isn't. It was never required for me.
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 #21 on: April 30, 2011, 05:46:41 PM »

Just for the logs:

I compiled aMule-svn-10545 (just before "dropping" MuleTextCtrl) and wxWidgets-svn-67634 with:
1) gcc-4.4.2: "undefined reference" errors as the topic of this thread says
2) gcc-3.4.6: compiled cleanly, runs, connects with HighID to both servers and kad. The only failure was HTTP download, it always returned "Void response on stream creation", but that might be caused by my setup.

So, it seems that the problem is really a compiler bug. Unfortunately we just cannot tell everyone to revert to gcc3 :/
Logged
concordia cum veritate

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: undefined reference to `non-virtual thunk
« Reply #22 on: April 30, 2011, 06:06:46 PM »

You don't have to do that if you use --with-wxdir=
Does not help. ldconfig is still required.
Read ldconfig's man page. ldconfig is only needed in relationship with /etc/ld.so.conf, so it is weird you need to run it.
Logged

btkaos

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

So, it seems that the problem is really a compiler bug. Unfortunately we just cannot tell everyone to revert to gcc3 :/
The question is if the bug is in gcc3 or in gcc4.
Logged

Stu Redman

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

No it isn't. It was never required for me.
My bad. I passed the install dir instead of the build dir . Now it works (well - segfaults...) Neat.
Maybe configure should check if there are dynamic libs in the place it later tells the linker to search them?

Wx samples seem to work however.  ???

Unfortunately we just cannot tell everyone to revert to gcc3 :/
Well, gcc4 has been out for 6 years. Did you build gcc3 yourself or is your distro that old?
But I can believe wx devs still use it (seeing from the changelog how lovingly they try to keep it running with VC6, but don't offer projects for VC10 otoh).
Next attempt: build wx without optimize.

Edit: segfaults too.
« Last Edit: April 30, 2011, 06:34:27 PM by Stu Redman »
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 #25 on: April 30, 2011, 08:02:06 PM »

Tried wx 2.9.1:

- compiles without thunky-error
- new and interesting crash:
Code: [Select]
Assertion failed: ../wxWidgets-2.9.1/include/wx/strvararg.h:wxArgNormalizer:449: Assertion '(argtype & (wxFormatStringSpecifier<T>::value)) == argtype' failed. format specifier doesn't match argument type

Backtrace follows:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff50eb100 in wcslen () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff50eb100 in wcslen () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff5ed1a59 in operator+ (pwz=0x0, str=...)
    at ../wxWidgets-2.9.1/src/common/string.cpp:700
#2  0x000000000079f617 in operator+ (buf=..., string=...)
    at /home/martin/amule/wx291/wxWidgets-2.9.1/include/wx/string.h:4022
#3  0x000000000079ec20 in get_backtrace (n=3)
    at ../../../../trunk/src/libs/common/MuleDebug.cpp:405
#4  0x000000000079f4c4 in print_backtrace (n=3)
    at ../../../../trunk/src/libs/common/MuleDebug.cpp:476
#5  0x0000000000460a84 in CamuleApp::OnAssertFailure (this=0xe19400,
    file=0xe97b80 L"../wxWidgets-2.9.1/include/wx/strvararg.h", line=449,
    func=0xe98460 L"wxArgNormalizer",
    cond=0xe98b80 L"(argtype & (wxFormatStringSpecifier<T>::value)) == argtype", msg=0xe98630 L"format specifier doesn't match argument type")
    at ../../trunk/src/amule.cpp:1091
#6  0x00007ffff5e3cb1b in wxDefaultAssertHandler (file=..., line=449,
    func=..., cond=..., msg=...)
    at ../wxWidgets-2.9.1/src/common/appbase.cpp:1053
#7  0x00007ffff5e3d277 in wxOnAssert (
    file=0x7ffff624d318 "../wxWidgets-2.9.1/include/wx/strvararg.h", line=449,
    func=0x7ffff624d430 "wxArgNormalizer",
---Type <return> to continue, or q <return> to quit---
    cond=0x7ffff624d2d8 "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype", msg=0x7ffff624d2a8 "format specifier doesn't match argument type")
    at ../wxWidgets-2.9.1/src/common/appbase.cpp:1129
#8  0x00007ffff623f3a0 in wxArgNormalizer<unsigned int>::wxArgNormalizer (
    this=0x7fffffffd1e0, value=1, fmt=0x7fffffffd270, index=4)
    at ../wxWidgets-2.9.1/include/wx/strvararg.h:449
#9  0x00007ffff623f2e6 in wxArgNormalizerUtf8<unsigned int>::wxArgNormalizerUtf8 (this=0x7fffffffd1e0, value=1, fmt=0x7fffffffd270, index=4)
    at ../wxWidgets-2.9.1/include/wx/strvararg.h:481
#10 0x00007ffff623f0da in wxString::Format<unsigned int, unsigned int, unsigned int, unsigned int> (f1=..., a1=127, a2=0, a3=1, a4=1)
    at ../wxWidgets-2.9.1/include/wx/string.h:2325
#11 0x00007ffff623e457 in wxIPV4address::IPAddress (this=0x7fffffffd300)
    at ../wxWidgets-2.9.1/src/common/sckaddr.cpp:882
#12 0x00000000007799a8 in StringHosttoUint32 (Host=...)
    at ../../trunk/src/NetworkFunctions.cpp:83
#13 0x000000000045b732 in CamuleApp::OnInit (this=0xe19400)
    at ../../trunk/src/amule.cpp:380
#14 0x0000000000656250 in CamuleGuiApp::OnInit (this=0xe19400)
    at ../../trunk/src/amule-gui.cpp:275
#15 0x0000000000467039 in wxAppConsoleBase::CallOnInit (this=0xe19400)
---Type <return> to continue, or q <return> to quit---
    at /home/martin/amule/wx291/wxWidgets-2.9.1/include/wx/app.h:92
#16 0x00007ffff5ea7541 in wxEntry (argc=@0x7ffff6214150, argv=0xddc880)
    at ../wxWidgets-2.9.1/src/common/init.cpp:456
#17 0x00007ffff5ea7632 in wxEntry (argc=@0x7fffffffe20c, argv=0x7fffffffe2f8)
    at ../wxWidgets-2.9.1/src/common/init.cpp:484
#18 0x0000000000655553 in main (argc=1, argv=0x7fffffffe2f8)
    at ../../trunk/src/amule-gui.cpp:93
(gdb) bt full
#0  0x00007ffff50eb100 in wcslen () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff5ed1a59 in operator+ (pwz=0x0, str=...)
    at ../wxWidgets-2.9.1/src/common/string.cpp:700
        s = {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) n

/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.
Create a core file of GDB? (y or n) n
<error reading variable>
        __FUNCTION__ = "operator+"
        s = {static npos = 18446744073709551615, static ms_cache = warning: static field's value depends on the current frame - bad debug info?
I had wx 2.9.1 running before. Maybe it was a 32 bit Linux? Can't tell.
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 #26 on: April 30, 2011, 08:17:26 PM »

The thunk error or the crash?
Mind, I worked around the thunk error in 10546, if anybody wants to reproduce it use an older version.

You workarounded it for yourself - but on the mac system mentioned above, it still exist for other classes (like wxListBox)
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 #27 on: April 30, 2011, 08:20:35 PM »

Oh, my...

I realized, that in the above test I built aMule and wx with gcc4 with debug enabled and optimization disabled, but with gcc3 with debug disabled and optimization enabled. So, for the clarity of the test I repeated the gcc4 compilation with --enable-optimize and --disable-debug.

Guess what? Yes, you're right. Compiled successfully, working O.K. (Still the version before Stu patched MuleTextCtrl).

Any idea?
Logged
concordia cum veritate

Kry

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

Make a reproducible test case, inform wxWidgets devs and possibly CC: to gcc devs.

Now, as for lazy ideas... I got nothing.
Logged

Stu Redman

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

--disable-debug ? LOL. Didn't try that one yet. Let's see...

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
Pages: 1 [2] 3