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

[Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
konichiwa
New Member
Join Date: Sep 2010
Location: For those who want to re
Old 02-11-2011 , 15:34   [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #1

Im not really sure if this thread is suited for this forum. If not, kindly move this thread to where it belongs. This is the script I wrote to keep me sane while figuring out server crash. I figured some might find this useful.

This guide is specific to Linux hlds only, so all Windows users can leave now.

Content is rated advanced, if you read through the guide and still seeing stars, Id advise you to seek help from your nearest linux guru available.

A couple of things to keep in mind before you start:-

1. Not all crash is caused by Amxmodx or its plugins. Hlds is pretty much a hackjob consisting spaghetti of stray pointers. Something is bound to go wrong somewhere. :/
2. Debug build of Amxmodx and modules required. See here. Otherwise, you wont see the fancy function signature and source code snippets.
3. Core dump required. See here. Optional if you attach gdb to hlds directly.

How do you tell if its caused by Amxmodx plugins? For example, if you see amx_Xxx related functions in your backtrace, then there is a good chance it's caused by Amxmodx plugin.

PHP Code:
#0  0xb4756212 in get_pdata_int (amx=0x9312570, params=0x8bee910) at pdata.cpp:42
#1  0xb49d985a in amx_Callback (amx=0x9312570, index=166, result=0xbfb2be50, params=0x8bee910) at amx.cpp:474
#2  0xb49f3dd0 in JIT_OP_SYSREQ () from /home/game/hlds_zpm/cstrike/addons/amxmodx/dlls/amxmodx_mm_i386.so
#3  0xbfb2be50 in ?? () 
In this below example, it has nothing to do with Amxmodx at all.

PHP Code:
(gdbbt
#0  0xb50df7f3 in main_hook_function(class_ret_t, unsigned int, enum_api_t, unsigned int, void const*) ()
   
from ./cstrike/addons/metamod/dlls/metamod_i386.so
#1  0xbfef3dd0 in SV_ParseStringCommand() from ./engine_i686.so
#2  0xbfb2be50 in ?? () 
Now if you are certain that crash is caused by Amxmodx plugin, upload the attached gdb script to your server. Fire up gdb with the coredump and source the script file. After that, run 'amx_analyze' command and it will helpfully tell you who to blame.

PHP Code:
(gdbsource /home/game/scripts/analyze.gdb
Available commands 
(AmxModX-related):
    
amx_analyze:       Analyze the dump and try to figure out which AmxModX plugin caused it
    amx_listplugins
:   List all loaded AmxModX plugins
    amx_listplayers
:   List all players as seen by AmxModX
Available commands 
(metamod-related):
    
meta_analyze:      Analyze the dump and try to figure out which metamod plugin caused it
Available commands 
(generic):
    
cmd_args:          Dump the cmd string

If you have no idea where to startjust type '*_analyze' and let it figure out for you
(gdbamx_analyze
Crash is most likely caused by
cstrike/addons/amxmodx/plugins/zombie_plague/zombie_plague43.amxx 
The script contains few other commands too. I didnt bother explaining them here because they were either damn obvious or wasnt really useful at all.

Enjoy debugging.
Attached Files
File Type: zip analyze.zip (1.1 KB, 565 views)
konichiwa is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 06-09-2011 , 05:25   Re: [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #2

Can You explain a bit more hot to 'install' analyze.gdb script ?
dFF is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 06-09-2011 , 10:44   Re: [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #3

For debian simply as root:
Code:
aptitude install gdb
__________________

Mordekay is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 06-09-2011 , 11:26   Re: [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #4

I installed the GDB, now how to attach the script (analyze.gdb) on my server, and how to used the command amx_analyze , where to used ? In putty or in HLDS console ?
dFF is offline
Old 06-11-2011, 08:54
dFF
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
zeus
Senior Member
Join Date: Jul 2008
Old 08-06-2011 , 13:56   Re: [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #5

When I type amx_analyze I get this
Code:
(gdb) amx_analyze
No symbol "amx" in current context.
zeus is offline
tulga
Junior Member
Join Date: May 2010
Old 11-04-2012 , 02:50   Re: [Guide] How to find out which Amxmodx plugin causing server crash (linux hlds)
Reply With Quote #6

Quote:
Originally Posted by zeus View Post
When I type amx_analyze I get this
Code:
(gdb) amx_analyze
No symbol "amx" in current context.
I have same problem.
hlds 5787 (ubuntu 10.04 server edition)
tulga is offline
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 11:08.


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