Author Topic: Unable to load dynamic executable  (Read 8960 times)

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Unable to load dynamic executable
« on: December 30, 2006, 08:51:37 pm »
After I got everything compiled on my new Athlon 64 at home I got this error.
Hrm... any thoughts?

Code: [Select]
Attempt to load plugin 'crystalspace.device.joystick.linux' failed
DLERROR (/home/ryan/current/precursors/pcnetworkentity.so): /home/ryan/current/precursors/pcnetworkentity.so: cannot dynamically load executable
SCF_WARNING: factory returned a null instance for cel.pcfactory.pcnetworkentity
        if error messages are not self explanatory, recompile CS with CS_DEBUG

crystalspace.pluginmgr.loadplugin:
  could not load plugin 'cel.pcfactory.pcnetworkentity'

crystalspace.cel.physicallayer:
  CEL 'cel.pcfactory.pcnetworkentity' property class factory plugin missing!
gne.Precursors:  Error loading cel.pcfactory.pcnetworkentity factor

Code: [Select]
ryan@darth-puter ~ $ uname -a
Linux darth-puter 2.6.18-gentoo-r4 #1 SMP Thu Dec 21 15:47:42 Local time zone must be set--see zic  x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ GNU/Linux

Offline Morgul

  • GNE Founder
  • Godlike Fuzzy Dice
  • Grand Admiral
  • **********
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Unable to load dynamic executable
« Reply #1 on: December 30, 2006, 09:31:44 pm »
Make sure everything built correctly. (Especially RakNet.)
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #2 on: December 31, 2006, 06:45:10 am »
There were some warnings when RakNet was compiling both here at work and at home. Not sure if they're the same warnings or not, mostly just virtual destructor warnings and some signed/unsigned stuff in RakPeer (on x86).
One thing I forgot to check was the executable format of the pcnetworkentity.so file. Ooops, must've been tired.

--Rosencrantz

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #3 on: January 01, 2007, 04:24:52 pm »
Ok, found why it won't load.

Code: [Select]
open("/home/ryan/current/precursors/pcnetworkentity.so", O_RDONLY) = 31
read(31, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\2\0>\0\1\0\0\0\0\254@\0"..., 832) = 832
                                          ^
open("/home/ryan/current/cel/pfmechanics.so", O_RDONLY) = 31
read(31, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\206\2\0"..., 832) = 832
                                          ^

All of ther other .so's are the same up to the ">".

Does anyone have any idea what this means, or why it might be different? Changing the \2 to a \3 makes it load, but it still segfaults when it tries to use the network plugin.
« Last Edit: January 01, 2007, 04:46:41 pm by whitelynx »

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #4 on: January 03, 2007, 04:29:14 pm »
Minor update:

RakNet does work on 64-bit linux, or at least the latest version does. I downloaded it, compiled it and the test chat program, which works fine (Other than not being robust enough to accept localhost as a valid IP to connect to).


Offline Morgul

  • GNE Founder
  • Godlike Fuzzy Dice
  • Grand Admiral
  • **********
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Unable to load dynamic executable
« Reply #5 on: January 03, 2007, 08:34:24 pm »
Well, then I guess the only thing to do, is to put that version in precursors, and see if it works. All you should need to do is to put the headers in include/raknet and everything in source wherever the current raknet source is in our repo.
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #6 on: January 03, 2007, 09:54:38 pm »
Well, then I guess the only thing to do, is to put that version in precursors, and see if it works. All you should need to do is to put the headers in include/raknet and everything in source wherever the current raknet source is in our repo.

That was my thought as well, but no go. Still the most up to date version in the repo.
I'll fiddle around some and see what else I can find, if anything.


Offline Morgul

  • GNE Founder
  • Godlike Fuzzy Dice
  • Grand Admiral
  • **********
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Unable to load dynamic executable
« Reply #7 on: January 04, 2007, 09:24:19 am »
Regarding the 'fix' you found of manually putting '-shared' in the gcc line; that makes it a shared library. IIRC, the way to do this via configure is --enable-shared.

In thinking about this, -shared might imply -fPIC, which might be the actual flag that's needed. Unsure of that, and I don't have to time to see if we're building with -fPIC normally. I think that the problem is it's not position independent, and breaks on 64 bit systems somehow. Again, this is just ignorant speculation.

--Chris
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #8 on: January 05, 2007, 12:50:20 pm »
Well I found how to get the -shared option added in correctly. I used the Crystal Space External Application configure script generator and diffed some of the jam rules until I found something useful. Found the appropriate jam file, tried it out on 32-bit, and commited it. Works fine on my work box, I'll see if it actually fixes the problem when I get home.


Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #9 on: January 06, 2007, 04:32:22 pm »
Ok, there is something here at work amidst the jamfiles that is *very* *very* wierd.

Exhibit A) On kashmir, "jam -d x pcnetworkentity" with rev 1114 shows that it is being compiled with -shared. This is good.

Exhibit B) On my amd64 "jam -d x pcnetworkentity" with rev 1114 shows that it is being compiled without -shared. This is not good.

Exhibit C) http://gne.pastebin.ca/308553. Causes everything to work normally, but I've no idea if that's safe to change.

Any thoughts?

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Unable to load dynamic executable
« Reply #10 on: January 06, 2007, 07:22:11 pm »
Found it, fixed it, and commited. Updated the mk/autoconf scripts. They were setting the PLUGIN.LDFLAGS to -shared on x86, but not amd64. Updating from the latest CS Ext Package stuff worked. Now there's a new problem, *sigh* (only with networking though).

« Last Edit: January 06, 2007, 08:34:26 pm by Rosencrantz »