How to fix an HLDS segmentation fault on a CS 1.6 server
A segmentation fault means the server crashed, most often inside a Metamod plugin, an AMX Mod X module or a plugin. How to get a backtrace, read it and fix the cause.
- Audience
- For experienced admins
- Last checked
- Steps
- 8
- Reading time
- 5 min
- On Hostsrc
- Includes the steps for a Hostsrc server
A segmentation fault means the server process tried to use memory it shouldn't, and Linux stopped it. On HLDS and ReHLDS the console shows lines like these, and hlds_run starts the server again 10 seconds later. The line number depends on your copy of hlds_run.
./hlds_run: line 275: 12345 Segmentation fault $HL_CMDAdd "-debug" to the ./hlds_run command line to generate a debug.log to help with solving this problemSat Oct 24 18:02:11 UTC 2026: Server restart in 10 secondsThe crash is rarely in the engine itself. Most come from something loaded into it: a Metamod plugin, an AMX Mod X module or plugin, or files built for another engine or game version. Find which one with a backtrace and the logs, then update, fix or remove it.
On Hostsrc
New servers install with xHLDS. On a crash it writes a crash report and one console line with what crashed, the map and the uptime, then restarts as before. Step 8 covers the report.
Before you start
- Access to the server's console and files.
- On your own Linux server, for a backtrace:
gdbinstalled, and core files allowed in the shell that starts the server (ulimit -c unlimited).
Steps
Step 2: Read the last lines before the crash
Read the end of the console output and the newest logs. The server's own logs are in
cstrike/logs/. AMX Mod X writes its errors tocstrike/addons/amxmodx/logs/error_YYYYMMDD.log, one file a day, such aserror_20261024.log.The last plugin, map or file named before the crash is the first suspect.
Step 3: Get a backtrace
A backtrace lists the functions the server was in when it crashed, with the file each one belongs to. On your own Linux server, add
-debugto thehlds_runline. After the next crash,hlds_runrunsgdbon the core file and writes the backtrace todebug.login the server folder.hlds_runonly finds a core file namedcore,core.<pid>orhlds_linux.corein the server folder. Many Linux systems send core files tosystemd-coredumpinstead. Then open the last one withcoredumpctl gdband typebt.Shell ulimit -c unlimited./hlds_run -game cstrike -debug +maxplayers 32 +map de_dust2Step 4: Read which file crashed
Start at the top of the backtrace. Skip system libraries such as
libc.so.6andlibstdc++.so.6, and look at the first line that names a server file. The table What the backtrace names, below the steps, says what each file means.A crash inside
amxmodx_mm_i386.sois usually a plugin, not AMX Mod X itself. The plugin crash guide shows how to find which one.Step 5: Check the Metamod plugins
Type
meta listin the server console. Every plugin should showRUN. A plugin that failed to load, or one you don't recognise, is a suspect.Some Metamod plugins must sit at a set place in
addons/metamod/plugins.ini, and their readme says where. To test one, put;in front of its line and restart the server.cstrike/addons/metamod/plugins.ini linux addons/amxmodx/dlls/amxmodx_mm_i386.so; linux addons/example/example_mm_i386.soStep 6: Check that everything matches your engine
Modules and Metamod plugins are built for a certain engine and game library. ReAPI and Metamod-R need ReHLDS. ReHLDS needs the pre-anniversary HLDS from SteamCMD's
steam_legacybranch. After you update any of these, update the others to versions that match.Run
versionin the server console to see the engine and its version. A module built for a newer engine than yours can crash the server as soon as it loads.Step 7: Turn plugins off by halves
If the backtrace points at AMX Mod X, put
;in front of half the custom plugins inplugins.ini, change the map and wait as long as a crash usually takes. If the crashes stop, the plugin is in the half you turned off; if not, it is in the other half. Repeat with that half until one plugin is left.cstrike/addons/amxmodx/configs/plugins.ini ; Custom plugins, half turned off for the testplugin_one.amxxplugin_two.amxx;plugin_three.amxx;plugin_four.amxxStep 8: On xHLDS: read the crash report
On a crash, xHLDS writes a crash report and one console line: what crashed, the map and the uptime. After the restart, the report goes to Hostsrc's crash service at crash.hostsrc.com. On Hostsrc's network that always happens. Elsewhere it happens only when
xhlds_crash_ownerlists your SteamID64 inserver.cfg. Without it, nothing leaves the machine.The crash page says where the crash happened, such as xHLDS, the game, Metamod, AMX Mod X, a plugin or module, Steam or a system library, and what to do. AMX Mod X plugins are named. Signing in to the crash service is open to invited beta testers for now.
cstrike/server.cfg xhlds_crash_owner "76561198000000001"
What the backtrace names
| File in the backtrace | What crashed | What to do |
|---|---|---|
amxmodx_mm_i386.so | AMX Mod X, most often while running a plugin | Find the plugin: error log, debug mode, turning plugins off by halves |
<name>_amxx_i386.so | An AMX Mod X module, such as hamsandwich_amxx_i386.so | Update the module, or the plugin that calls it |
metamod.so or metamod_i386.so | Metamod, or a Metamod plugin through it | meta list, then test plugins one by one |
<name>_mm_i386.so | A Metamod plugin | Update it or turn it off in addons/metamod/plugins.ini |
cs.so | The game library, Counter-Strike or ReGameDLL_CS | Check it matches your engine. A plugin may be calling it wrongly |
engine_i486.so | The engine | Update to the newest release of your engine, then report it to that project with the backtrace |
libc.so.6 and other system libraries only | A system library, called from a line further down | Read down to the first server file |
Troubleshooting
The console says "Killed", not "Segmentation fault"
The system stopped the server, usually because it ran out of memory. A plugin that keeps allocating memory grows until it reaches the limit. Watch the server's memory use over a few maps. On Hostsrc every plan has 2 GB RAM, and more is an add-on (+512 MB for €1/month).
"error while loading shared libraries" at start-up
A system library is missing, and the server never starts. HLDS is a 32-bit program, so a 64-bit Linux system needs the 32-bit libraries, such as lib32gcc-s1 on Debian and Ubuntu. Install the package that provides the file the line names.
It crashes only on one map
The map may be damaged, or need files the server doesn't have. Take it out of mapcycle.txt, then load it alone with changelevel on an empty server. On ReHLDS and xHLDS, rescount shows how close the map's files are to the engine's precache limits.
Links
- Debugging Plugins (AMX Mod X) (external site, opens in a new tab)
AlliedModders wiki, debug mode and plugin errors
- ReHLDS on GitHub (external site, opens in a new tab)
releases, and where to report engine crashes in ReHLDS
- xHLDS
our ReHLDS fork, with crash reports that name what crashed
- xHLDS settings
`xhlds_crash_owner` and what a crash report sends
Counter-Strike 1.6 server hosting
From €5.99/month for 14 players
Frankfurt or Bucharest. Final price, no VAT added.
Build my serverStart a paid test from €1.99Discord
Ask other admins and our team.
Join our Discord (external site, opens in a new tab)Related guides
Which AMX Mod X plugin crashed my server?
A backtrace names AMX Mod X, not the plugin. Find the plugin with the error log, debug mode and turning plugins off by halves. On xHLDS, the crash page names it.
7 steps3 min readFor experienced adminsOn Hostsrc
How to install an AMX Mod X plugin on a CS 1.6 server
Copy the .amxx file into the plugins folder, list it in plugins.ini and change the map. Covers extra files, modules and fixes for "bad load".
7 steps4 min readOn Hostsrc
ReHLDS vs HLDS: what changes on a CS 1.6 server
ReHLDS is a rebuild of Valve's HLDS engine, with defects fixed and an extended plugin API, under the MIT licence. Configs and AMX Mod X stay the same. Where xHLDS fits.
6 steps3 min readOn Hostsrc
CS 1.6 server commands and how to use RCON
Set rcon_password in server.cfg and send commands with rcon from your game console. Lists the server and AMX Mod X commands admins use, with their syntax.
5 steps5 min readOn Hostsrc