Repository navigation
fix(loader): resolve sceKernelDlsym on the main module - #2786
Conversation
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for splitting this out. Checked on Linux (GCC, Release, PR merged onto current main): the build and the area's ctest (94 tests) pass, including guest_dynamic_loader.
- The new regression does not fail without the change on Linux. With
Module.cppreverted,guest_dynamic_loaderstill passes:dlsym_nid_postfix(nullptr, ...)already falls back toDefaultScopeSymbol(DynamicLoader.cpp:164), sosceKernelDlsym(0, ...)finds the executable's export there. The fix only changes behaviour on Windows, where there is no such fallback and the only global module is the onedlopen(nullptr)registers. - The Windows part can't be checked from Linux and the PR says it wasn't run. Please post evidence from a Windows build (MinGW or MSVC): the
guest_dynamic_loaderoutput onmain(failing at the newsceKernelDlsym(0, "GuestDefaultScopeOnly", ...)check) and with this PR (passing), and that the generated.deflinks.
The change itself looks right (handle 0 only, same ESRCH on a missing symbol, module handle closed after the lookup). Once the Windows before/after is in, this is ready from my side.
|
Additional platform validation of standalone PR head Windows: failed tests — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, 1 checks, 1 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run. Checks: Command after building: Diagnostic-only rebuild (same assertions, added failure printing): sceKernelDlsym(0, "GuestDefaultScopeOnly", &mainSymbol) == 0 && mainSymbol != nullptr. The PE export table does not contain GuestDefaultScopeOnly. Pristine parent 5edae35 passes guest_dynamic_loader. Failed cases: No title/gameplay validation. These results cover the standalone head, not a merge with current main. |
43110f8 to
4a62b62
Compare
|
@adriadam10 Fixed the Windows export configuration and rebased onto current main. I’m on Linux, so I cant test native Windows directly, but the MinGW-built test under Wine fails without the loader change and passes with it; Linux also passes, so looks fixed. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the update. Checked on Linux (GCC, Release, PR merged onto current main): build and the area's ctest (106 tests) pass, guest_dynamic_loader included. As expected, the regression passes on Linux without the loader change (the default-scope fallback already resolves it); it only discriminates on Windows, where the .def export now makes GuestDefaultScopeOnly visible. The main-module path (GetModuleHandleW(nullptr) → registered handle → GetProcAddress) and the error return look right. Merging once the Windows build job is green.
What
Split from #1616, following its review. Resolve handle 0 through the main executable for
sceKernelDlsym, retaining the existing error behavior. The regression calls an executable-only export; Windows exports it through a generated.def, with a plainextern "C"definition instead of__declspec.Tested
Linux x86-64, GCC 16.2.1, Release.
guest_dynamic_loaderpasses, including main-module calls and missing-symbol errors. MinGW C++20 syntax check passes; Windows runtime/CI has not been run locally. Conventions and whitespace checks pass on current main (5edae353).Depends on
None for build. HFW integration also needs #2785 (relinker), #2787 (filesystem), #2788 (http), #2789 (apr), #2790 (shader). #1269 (media), #1339 (VRR), #1586 (unwind) and #1436 (imports) are now on main. Local image-table experiments are excluded; open #757 → #758 overlaps them, and #920 is closed without merging. Earlier combined integration reached menu/loading UI; these isolated branches have not been game-tested and gameplay is unverified.
Checklist
main; no duplicate implementation found beyond superseded fix(linux): resolve loader and APR failures exposed by HFW #1616