Repository navigation
PE loader: load system DLLs by path as given and do not cache failures - #1151
Conversation
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Rerun on the new head
Same machine, debug. The report below is for NVIDIA run with the whole suite, since Not tested lists NVIDIA. Tested
Not tested
AI use
|
|
Rerun at Tested
Regression run main: this PR ( Under Wine, Not tested
AI use
|
system_module cached host module handles in SYS_CACHE keyed by dll_key,
which drops the directory, and it cached failures (0) too. So after
LoadLibrary("C:\Missing\foo.dll") failed, a later LoadLibrary("foo.dll")
returned NULL without trying, and once version.dll was cached,
LoadLibrary("C:\Mods\version.dll") returned the System32 copy. Windows
loads the path it is given.
A name with a directory component is now loaded as given with
LoadLibraryW and not cached; bare names (import resolution, the HLE
modules' system_module("x.dll") calls) still use the name-keyed cache,
which now only holds successful loads.
Under Wine, a copy of version.dll is a Wine builtin and is mapped to the
module already loaded under that name whatever path is given, so the test
checks the load by path only on Windows (found in a test run under Wine).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eecffed to
5157a51
Compare
|
Thanks @JoaoPauluu. Pushed 5157a51: AI-assisted (Claude Code, Claude Opus 5.5). |
pvfreis
left a comment
There was a problem hiding this comment.
Review of 5157a51 (merge base 47efa2e), by reading the code; nothing was built or run here. I checked system_module (resolver.rs:64-80) against its callers and that both new tests fail on the old code. No defect found.
Question for the author: a bare name that fails is no longer cached, so for a DLL that is not on the PC each import of it (resolver.rs:258) and each resolve_hle fallback lookup (resolver.rs:139, also reached from the title's GetProcAddress) runs a full failing LoadLibraryW search. Did you compare startup on a title that imports from such a DLL?
Review by Claude Code (written by Claude Opus 5.5, second read by Claude Fable 5.2); each point checked by a person before posting.
|
@pvfreis No, I had not measured it. Measured now, on Windows 11 Pro 26300 with a Ryzen 5 5600:
Written with Claude Code (Claude Opus 5.5); the measurement is mine. |
Native Windows resolver test report for PR #1151 at
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…pstream xcl-dev#1218 + xcl-dev#1151, resolver verbatim reference-only) Windows resolver.rs hunk verbatim reference-only (cfg(windows)-only): system_module by-path early-load + name-keyed cache + failures-never-cached rewrite + module_path helper + 2 tests. The xcl-dev#1218 resolver hunk is byte-identical to xcl-dev#1151 (git diff pr1151head pr1218head -- resolver.rs empty) — landed once, xcl-dev#1151 triage-closes as CONTAINED. Windows hle/kernelx.rs hunks verbatim reference-only (cfg(windows)-only): load_library_impl title-owned GetModuleHandleExW(FROM_ADDRESS) self-reference block + free_library_of_a_system_dll test. NO Linux twin change: resolver_linux::system_module (resolver_linux.rs) is a stub returning None always — no LoadLibrary twin on Linux, same category as xcl-dev#1667 no-hook-point. Both live heads re-verified pre-commit (pr1218head=8200da86 +72/-7 2 files, pr1151head=5157a51c +47/-7 1 file, both still OPEN, merge-base false, same hashes as plan pin, no force-push).
|
merge-check |
|
merge-check claim |
|
merge-check |
system_modulecached host module handles inSYS_CACHEbydll_key, which drops the directory, and it cached failures (0) too. So:LoadLibrary("C:\Missing\foo.dll")failed, a laterLoadLibrary("foo.dll")returned NULL without trying;version.dllwas cached,LoadLibrary("C:\Mods\version.dll")returned the System32 copy.Windows loads the path it is given.
A name with a directory component is now loaded as given with
LoadLibraryWand is not cached. Bare names (import resolution, the HLE modules'system_module("x.dll")calls) still use the name-keyed cache, which now holds only successful loads.What is in it
crates/xcl/src/resolver.rs: the change, and testsfailed_system_load_by_path_is_not_cachedandsystem_load_by_path_loads_that_path.Tested
cargo test --workspace -- --test-threads=4on 5157a51: 743 passed, 0 failed, 41 ignored; no SKIPPED GPU testsversion.dllis a Wine builtin, which Wine maps to the module already loaded under that name whatever the path;system_load_by_path_loads_that_pathchecks the load by path only on Windows (found in a test run under Wine, see the comments)Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code