Fix fatal crash unloading maps with custom localize assets (dedicated)#451
Open
srt4fun wants to merge 1 commit into
Open
Fix fatal crash unloading maps with custom localize assets (dedicated)#451srt4fun wants to merge 1 commit into
srt4fun wants to merge 1 commit into
Conversation
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.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a dedicated server, unloading a fastfile that contains custom localized strings (ASSET_TYPE_LOCALIZE_ENTRY) fatally aborts:
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".