Skip to content

Fix fatal crash unloading maps with custom localize assets (dedicated)#451

Open
srt4fun wants to merge 1 commit into
callofduty4x:masterfrom
srt4fun:fix/localize-entry-unload-fatal
Open

Fix fatal crash unloading maps with custom localize assets (dedicated)#451
srt4fun wants to merge 1 commit into
callofduty4x:masterfrom
srt4fun:fix/localize-entry-unload-fatal

Conversation

@srt4fun

@srt4fun srt4fun commented Jul 16, 2026

Copy link
Copy Markdown

On a dedicated server, unloading a fastfile that contains custom localized strings (ASSET_TYPE_LOCALIZE_ENTRY) fatally aborts:

Sys_Error: Could not load default asset for asset type ''

DB_UnloadXZoneInternal creates default stubs for the zone's assets, but the default for LOCALIZE_ENTRY is "CGAME_UNKNOWN", which ships only in the client localizedstrings zones a dedicated server never loads. DB_FindXAssetDefault- HeaderInternal returns NULL and the server dies. A client/listen server (and stock iw3) loads CGAME_UNKNOWN and unloads the same map cleanly; only maps that bake their own localize entries reach this path.

Skip the missing-default fatal for LOCALIZE_ENTRY. Freeing it without a stub is safe: localized strings are resolved by name at display time and never held by pointer, the same reasoning that already leaves RAWFILE / MAP_ENTS without a default.

(db_xassetdebug 1 names the culprit: the last "removing asset" line before the abort is the localize entry with no "using default" follow-up.)

Map that caused the crash was "mp_luna2".

On a dedicated server, unloading a fastfile that contains custom localized
strings (ASSET_TYPE_LOCALIZE_ENTRY) fatally aborts:

    Sys_Error: Could not load default asset for asset type ''

DB_UnloadXZoneInternal creates default stubs for the zone's assets, but the
default for LOCALIZE_ENTRY is "CGAME_UNKNOWN", which ships only in the client
localizedstrings zones a dedicated server never loads. DB_FindXAssetDefault-
HeaderInternal returns NULL and the server dies. A client/listen server (and
stock iw3) loads CGAME_UNKNOWN and unloads the same map cleanly; only maps
that bake their own localize entries reach this path.

Skip the missing-default fatal for LOCALIZE_ENTRY. Freeing it without a stub
is safe: localized strings are resolved by name at display time and never
held by pointer, the same reasoning that already leaves RAWFILE / MAP_ENTS
without a default.

(db_xassetdebug 1 names the culprit: the last "removing asset" line before
the abort is the localize entry with no "using default" follow-up.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant