What happened?
When connected to HLTV (live or demo playback from it), the GoldSrc client intermittently crashes during entity linking with:
Sys_Error: Bad model on beam ( not sprite )
* This issue does not reproduce in direct server connection, only when client connected to HLTV or playing back HLTV recorded demo.
The root cause appears to be "entity state desynchronization in HLTV delta compression/decompression", causing a BEAM entity (ENTITY_BEAM) to reference a non-sprite model (e.g. models/v_tripmine.mdl).
Example observed state:
ent->prevstate.modelindex = 76
cl.model_precache[76].name = "sprites/laserbeam.spr"
ent->curstate.modelindex = 57
cl.model_precache[57].name = "models/v_tripmine.mdl"
ent->prevstate.entityType = 2 (ENTITY_BEAM)
ent->curstate.entityType = 2 (ENTITY_BEAM)
ent->baseline.entityType = 1 (ENTITY_NORMAL)
In this state, the entity appears to retain beam classification while its model changes from a sprite to a studio model. GoldSrc expects beam entities to reference sprite models, so this invalid combination triggers the Sys_Error on the client.
The gdb backtrace shows the crash manifesting in CL_LinkCustomEntity at ../engine/cl_ents.c:1422, but that's just where the invalid state finally gets checked and rejected, it's the symptom, not the actual cause. The bad data was assembled earlier, likely upstream in the delta/baseline reconstruction and simply carried forward through packet/entity state structures until the client validated the beam model and aborted.
The issue most likely lies within HLTV entity state handling, especially delta compression or decompression somewhere in:
|
// Insert new the entity to frame |
|
|
|
entity[newindex].entityType = custom ? ENTITY_BEAM : ENTITY_NORMAL; |
|
|
|
delta_t *delta = GetDeltaEncoder(newnum, custom); |
|
m_Delta.ParseDelta(stream, (byte *)&deltaEntity[oldindex], (byte *)&entity[newindex], delta); |
|
|
|
entity[newindex].number = newnum; |
|
newindex++; |
|
oldindex++; |
Environment
[OS]
- Lubuntu 26.04 LTS
[HLDS Base]
- Protocol version 48
- Exe version 1.1.2.2/Stdio (valve)
- Exe build: 19:52:19 Aug 3 2020 (8684)
[ReHLDS]
- Protocol version 48
- Exe version 1.1.2.2/Stdio (valve)
- ReHLDS version: 3.15.0.898-dev
- Build date: 01:14:53 Jun 11 2026 (4443)
- Build from: https://github.com/rehlds/ReHLDS/commit/0124d56
Relevant log output
#0 0xf663364b in ?? () from target:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6
#1 0xf662682c in ?? () from target:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6
#2 0xf66268c9 in ?? () from target:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6
#3 0xf66a59b3 in __wait4_time64 () from target:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6
#4 0xf66a5b2a in waitpid () from target:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/libc.so.6
#5 0xf2eb111e in ?? () from target:/lib/i386-linux-gnu/libSDL2-2.0.so.0
#6 0xf2e85a66 in ?? () from target:/lib/i386-linux-gnu/libSDL2-2.0.so.0
#7 0xf2e85b7a in ?? () from target:/lib/i386-linux-gnu/libSDL2-2.0.so.0
#8 0xf34b6840 in Sys_Error (error=error@entry=0xf363544c "Bad model on beam ( not sprite ) ") at ../engine/sys_dll.c:582
#9 0xf3506fe5 in CL_LinkCustomEntity (state=0xa81ff40, ent=0xbec161f8) at ../engine/cl_ents.c:1422
#10 CL_LinkPacketEntities () at ../engine/cl_ents.c:1597
#11 0xf3508be3 in CL_EmitEntities () at ../engine/cl_ents.c:2348
#12 0xf348b038 in _Host_Frame (time=time@entry=3.09979987e-05) at ../engine/host.c:1468
#13 0xf348b2a8 in Host_Frame (time=3.09979987e-05, iState=1, stateInfo=stateInfo@entry=0xff89c5dc) at ../engine/host.c:1549
#14 0xf34bc404 in CEngine::Frame (this=0xf371ef40 <g_Engine>) at ../engine/sys_engine.cpp:245
#15 0xf34b9464 in RunListenServer (instance=0x0, basedir=0x804d120 <szBaseDir> "/home/user/.steam/debian-installation/steamapps/common/Half-Life",
cmdline=0x8ffeda0 "/home/user/.steam/debian-installation/steamapps/common/Half-Life/hl_linux -steam -dev -debug -noipx -nojoy -nohdmodels -noontop -noforcemparms -nofbo -novid -insecure", postRestartCmdLineArgs=0x804f260 <main::szNewCommandParams> "",
launcherFactory=0x80497f0 <CreateInterface(char const*, int*)>, filesystemFactory=0xf47bf450 <CreateInterface(char const*, int*)>)
at ../engine/sys_dll2.cpp:968
#16 0x0804905b in main (argc=12, argv=0xff89c854) at ../launcher/launcher.cpp:469
What happened?
When connected to HLTV (live or demo playback from it), the GoldSrc client intermittently crashes during entity linking with:
* This issue does not reproduce in direct server connection, only when client connected to HLTV or playing back HLTV recorded demo.
The root cause appears to be "entity state desynchronization in HLTV delta compression/decompression", causing a BEAM entity (
ENTITY_BEAM) to reference a non-sprite model (e.g.models/v_tripmine.mdl).Example observed state:
In this state, the entity appears to retain beam classification while its model changes from a sprite to a studio model. GoldSrc expects beam entities to reference sprite models, so this invalid combination triggers the Sys_Error on the client.
The gdb backtrace shows the crash manifesting in
CL_LinkCustomEntityat../engine/cl_ents.c:1422, but that's just where the invalid state finally gets checked and rejected, it's the symptom, not the actual cause. The bad data was assembled earlier, likely upstream in the delta/baseline reconstruction and simply carried forward through packet/entity state structures until the client validated the beam model and aborted.The issue most likely lies within HLTV entity state handling, especially delta compression or decompression somewhere in:
ReHLDS/rehlds/HLTV/Core/src/World.cpp
Lines 1547 to 1556 in 0124d56
Environment
Relevant log output