Raised This Month: $168 Target: $400
 42% 

My plugin does not load in linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
taansari
Member
Join Date: Nov 2011
Old 12-22-2011 , 05:53   My plugin does not load in linux
Reply With Quote #1

Hi!

I've made a plugin that I ran and tested on Windows (HLDS - GoldSrc version). Now I also want to port it to Linux. So I got a new linux machine, got ubuntu, GCC installed on it, and decided to use Code::blocks for compilation.

After somewhat efforts I am now able to compile my plugin under linux hood. After installing metamod 1.18 binaries at required places etc., I updated plugins.ini file, as well as copied my plugin's .so file to the correct place.

Now when i run hlds using

sudo ./hlds_run -game cstrike -dev -autoupdate +maxplayers 20 -port 27017

command, my plugin does not load.

Running 'meta info 1' gives me:

Code:
name: (nil)
         desc: t1
       status: badfile
       action: load
     filename: addons/metamod/dlls/t1.so
         file: ctp_tracker.so
     pathname: /home/...../VALVe/HLServer/cstrike/cstrike/addons/metamod/dlls/t1.so
        index: 1
       source: ini file
     loadable:  -
   unloadable:  -
      version: (nil)
         date: (nil)
       author: (nil)
          url: (nil)
       logtag: (nil)
       ifvers: (nil)
  last loaded: Thu Jan  1 05:00:00 1970
No DLLAPI functions.
No DLLAPI-Post functions.
No NEWAPI functions.
No NEWAPI-Post functions.
No Engine functions.
No Engine-Post functions.
Registered commands:
0 commands
Registered cvars:                      float value  string value
0 cvars
No child plugins.
and running 'meta list' gives me:
Code:
Currently loaded plugins:
      description      stat pend  file              vers      src  load  unlod
 [ 1] t1              badf load  t1.so    v -       ini   -     -
Now I'm very stumped. Compiler does not complain. I've mentioned the right path otherwise it wouldnt be detected by metamod in first place....

What could I be doing wrong? Can someone please guide me in this regards?

Thanks!!!
taansari is offline
taansari
Member
Join Date: Nov 2011
Old 12-22-2011 , 08:30   Re: My plugin does not load in linux
Reply With Quote #2

I'd like to add some more details:

plugins.ini is as follows:

Code:
linux    addons/metamod/dlls/t1.so   t1
#win32    dlls/admin_MM_i386.dll
the path 'is' supposedly correct, and relative to 'cstrike' game directory (where liblist.gam file is present). So the problem if I'm referencing wrong path should not be there.

Guidance anyone, please?
taansari is offline
taansari
Member
Join Date: Nov 2011
Old 12-26-2011 , 07:19   Re: My plugin does not load in linux
Reply With Quote #3

Hi

After looking more into this matter, I found it was because i am using Ubuntu 64 bit, with Code::blocks also 64 bit. while my dll was compiling fine because no linkage with other dlls (valve) was there for goldsrc, it was not being loaded by HL sever, simply because 64 bit architecture is not supported.

After a lot of hassle i am able to compile my dll as 32 bit. now, hlds recognizes it, but my plugin somehow crashes, and i can only see this message when i type meta info:

Code:
Uploading dump (in-process) [proxy '']
/tmp/dumps/crash_20111226170708_1.dmp
success = yes
response:  CrashID=bp-86f75c8c-d02b-47e2-91fe-16ca82111226
i remember reading somewhere lstdc++ is not supported by metamod, and one should avoid using exceptions, or STL altogether. while i was able to remove all stl related calls, my dll still wanted to link against said library. so i installed multilib for gcc /g++ - whatever.

No my code compiles and is recogized by hlds, but fails to load, and crashes the server...

i guess it means back to the drawing board...

if i can get more guidance, i'll really appreciate it...
taansari is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-26-2011 , 20:39   Re: My plugin does not load in linux
Reply With Quote #4

I don't know about MetaMod C++ plugins, but MetaMod: Source comes with a Makefile for compiling C++ plugins against it properly. Doesn't MetaMod have that?
__________________
So long and thanks for all the fish.

Last edited by Powerlord; 12-26-2011 at 20:40.
Powerlord is offline
taansari
Member
Join Date: Nov 2011
Old 12-28-2011 , 04:58   Re: My plugin does not load in linux
Reply With Quote #5

@Powerlord

Thanks for the tip. Apologies for the delayed response - you are correct samples do come with a MakeFile, but I didn't base my building via console - I initially decided to use some IDE that might mean lesser work on my side (because I'm comnig from Windows background so dont have detailed information in linux). After somewhat hassle, in start I used Code::blocks, but failure there. Now i've moved to Netbeans.

