OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

Client crash when connecting to server that spawned too many different types of npcs

Open Caelish opened this issue 8 years ago • 3 comments

Operating system and version: Pretty sure it's OS agnostic, but can reliably reproduce on Windows client (with any OS version) at least.

Is this for single player or multiplayer? Multiplayer

Description of the bug (and if possible, steps to reproduce the bug): This bug is as old as the internet, but still seems like a good idea to address: when spawning more than 16 different types of npcs on one map (not too many npcs contrary to popular belief - too many npc types), without changing to a different map in between, all clients crash, and reconnecting to the server will also cause an instant client crash.

To reproduce, simply keep spawning different types of npcs until the OpenJK client crashes. This affects non-OpenJK clients too. The bug occurs even if all npcs are killed.

What did you expect to happen instead? The OpenJK client should not crash and should enter the game normally even if >16 npc types have been spawned.

Caelish avatar Mar 24 '16 21:03 Caelish

Exactly 16 types means its related to hardcoded cap of 16 G2 gore things I think.

ensiform avatar Mar 24 '16 23:03 ensiform

Can confirm, spawning too many NPCs will cause the game to crash (at some point). In debug build it hits an assert. In release, I imagine it's reading/writing outside the bounds of the bgAllEvents array in bg_panimate.c. Stack trace:

    msvcr120d.dll!_wassert(const wchar_t * expr=0x1022a4a0, const wchar_t * filename=0x1022a3e8, unsigned int lineno=2155) Line 369 C
>   cgamex86.dll!BG_ParseAnimationEvtFile(const char * as_filename=0x0018f6d4, int animFileIndex=0, int eventFileIndex=16) Line 2155    C
    cgamex86.dll!CG_G2AnimEntModelLoad(centity_s * cent=0x109af49c) Line 7303   C
    cgamex86.dll!CG_G2Animated(centity_s * cent=0x109af49c) Line 7512   C
    cgamex86.dll!CG_AddCEntity(centity_s * cent=0x109af49c) Line 3382   C
    cgamex86.dll!CG_AddPacketEntities(qboolean_e isPortal=qfalse) Line 3516 C
    cgamex86.dll!CG_DrawActiveFrame(int serverTime=634442, int stereoView=0, qboolean_e demoPlayback=qfalse) Line 2639  C

xycaleth avatar Mar 27 '16 19:03 xycaleth

I can get the assert to happen but not the crash in debug.

ensiform avatar Oct 11 '16 04:10 ensiform