Repository navigation
Avoid duplicate process attach for retained PAL modules - #6059
Merged
hoyosjs merged 1 commit intoSep 25, 2026
Merged
Conversation
Return the existing module registration without sending DLL_PROCESS_ATTACH again. Preserve reference counting and first-load initialization. Co-authored-by: Copilot App <[email protected]> Copilot-Session: ac7ee271-d7df-4244-91de-e4758a4fe909 Copilot-Session: 76e25dcf-2f3d-4a88-929c-0e62afa57c6a
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review comments were identified.
Review effort: Lite
Findings: None
What changed in this PR
Prevents duplicate DLL_PROCESS_ATTACH calls when the PAL reuses an existing module registration.
Changes:
- Tracks duplicate module registrations.
- Skips repeated
DllMaininitialization while preserving module reuse.
| File | Summary |
|---|---|
src/shared/pal/src/loader/module.cpp |
Updates module registration and duplicate-load handling. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Member
|
|
hoyosjs
approved these changes
Sep 25, 2026
This was referenced Sep 27, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Do not send
DLL_PROCESS_ATTACHagain when the PAL reuses an existing module registration. A second attach can initialize the debugger transport lock twice and trigger its assertion.LOADAddModulenow reports whether it found an existing module.LOADRegisterLibraryDirectreturns that module before callingDllMainagain.