Experience with Netbeans, as far as compilation and user friendliness is concerned, is much better as compared to Code::blocks in a view (just made the switch and hour or two ago).

^^ saying this just for the record, so it might help someone as newbee as myself...
edit: also saying above since Netbeans took care of the -m32, and fPIC flags automatically that I had to specify specifically in Code::blocks after bit of reading on net.

Coming back to the topic, I tried to compile the stub_mm plugin that comes as a metamod sample plugin. Same error is there. I tried building this plugin under netbeans, and as result either i get the above segmentation fault, or BADF after launching server.

So I'm thinking there might be some problem elsewhere, maybe I should just trash my 64bit linux and build on a 32bit linux OS...?

Do you have any suggestions, please?

Last edited by taansari; 12-28-2011 at 05:00.
taansari is offline
taansari
Member
Join Date: Nov 2011
Old 12-28-2011 , 05:15   Re: My plugin does not load in linux
Reply With Quote #6

Hey!

Wait a minute. If its just 'my' configuration, other linux based plugins should be loading on server easily, right? For a test I took 'antiaim' and AntiFake plugins (32 bit) and tried to run them separately (from http://metamod.org/plugins.html). Same error!!!

Either its BADF, and sometimes segmentation failure (so with this error I know MM:S does try to load my plugin, and its not that I've specified wrong path some or something).

Now I'm really puzzled...
taansari is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-28-2011 , 10:08   Re: My plugin does not load in linux
Reply With Quote #7

Quote:
Originally Posted by taansari View Post
Hey!

Wait a minute. If its just 'my' configuration, other linux based plugins should be loading on server easily, right? For a test I took 'antiaim' and AntiFake plugins (32 bit) and tried to run them separately (from http://metamod.org/plugins.html). Same error!!!

Either its BADF, and sometimes segmentation failure (so with this error I know MM:S does try to load my plugin, and its not that I've specified wrong path some or something).

Now I'm really puzzled...
This is Ubuntu, right? It's possible that some 32-bit libraries MetaMod needs (but HLDS doesn't) are missing.

Make sure the ia32-libs package is installed. It's a meta-package that installs common 32-bit libraries for you.

Edit: It looks like you may need ia32-libs-multiarch in newer versions, too.
__________________
So long and thanks for all the fish.

Last edited by Powerlord; 12-28-2011 at 10:11.
Powerlord is offline
taansari
Member
Join Date: Nov 2011
Old 12-28-2011 , 11:22   Re: My plugin does not load in linux
Reply With Quote #8

I see!

Thanks for the prompt reply - I'll try this and get back here!

Many thanks once again... (I was just about to dump 64 bit and move to 32 bits from tomorrow onwards...)
taansari is offline
taansari
Member
Join Date: Nov 2011
Old 12-29-2011 , 04:42   Re: My plugin does not load in linux
Reply With Quote #9

Ok, I'm back with a feedback <sigh>

I tried getting both the things you mentioned, and I'm already up to date...
Code:
[email protected]:~$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ia32-libs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.
[email protected]:~$ sudo apt-get install ia32-libs-multiarch
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ia32-libs-multiarch:i386 is already the newest version.
ia32-libs-multiarch:i386 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.
[email protected]:~$
So should I install 32bit? I've installed a VM ware on other PC and going to do so shortly.

If I can get more guidance, I'll appreciate it... thanks...
taansari is offline
taansari
Member
Join Date: Nov 2011
Old 12-30-2011 , 13:41   Re: My plugin does not load in linux
Reply With Quote #10

Further update:

I installed Ubuntu 32 bit 11.10 version. After installation etc., I get the same problem. I was thinking maybe it has to do with latest version, so installed another VM machine, this time of Ubuntu 32 bit 10.04 LTS version. Same problem there.... so there must be something with the configuration, setup environment something...

I tried getting the latest cstrike (maybe installation was unsuccessful), via this command: sudo ./steam -command update -game cstrike -dir cstrike -verify_all

nothing.

I have read on srcds forum, also elsewhere IIRC people have faced similar issues with Linux server. Sadly, they too never got to the right answer. Now what on earth does Linux has to do anything with this? There must be some answer somewhere.... anyone knows, please?

Things are getting way too bad. While I am really enjoying the Linux environment, I had reason to believe it's pretty good and stable. But whats wrong with metamod plugins...?
taansari is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:37.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode