---
title: "Fix: Server Crashes with a Segfault on Map Change"
excerpt: "A CS 1.6 server boots fine but segfaults on changelevel. The real causes — a stale delta.lst, precache overflow, bad plugins, missing map assets — and how to pin the exact one."
category: "errors"
tags: "segfault, mapchange"
image: ""
read_time: "8 min read"
---
<p>A crash on map change is a distinct and more interesting bug than a startup crash: the server boots, plays a full round, and then dies exactly at <code>changelevel</code> or when the round ends and rotation kicks in. Because it only triggers during the level transition, the causes are specific — the state carried across the boundary, the resources the next map precaches, and plugins that hook the transition. Here is how to find yours.</p>
<h2>1. Confirm it is the transition, not the next map</h2>
<p>First separate "crashes when leaving any map" from "crashes when loading one specific map". Force changes manually:</p>
<pre>changelevel de_dust2
changelevel de_inferno
changelevel cs_assault</pre>
<ul>
<li><strong>Crashes only when loading one map</strong> → that map's assets or precache are the problem (section 4).</li>
<li><strong>Crashes leaving any map</strong> → it is state or a plugin at the transition (sections 2–3).</li>
</ul>
<h2>2. Stale or mismatched delta.lst</h2>
<p>If you run <a href="/tutorials/install-regamedll-cs16">ReGameDLL</a>, the number-one cause of transition and connect crashes is a <code>delta.lst</code> that does not match the game DLL. It defines how entity state is serialised across the network and across level changes; a stale one corrupts state at exactly these boundaries. Copy the <code>delta.lst</code> that shipped with your ReGameDLL build over the top:</p>
<pre>cp /path/to/regamedll-release/cstrike/delta.lst /home/steam/hlds/cstrike/delta.lst</pre>
<p>Restart and re-test the map change. This single file fixes a large share of "random crash on map change" reports.</p>
<h2>3. A plugin hooking the transition</h2>
<p>Plugins that run on round end, intermission, or map change (map-vote, stats-save, end-of-map handlers) are prime suspects because they only execute at the boundary. Watch the log through a crash:</p>
<pre>tail -f /home/steam/hlds/cstrike/addons/amxmodx/logs/*.log</pre>
<p>The last plugin to log before the crash is your first suspect. Disable third-party plugins in AMXX's <code>plugins.ini</code>, confirm map changes are clean, then re-enable in batches until it crashes again — see <a href="/tutorials/install-amxx-plugin-files">managing plugins</a>. A stats plugin doing a database write at map end can also crash on a dropped SQL connection; check the module's log too.</p>
<h2>4. Precache overflow on the incoming map</h2>
<p>CS 1.6 has hard limits on precached models, sounds and generic resources. A map plus your plugins' custom models and sounds can exceed them, and the overflow surfaces as a crash while loading that map. The tell-tale log line is a precache error or:</p>
<pre>Host_Error: PF_precache_*: overflow</pre>
<p>Reduce what is precached: trim plugin-added models/sounds, or move rarely-used content behind on-demand precache. Maps that reference many external assets are the usual trigger — see <a href="/tutorials/install-custom-maps-cs16-server">adding custom content</a> for what a map pulls in.</p>
<h2>5. Missing assets on the target map</h2>
<p>A map whose models or sounds are absent from the server can fault as it precaches them. If section 1 pointed at one specific map, verify its assets are all present:</p>
<pre>Host_Error: PF_precache_sound_I: '...' failed to load</pre>
<p>Copy the map's complete asset set (<code>sound/</code>, <code>models/</code>, WADs). A map that loads standalone but crashes only in rotation is usually this plus precache pressure from plugins that a fresh boot did not have.</p>
<h2>6. Engine/game DLL mismatch</h2>
<p>If nothing above holds, a mismatched <a href="/tutorials/install-rehlds-on-linux">ReHLDS</a>/ReGameDLL pair can be stable mid-round and crash on transition. Update both to the same-era releases and confirm:</p>
<pre>rehlds_version
regamedll_version</pre>
<h2>Common errors</h2>
<ul>
<li><strong>Segfault on every <code>changelevel</code>, no useful log</strong> — stale <code>delta.lst</code>. Copy the matching one first.</li>
<li><strong><code>Host_Error: PF_precache_* overflow</code></strong> — too many precached resources; trim plugin/map content.</li>
<li><strong>Crash right after a map-vote or stats plugin logs</strong> — that plugin. Bisect the plugin list.</li>
<li><strong>Crashes loading one map only</strong> — that map's assets are missing or it precaches too much.</li>
</ul>
<h2>Verification</h2>
<p>Prove the fix under the exact condition that failed. Run several forced changes across different maps back to back:</p>
<pre>changelevel de_dust2
changelevel de_nuke
changelevel de_dust2</pre>
<p>Each must complete without a <code>Host_Error</code> or segfault. Then let the server rotate naturally through a full <code>mapcycle.txt</code> with players (or bots) connected — the natural end-of-round transition is where a plugin-driven crash hides that a manual <code>changelevel</code> can miss. If the server cycles through the whole rotation with players on it and no crash, the map-change fault is fixed. A startup-time crash instead points back to <a href="/tutorials/fix-hlds-segfault-startup">the startup segfault guide</a>.</p>
<h2>Why map change specifically</h2>
<p>It helps to understand why this boundary is special, because it tells you where to look first. A level change is the one moment the engine tears down the entire entity world and rebuilds it: it serialises surviving state, unloads the map, precaches every resource the next map and every plugin ask for, and reconstructs entities from the delta definitions. Three of those steps are exactly where the common causes live — serialisation reads <code>delta.lst</code>, precache hits the resource limits, and plugin end-of-map handlers fire in between. That is why a server can be rock-solid for an entire round and die at the seam. It also explains the ordering of this guide: check <code>delta.lst</code> first because it is both the most common cause and the cheapest to fix, then precache, then plugins, because that is the order the engine actually exercises them during the transition. Fix the delta list, keep precache under its limits, and keep transition-time plugins honest, and map changes stop being the thing you hold your breath through.</p>