The Bug
The server is configured with a strict 30-minute SavePeriod. It never survives longer than 24 hours (approx. 48 save cycles). Whenever the crash occurs, it happens exactly ~1 second before the 30-minute save trigger executes. It never crashes at any other time outside of this pre-save window.
Environment & Constraints
- OS: Windows Server 2022 (64-bit)
- Sphere Version: Latest Source-X
dev branch
- Threading: Strictly single-threaded (
NetworkThreads=0). NetworkThreads=1 causes immediate, severe, and continuous crashes in my environment and is completely unusable.
- Load: Early-stage server with single-digit player count.
- Scripts:
[FUNCTION f_onserver_save] is completely empty. No custom scripts interfere.
Critical Facts
- Strictly Tied to Save Cycle: The crash is exclusively bound to the 30-min save timer. If I change the
SavePeriod, the crash timing shifts accordingly. It is 100% deterministic relative to the save trigger, but intermittent across save cycles (sometimes survives a few cycles, never exceeds 24h).
- No Script Interference: The empty save trigger and low player count completely rule out script logic errors or high-load/OOM issues.
The Log
CRITICAL:ExcType=std::exception catched in SUB: CWorldTicker::Update main list() ("")
CRITICAL:exception.what(): vector too long
Immediately followed by a hard crash as CWorld::Save() begins.
What I Have Tried (Failed)
I patched src/game/CWorld.cpp locally (nullifying UID slots before delete in GC, adding re-entrancy guards in Save()). General stability improved, but this specific pre-save crash persists. I lack the engine-level expertise to trace the state-dependent memory corruption happening right before the save executes in single-threaded mode.
Request for Maintainers
Given that NetworkThreads=1 is not an option for me, and this crash is strictly locked to the pre-save window of a 30-min cycle in a low-load single-threaded environment on Windows Server 2022 x64:
- What specific single-threaded code path executed right before
CWorld::Save() could accumulate stale state over multiple save cycles and corrupt CWorldTicker's vector?
- Are there any single-thread safe ini flags or workarounds to bypass this pre-save state transition?
The Bug
The server is configured with a strict 30-minute
SavePeriod. It never survives longer than 24 hours (approx. 48 save cycles). Whenever the crash occurs, it happens exactly ~1 second before the 30-minute save trigger executes. It never crashes at any other time outside of this pre-save window.Environment & Constraints
devbranchNetworkThreads=0).NetworkThreads=1causes immediate, severe, and continuous crashes in my environment and is completely unusable.[FUNCTION f_onserver_save]is completely empty. No custom scripts interfere.Critical Facts
SavePeriod, the crash timing shifts accordingly. It is 100% deterministic relative to the save trigger, but intermittent across save cycles (sometimes survives a few cycles, never exceeds 24h).The Log
Immediately followed by a hard crash as
CWorld::Save()begins.What I Have Tried (Failed)
I patched
src/game/CWorld.cpplocally (nullifying UID slots beforedeletein GC, adding re-entrancy guards inSave()). General stability improved, but this specific pre-save crash persists. I lack the engine-level expertise to trace the state-dependent memory corruption happening right before the save executes in single-threaded mode.Request for Maintainers
Given that
NetworkThreads=1is not an option for me, and this crash is strictly locked to the pre-save window of a 30-min cycle in a low-load single-threaded environment on Windows Server 2022 x64:CWorld::Save()could accumulate stale state over multiple save cycles and corruptCWorldTicker's vector?