Repository navigation
bootloader: work around another source of VCRUNTIME140.dll leak - #8650
Merged
rokm merged 2 commits intoJul 14, 2024
Merged
Conversation
At the end of `pyi_archive_open`, we go through all TOC entries to determine whether any of them are extractable (which indicates an application with onefile semantics). We can reuse the same scan to check whether a SPLASH entry is present, and store the pointer to it. This alleviates the need for another scan in `pyi_splash_setup`, plus it decouples the ability to check for presence of splash screen resources from loading them. Therefore, the `_pyi_main_setup_splash_screen` helper can now exit early if no splash screen is available.
Have the parent process of a splash-screen-enabled onefile application prefer the system-wide copy of `VCRUNTIME140.dll` (if available), by trying to preemptively load it before splash screen is set up. Contemporary Tcl/Tk DLLs are known to depend on `VCRUNTIME140.dll`, so when we load them during splash screen initialization, they cause `VCRUNTIME140.dll` to be loaded as well. This happens after the frozen application's top-level directory is pushed into the search path; therefore, the bundled copy of the DLL is loaded, which is intended to accommodate systems that do not have system-wide copy of the DLL available. However, the OS and/or anti-virus programs might inject additional DLLs into the process that also depend on `VCRUNTIME140.dll` (see the follow-up discussion under pyinstaller#7106); such externally loaded DLLs might prevent us from unloading the bundled copy of `VCRUNTIME140.dll` during the cleanup phase, and thus interfere with removal of application's temporary directory.
Member
Author
|
I'm starting to wish that neither onefile mode nor splash screen existed... |
bwoodsend
approved these changes
Jul 12, 2024
bwoodsend
left a comment
Member
There was a problem hiding this comment.
Assuming we're confident enough in the assertion that bundled tcl and system VCRUNTIME140.dll are compatible...
Member
Author
There's always that, too... But on the other hand, we used to fail to extract |
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.
Have the parent process of a splash-screen-enabled onefile application prefer the system-wide copy of
VCRUNTIME140.dll(if available), by trying to preemptively load it before splash screen is set up.Contemporary Tcl/Tk DLLs are known to depend on
VCRUNTIME140.dll, so when we load them during splash screen initialization, they causeVCRUNTIME140.dllto be loaded as well. This happens after the frozen application's top-level directory is pushed into the search path; therefore, the bundled copy of the DLL is loaded, which is intended to accommodate systems that do not have system-wide copy of the DLL available.However, the OS and/or anti-virus programs might inject additional DLLs into the process that also depend on
VCRUNTIME140.dll(see the follow-up discussion under #7106); such externally loaded DLLs might prevent us from unloading the bundled copy ofVCRUNTIME140.dllduring the cleanup phase, and thus interfere with removal of application's temporary directory.