Limit PDB discovery to client binary directories - #5097
Open
HeresHavi wants to merge 3 commits into
Open
Conversation
Contributor
|
Is Bin/mods/deathmatch intentionally excluded? Client Deathmatch also outputs its PDB there |
Contributor
Author
Not intentional. I just missed adding it back. The original issue was that it also descended into "mods/deathmatch/resources" which we don't want. |
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.
Summary
Limited crash handler PDB discovery to the two directories where client binaries and their symbols are actually placed:
MTAbinary directoryPreviously, PDB discovery recursively scanned the entire installation. This included
mods/deathmatch/resourcesand every cached client resource, even though these directories do not normally contain client PDBs.The new discovery helper checks only the known binary directories without entering nested folders. Regression tests verify that PDBs beside client binaries are detected while PDBs in resources and other nested directories are ignored.
Motivation
Crash handler initialization runs synchronously during client startup.
CrashHandler::GetPdbDirectoriesstarted a recursive filesystem traversal fromSharedUtil::GetMTAProcessBaseDir, which covers the complete MTA installation.This means a large client resource cache adds filesystem work before the frontend appears. While this scan is running, the launcher can interpret the lack of visible startup progress as GTA being stuck and show the incorrect “GTA: San Andreas may not have launched correctly” warning described in #5096.
The amount of work scales mainly with the number of filesystem entries rather than their total size. Antivirus scanning, slower storage, or an uncached filesystem can make the same traversal considerably more expensive.
Client PDBs produced by the normal build are placed beside the launcher or directly inside
MTA. Restricting discovery to those locations preserves local symbol support without scanning unrelated content.This means PDBs placed in arbitrary nested directories are no longer discovered. That is intentional: nested resource and content directories are not part of the client binary layout and should not affect startup time.
Fixes #5096.
Profiling results
Created a resource test folder containing:
Filesystem traversal results with the same dataset:
The fixed traversal completed below the benchmark timer's one millisecond resolution.
This machine has a fast NVMe drive, so the original traversal did not reach the launcher watchdog timeout and the incorrect-launch dialog itself was not reproduced. The test did confirm that the old implementation entered the complete resource tree and that the fixed implementation does not.
Client launch validation:
L3 closedafter 14,060 ms.CreateDevice successafter 6,277 ms and did not show the incorrect-launch warning.The launch checks used different builds and milestones, so they are startup validation rather than a direct percentage comparison.
Test plan
Runtime
CreateDevice successafter 6,277 ms, and PDB discovery inspected only 74 entries in the two binary directories.MTA. Both directories were detected.mods/deathmatch/resourcesand a nested directory underMTA. Neither directory was returned by PDB discovery.Builds and Tests
Debug | Win32: Full build passed, 306 client tests passed (304 existing tests and 2 new regression tests).Release | Win32: Full build passed.Debug | x64: Full build passed.Release | x64: Full build passed.clang-format.Checklist