Raised This Month: $51 Target: $400
 12% 

Debugging on Linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BAILOPAN
Join Date: Jan 2004
Old 04-27-2004 , 20:26   Debugging on Linux
Reply With Quote #1

Since many people are reporting "segmentation faults" or crashes on a Linux HLDS installation with AMX Mod X, I would like to post a quick note on how we can help you resolve this. This post will be mirrored in the support forum.

For anyone using Windows, you may now leave the room.

As of AMX Mod X 0.16, there are two big problems that can cause these crashes:

One: Shield is not restricted (has to do with CSStats)
Two: CSStats is running

If these two options do not resolve your problem, it's time to get hardcore and run the GNU Debugger.

Situation 1: If you own and have root on the linux server - make sure you have GDB Installed.
Situation 2: If you rent a server and have shell access - check to see if "gdb" is a valid command. If not, try asking your provider to install it so you can see where crashes are happening.
Situation 3: You have a linux server, but no shell acces. Sorry, you're screwed. Try asking your provider for shell access so you can help the AMXx team.

For situations one and two - you have two options. One, you can give us access to the shell and let us do the debugging (assuming you feel you can trust us). If you would like to give the AMXx team permission to use debug binaries and GDB on your server, temporarily, PM me (BAILOPAN) (I don't know how many of the AMXx devs can use GDB).

For people who would like to try debugging it themselves - we don't distribute debug binaries YET (we may as of 0.20) so you must build them yourself. Follow these instructions:

1. Log into your server with PuTTy.
2. Download the AMX Mod X source code with these commands:
Code:
mkdir amxx
cd amxx
wget http://easynews.dl.sourceforge.net/sourceforge/amxmodx/amxmodx-0.16-source.tar.gz
tar zxvf amxmodx-0.16-source.tar.gz
wget http://www.tcwonline.org/cgi-bin/viewcvs.cgi/metamodx/metamodx.tar.gz?tarball=1
tar zxvf metamodx.tar.gz?tarball=1
3. Replace the AMXx core and modules Makefiles' CCOPT lines with this simple line:
CCOPT = -g
4. Do these lines. The binaries will build and will be in the "obj.linux/" folders inside the main folders. You may need to replace the "gcc=gcc-2.95" option in the Makefiles to "gcc=gcc".
Code:
cd amxmodx
make
cd ../fun
make
cd ../engine
make
cd ../cstrike
make
cd ../csstats
make
cd ../metamod
make
5. Copy the binaries into your HLDS installation.
6. Open the "hlds_run" script in hlds_l and copy down the export library line. Type that line directly as a shell command.
7. Type "gdb hlds_486" at the shell to load the debugger.
8. To start HLDS in the debug environment, type:
run +maxplayers 16 +map de_dust -game cstrike -port 27015 -debug
9. Do not exit the shell window.
10. Once HLDS crashes, the GNU Debugger will pop back up in the shell window. Type:
backtrace
11. Give us the backtrace output.
(Backtrace can also be typed as "bt" or "where").

These are general directions as no two linux installations are the same. If you experience a roadblock, feel free to post it here (idiotic/trollish things will be removed - these directions are for intermediate to experienced users).
__________________
egg
BAILOPAN is offline
rasvan
Member
Join Date: Mar 2004
Location: Bucharest
Old 04-28-2004 , 02:39   Makefile
Reply With Quote #2

I am missing:
cross-tools/i586-mingw32msvc

I have from the old amx,
cross-tools/i386-mingw32msvc

What to do.

Thank you
rasvan is offline
Send a message via Yahoo to rasvan
hondaman
Senior Member
Join Date: Mar 2004
Location: Dallas, Texas
Old 04-28-2004 , 02:45  
Reply With Quote #3

Quote:
As of AMX Mod X 0.16, there are two big problems that can cause these crashes:

One: Shield is not restricted (has to do with CSStats)
Two: CSStats is running

If these two options do not resolve your problem, it's time to get hardcore and run the GNU Debugger.
Does this mean that restriciting the shield and/or csstats running can both cause the crash? It was a bit unclear to me.

hondaman
www.hardgaming.com
hondaman is offline
BAILOPAN
Join Date: Jan 2004
Old 04-28-2004 , 02:54  
Reply With Quote #4

CSStats has problems handling the shield, so if the shield is not restricted, or if you're running CSStats at all with stats.amx especially, Bad Things Can Happen(TM).
__________________
egg
BAILOPAN is offline
Supernewbie
Junior Member
Join Date: Apr 2004
Old 04-28-2004 , 13:51   Re: Debugging on Linux
Reply With Quote #5

Quote:
Originally Posted by BAILOPAN
Since many people are reporting "segmentation faults" or crashes on a Linux HLDS installation with AMX Mod X, I would like to post a quick note on how we can help you resolve this. This post will be mirrored in the support forum.

For anyone using Windows, you may now leave the room.

As of AMX Mod X 0.16, there are two big problems that can cause these crashes:

One: Shield is not restricted (has to do with CSStats)
Two: CSStats is running

If these two options do not resolve your problem, it's time to get hardcore and run the GNU Debugger.

Situation 1: If you own and have root on the linux server - make sure you have GDB Installed.
Situation 2: If you rent a server and have shell access - check to see if "gdb" is a valid command. If not, try asking your provider to install it so you can see where crashes are happening.
Situation 3: You have a linux server, but no shell acces. Sorry, you're screwed. Try asking your provider for shell access so you can help the AMXx team.

For situations one and two - you have two options. One, you can give us access to the shell and let us do the debugging (assuming you feel you can trust us). If you would like to give the AMXx team permission to use debug binaries and GDB on your server, temporarily, PM me (BAILOPAN) (I don't know how many of the AMXx devs can use GDB).

For people who would like to try debugging it themselves - we don't distribute debug binaries YET (we may as of 0.20) so you must build them yourself. Follow these instructions:

1. Log into your server with PuTTy.
2. Download the AMX Mod X source code with these commands:
Code:
mkdir amxx
cd amxx
wget http://easynews.dl.sourceforge.net/sourceforge/amxmodx/amxmodx-0.16-source.tar.gz
tar zxvf amxmodx-0.16-source.tar.gz
wget http://www.tcwonline.org/cgi-bin/viewcvs.cgi/metamodx/metamodx.tar.gz?tarball=1
tar zxvf metamodx.tar.gz?tarball=1
3. Replace the AMXx core and modules Makefiles' CCOPT lines with this simple line:
CCOPT = -g
4. Do these lines. The binaries will build and will be in the "obj.linux/" folders inside the main folders. You may need to replace the "gcc=gcc-2.95" option in the Makefiles to "gcc=gcc".
Code:
cd amxmodx
make
cd ../fun
make
cd ../engine
make
cd ../cstrike
make
cd ../csstats
make
cd ../metamod
make
5. Copy the binaries into your HLDS installation.
6. Open the "hlds_run" script in hlds_l and copy down the export library line. Type that line directly as a shell command.
7. Type "gdb hlds_486" at the shell to load the debugger.
8. To start HLDS in the debug environment, type:
run +maxplayers 16 +map de_dust -game cstrike -port 27015 -debug
9. Do not exit the shell window.
10. Once HLDS crashes, the GNU Debugger will pop back up in the shell window. Type:
backtrace
11. Give us the backtrace output.
(Backtrace can also be typed as "bt" or "where").

These are general directions as no two linux installations are the same. If you experience a roadblock, feel free to post it here (idiotic/trollish things will be removed - these directions are for intermediate to experienced users).
Another Suggestion.
#1 Run hlds with the -debug flag.
#2 Run your server as per normal
#3 When server crash it shld create a file call core.XXXX [XXX are numbers]
#4 type gdb core.XXXX
#5 bt

that shld give u the result of the crash.

hope this helped.
Supernewbie is offline
BAILOPAN
Join Date: Jan 2004
Old 05-08-2004 , 21:53  
Reply With Quote #6

In reply to parent poster: many servers are set up not to generate core dumps (and sometimes hlds doesn't even generate debugging info properly), so that method might not always work.
__________________
egg
BAILOPAN is offline
MDMAchine
Junior Member
Join Date: Mar 2004
Location: Providence
Old 05-11-2004 , 13:49  
Reply With Quote #7

Hmm?

I have been geting crash problems ever since HLDS went to 1.6?
Are you positive that its AMXX, I always assumed that it was Metamod.
I wish I knew more about linux but since I have daily about 3 crashes+ I will attempt to get you all the proper information for helping me out :-)

I also noticed that the "mapchooser.amx" also can cause problems, resulting in crash.
If this is of any help.
__________________
DSR - http://www.directsoundradio.net
MD Music - http://www.soundclick.com/bands/9/mdmachinemusic.htm
http://www.directsoundradio.net/MD-MAchine
"To be what we are capable of becoming, is the only end to life."
MDMAchine is offline
Send a message via AIM to MDMAchine
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-12-2004 , 15:26  
Reply With Quote #8

sometimes It happens to me and I replace the .SO files and it works fine. e.g. I have a tar file with correct dir structure with all the .so files for all my plugin i.e. metamod amxx statsme etc in there and I just untar it and a lot of times it works fine, also the order in which things are listed in metamod.ini affects these crashes. I was getting a lot of crashes and I changed the order around a couple of times now I have had the server running for a while with no probs.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Gunny
Senior Member
Join Date: Mar 2004
Location: Magnolia, Texas
Old 05-17-2004 , 20:43  
Reply With Quote #9

BAILOPAN, Or Whoever
have you or the other coders gotten what you need from debugging a linux server?

If you still need some more help or Info, Pm me I have 5 different servers running on one Dual Xeon 2.4 running Debian gib 2.3
I might need to have you talk me through the debugging setup.
__________________
TEAM FORTRESS 2 - 70.85.30.25:27015
COUNTER-STRIKE SOURCE - 70.85.30.22:27015
COUNTER-STRIKE SOURCE DEATH MATCH - 70.85.30.23:27015
Gunny is offline
RJ45
New Member
Join Date: Jun 2004
Location: Winnipeg, Manitoba
Old 06-17-2004 , 16:11  
Reply With Quote #10

I was wondering if anybody is willing to do this for me, Im not really an expert when it comes to this kind of stuff. I will give you username and passwd for my linux box using putty.

Thanks!
RJ45 is offline
Send a message via AIM to RJ45 Send a message via MSN to RJ45
Reply



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 20:32.


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