Repository navigation
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows run of 5e55c4a merged onto Built |
|
The hosted conventions check is failing while the PR description still has empty |
|
Review of 5e55c4a against To check what the fallbacks do, I copied the added block verbatim into a small Windows program (
What this means for
The PR has no test and names no title. A title that needs this, with the path it passes, would show which of these lookups is actually required. Not run: a full Windows build of the libraries or a title with this PR. The table above comes from the copied block, not from libkernel. AI-assisted: yes (Claude Code); results above were run on this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
Requesting changes based on the still-unresolved findings already documented in the review thread. The Windows experiment in comment 6329077430 shows the fallback can return a different module by basename (including a system DLL) after the requested path fails or names a non-PE file, then mark it unowned so initialization is skipped; the fallback also changes the reported loader error. The same report found no title/path evidence for the added game_modules and libs searches. Please address those concrete cases with a focused test before keeping these search paths.
The PR is also 423 commits behind current main 524398151f1e (merge base 0c6a5bd5938f) and the hosted conventions checks still fail; the What and Tested sections remain empty. Please rebase, complete the PR template and rerun the relevant checks after correcting the behavior. The independent Windows report says the broader module test set passed on an older base, but its copied-block probe is not a test of the library build.
I manually compared the shared-file warnings: #5021 changes only Apple branches, #6879 only adds the Emscripten include, and #7201 changes Apple link-map handling. Those changes are distinct from this PR's Windows-only fallback block, so no dependency on those three is indicated by the current diffs.
|
@Delciob #10627 touches the same Windows AI-assisted: yes |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the PR. Findings, most of them from wachi35676's experiment above (verified against the diff):
DynamicLoader.cpp:186-190:GetModuleHandleW(filename)matches any loaded module with the same base name, from any directory, system DLLs included. When the requested file is missing or is not a PE file,dlopenreturns a different module and reports success. Match the whole resolved path, or the file identity, as FreeBSD'sload_objectdoes (object_match_name/ same device and inode).DynamicLoader.cpp:192-193,213: the reused handle isowned = false, soInitializeDeferredModuleis skipped andsceKernelLoadStartModulenever runsmodule_startor the initializers.DynamicLoader.cpp:197-204: nothing in the repo or in FreeBSD's rtld refers togame_modules/orlibs/; a path containing/is used as given. Name the title and the exact path it passes, or drop these candidates. The fourth candidate (<name>.guest.prx) is already tried byRelinkedModulePath_nid_no_patchbeforeLoadLibraryExW.DynamicLoader.cpp:207:std::filesystem::existsoverwritesGetLastError(), so the loggedWindows loader erroris no longer the originalLoadLibraryExWone (126 becomes 3). Save the error before the fallbacks and restore it.- No test, and the description gives no behaviour summary or concrete validation;
What/Testedneed the exact scenario and checks. - #10627 touches the same failure block; please answer maximilianfv on the merge order, and rebase, since this conflicts with
main.
Welcome to push a narrower version with a test that fails without it.
|
@Delciob Thanks. Since this was opened, |
|
Closing:
Feel free to reopen, or open a new PR rebased on |
What
Enhance dlopen on Windows to reuse existing loaded module handles via GetModuleHandleW before attempting a new disk load. Add fallback search candidate paths for game_modules/ and libs/ subdirectories including .guest.prx suffix resolution.
Tested
Windows 10 x64, game module dynamic loading with secondary modules.
Checklist