Include vcruntime140_1.dll for VS2019 16.5 x64 from the redist directory in the package
Categories
(Firefox :: Installer, defect, P3)
Tracking
()
People
(Reporter: iannbugzilla, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(1 obsolete file)
At the moment the vcruntime140_1.dll for VS2019 16.5 x64 from the redist directory is not included in the package.
The way this works has always been a maintenance nightmare forever. I think what is really needed is to trust that the builder has the correct runtime routines in the redist dir and just to make sure any file matching any of the following patterns gets packaged:
vcruntime[0-9]+.dll
vcruntime[0-9]+[0-9]+.dll
msvcp[0-9]+.dll
msvcp[0-9]+[0-9]+.dll
Unless Microsoft changes their naming convention completely this would future proof the code here.
Sorry, currently don't have the spare cycles to look further into this.
Comment 4•4 years ago
|
||
Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is --
(Backlog,) indicating it has has not been previously triaged, the bug's Severity is being updated to --
(default, untriaged.)
Comment 5•4 years ago
|
||
Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is --
(Backlog,) indicating it has has not been previously triaged, the bug's Severity is being updated to --
(default, untriaged.)
Comment 6•4 years ago
|
||
Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is --
(Backlog,) indicating it has has not been previously triaged, the bug's Severity is being updated to --
(default, untriaged.)
Comment 7•4 years ago
|
||
The severity of these bugs was changed, mistakenly, from normal
to S3
.
Because these bugs have a priority of --
, indicating that they have not been previously triaged, these bugs should be changed to Severity of --
.
I see minimal recent activity so adding this here. Am currently stuck on this same bug + a few things:
- Have already filed a bug report from the crash tool, not sure where that went.
- Even a fresh download doesn't resolve it
- From a brief look, am unclear how does this ticket show traction? Can't see a +1 to let your devs know what is and is not affecting people.
- I landed here from https://support.mozilla.org/en-US/questions/1290656
- Tried to copy the DLL file per the URL above, didn't help either.
FWIW: before the DLL file, the error was around:
--------------------------- firefox.exe - System Error ---------------------------
The code execution cannot proceed because VCRUNTIME140_1.dll was not found. Reinstalling the program may fix this problem.
--------------------------- OK ---------------------------
Once I copied the DLL file, didn't work. On uninstalling, now the error is :
firefox.exe - Entry Point Not Found
The procedure entry point __CxxFrameHandler4 could not be located in the dynamic link library C:\WINDOWS\SYSTEM32\MSVCP140.dll.
OK
Updated•4 years ago
|
Comment 9•4 years ago
|
||
There's something interesting going on here. Right now, we ship builds with redist VC runtimes from two archives:
- "filename": "vs2017_15.8.4.zip" for everything not aarch64
- "filename": "vs2017_15.9.6.zip" for aarch64
It's not trivial to get your hands on those archives (see https://bugzilla.mozilla.org/show_bug.cgi?id=1621776#c0 for how I do it) but the relevantredist
directories in there look like:
$ unzip -l vs2017_15.8.4.zip | grep redist
329368 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/concrt140.dll
625808 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/msvcp140.dll
31896 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/msvcp140_1.dll
195248 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/msvcp140_2.dll
386720 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/vccorlib140.dll
87200 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x64/Microsoft.VC141.CRT/vcruntime140.dll
246576 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/concrt140.dll
453416 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/msvcp140.dll
28472 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/msvcp140_1.dll
154416 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/msvcp140_2.dll
269976 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/vccorlib140.dll
82752 01-01-2010 00:00 vs2017_15.8.4/VC/redist/x86/Microsoft.VC141.CRT/vcruntime140.dll
$ unzip -l vs2017_15.9.6.zip | grep redist
359040 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/concrt140.dll
660608 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/msvcp140.dll
32384 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/msvcp140_1.dll
189568 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/msvcp140_2.dll
424576 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/vccorlib140.dll
90752 01-01-2010 00:00 vs2017_15.9.6/VC/redist/arm64/Microsoft.VC141.CRT/vcruntime140.dll
332336 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/concrt140.dll
627440 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/msvcp140.dll
30960 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/msvcp140_1.dll
205552 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/msvcp140_2.dll
366320 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/vccorlib140.dll
85232 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x64/Microsoft.VC141.CRT/vcruntime140.dll
249600 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/concrt140.dll
449280 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/msvcp140.dll
28440 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/msvcp140_1.dll
172824 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/msvcp140_2.dll
269568 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/vccorlib140.dll
80128 01-01-2010 00:00 vs2017_15.9.6/VC/redist/x86/Microsoft.VC141.CRT/vcruntime140.dll
Observe that there are no vcruntime_*
DLLs at all! Now, this could be an error in our redistribution packaging, but in this case it doesn't look like it: the relevant patterns are here and they'll catch anything present in the source VC directory. (I haven't fetched the old VC versions to ensure there's no error here. I have looked at a more recent VC and I do see vcruntime140_1.dll
.)
So I'm left wondering how we're ever seeing this in the wild. Would this be folks who install a (necessarily different) version of the VC CRT somehow? Maybe we somehow remove these unexpected files, leaving a partial VC CRT remaining?
As to the content of this ticket, there are two reasons to do this. The first is that at least some folks are trying to redistribute with VS2019, even though we don't do that yet in automation. (And I'm not 100% we support that at all.) The second is that as written, this is fragile.
mhowell: mkaply: this is not my area of expertise. Have you any theories as to how we might be witnessing this issue?
Comment 10•4 years ago
|
||
mhowell: mkaply: NI to ponder https://bugzilla.mozilla.org/show_bug.cgi?id=1624546#c9.
Comment 11•4 years ago
|
||
So I'm left wondering how we're ever seeing this in the wild. Would this be folks who install a (necessarily different) version of the VC CRT somehow? Maybe we somehow remove these unexpected files, leaving a partial VC CRT remaining?
I think that's really the thing we're struggling with. We know it happens, we just don't know what requires that DLL. Maybe there's someone at Msft we can reach out too.
Comment 12•4 years ago
|
||
Yeah, it would seem that what's happening is something is loading another copy of the CRT (presumably the copy in System32) and that one is trying to use the _1
file. But I have no idea either what would be causing the system CRT to be loaded (presumably some third-party module?) or why it would not then load its dependencies out of the same location.
Comment 13•4 years ago
|
||
Another possibility is that something is outright replacing the copy of vcruntime140.dll
that we ship, but that seems pretty out there as an explanation.
Comment 14•4 years ago
•
|
||
If you install VS2017 or VS2019 the VS2015 to 2019 redist will be installed too. You won't see the error then. Same for x86 builds where this one does not exist. If you use a redist prior to VS2019 16.5 all good too. I no longer build with VS2017 so not sure if the requirement was added in later version too.
Edit Opps mixed it up. deleted the second part from this comment.
Comment 15•4 years ago
|
||
Interesting. That begs the question what API is in vcruntime140_1.dll that we sometimes use and sometimes don't...
Comment 16•4 years ago
|
||
I think it is just a new internal dependency and only Microsoft might know what changed unless you want to start digging. Other projects seem to have hit it too:
https://bugs.openjdk.java.net/browse/JDK-8242468
Comment 17•4 years ago
|
||
Not sure if this helps anyone else but this resolved my issue... (I was stuck on this issue for a few months)
Merely reinstalling the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for my laptop architecture resolved the issue for me.
https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-downloads
For FF Devs, in case I could help here by listing out folder contents etc... ( for e.g. if you want to see what are the current status of the DLL files etc. post this re-install) do let me know. I say that since I am still on the same laptop on which FF wasn't working for months.
Comment 18•4 years ago
|
||
I think I can reproduce the issue when an app uses merge modules (MSM) to install the redist, and it is then uninstalled. I roughly followed the steps to reproduce with LibreOffice in this thread, on Windows 10 20H2:
- Install Firefox 86.0
- Install vs2017 redist
- Install LibreOffice 7.0.0.3 msi
- Uninstall LibreOffice
- Firefox now hits a vcruntime140_1.dll error on start
It sounds like this is related to reference counting the DLLs, see this LibreOffice bug comment: There's an old runtime (e.g. 2017, pre-vcruntime140_1.dll), then a new runtime is installed via MSM which overwrites the DLLs and adds vcruntime140_1.dll, all the old DLLs go to refcount 2 but vcruntime140_1.dll is refcount 1. If this new runtime is removed, msiexec decrements the refcounts, leaving the DLLs that were present before it was installed (which have been updated), but not including vcruntime140_1.dll, even though the updated DLLs (e.g. concrt140.dll) now depend on it. The standalone 2015-2019 redist installer doesn't seem to make this same mistake, it raises everything to the same refcount.
If I subsequently install LibreOffice 6.4, Firefox starts, but can't start content processes. I'm not quite sure what's happening there.
Could this also happen when installing an application, which seems like it would be more common? Some installers may attempt to remove an existing version of the redist, and then fail to replace it, though I haven't been able to reproduce this with an installer yet. See this thread, the Microsoft folks seem to think that's what's going on there, with RemoveExistingProducts in the MSI. There are cases when an application tries to install the runtime it wants but then can't launch due to missing vcruntime140_1.dll, I've seen this mentioned with Sims 4, Star Wars Squadrons, and Snap Camera in a few places, though I wasn't able to reproduce it with Snap Camera 1.10.0, 1.11.0, or 1.12.0.
I made a local build with the attached patch, this seems to fix the issue. Weirdly it also fixes other apps on the system that can now find vcruntime140_1.dll in our install dir! Though this isn't an ideal solution, it would be an easier change than including the standalone runtime .exe installer.
Comment 19•4 years ago
|
||
Just experienced this bug on a laptop I'm building out. Only thing I can think of as a trigger is that I had just uninstalled all M365 apps and gone through a registry/file cleaning (CCleaner).
I fixed it by copying the file needed (vcruntime140_1.dll) from the Edge browser folder here - c:\Program Files (x86)\Microsoft\Edge\Application\89.0.774.45
I kinda like the idea of using Edge to fix Firefox but hope this bug gets fixed soon. :)
Comment 20•4 years ago
|
||
This bug also occurs after installing or uninstalling some autodesk programs.
I found the solution that can help us all:
https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-remove-and-reinstall-Microsoft-Visual-C-Runtime-Libraries.html
The bug is caused by a conflict in the Visual C ++ libraries, uninstalling all versions and reinstalling only the latest version of each one of them, everything works correctly again.
Pay attention that for the libraries from 2015 to 2019 only the Visual C ++ version 2015-2019 is needed
Library download link:
https://docs.microsoft.com/en-us/archive/blogs/jagbal/where-can-i-download-the-old-visual-c-redistributables
Comment 21•4 years ago
|
||
I'm able to work around the repro from comment 18 by disabling "prefer system32" in the sandbox and launcher. I realized it when I saw that the launcher loads our copy of the redist, but the browser process loads from system32 (and fails). The parent process works after the first run because the launcher can see from the registry that the browser didn't come up successfully last time, so it just runs as the browser, by then it has already loaded the local runtime before it set "prefer system32" on itself. But then the sandboxing mitigations still prevent child processes from spawning successfully, so we get blank tabs.
I doubt that we're going to change this, but it's good to explain why a bad system redist install is affecting us at all (besides injection). Demonstration builds are on try.
Comment 22•4 years ago
|
||
(In reply to Adam Gashlin (he/him) [:agashlin] from comment #21)
I'm able to work around the repro from comment 18 by disabling "prefer system32" in the sandbox and launcher. I realized it when I saw that the launcher loads our copy of the redist, but the browser process loads from system32 (and fails). The parent process works after the first run because the launcher can see from the registry that the browser didn't come up successfully last time, so it just runs as the browser, by then it has already loaded the local runtime before it set "prefer system32" on itself. But then the sandboxing mitigations still prevent child processes from spawning successfully, so we get blank tabs.
I doubt that we're going to change this, but it's good to explain why a bad system redist install is affecting us at all (besides injection). Demonstration builds are on try.
Can we explicitly load our version?
Comment 23•4 years ago
|
||
I suspect it would be very difficult to make all uses late enough that we could explicitly load them first, but I don't know much about this. :toshi, does this seem feasible?
Comment 24•4 years ago
•
|
||
(In reply to Adam Gashlin (he/him) [:agashlin] from comment #23)
I suspect it would be very difficult to make all uses late enough that we could explicitly load them first, but I don't know much about this. :toshi, does this seem feasible?
I cannot come up with a way to explicitly load a module in the executable's directory, keeping the PreferSystem32Images
policy. We can add a logic for the launcher process to check MSVCP140.dll's import table and the existence of vcruntime140_1.dll, and to decide not to turn on PreferSystem32Images
, but it's really hacky.
One of the reasons why Firefox depends on MSVCP140.dll is std::ostringstream
e.g. launcher process, chromium sandbox, and probably more. We could implement our own stream class to get rid of dependency, but it's not easy either. Or, if we can static-link msvcp140 into firefox.exe (by adding -MT
option?), maybe we can pre-load our version of msvcp140 before loading system32's msvcp140.
Comment 25•3 years ago
•
|
||
A relative had this issue lately. Steps involved:
- Firefox worked fine
- Uninstalled the trial version of Office 365
- Firefox opens a window but it's completely broken and empty. No interaction possible. Has to be killed from task manager.
- Reinstalled Firefox
- Now shows an error about
vcruntime140_1.dll
not found - Looked for this file on the computer. Found it and put it in the Firefox folder
- Now runs fine.
Fortunately, he is really convinced about using Firefox and has good technical skills. But I fear that this is typically the kind of bug where users can easily give up :(
Comment 26•3 years ago
|
||
I was just hit by this by removing an old version of LibreOffice. Afterwards Firefox would load without any errors, but no content would be displayed. The fix was to reinstall vc_redist:
Comment 27•3 years ago
|
||
A relative had this problem also on windows 10 Home edition.
After installing her graphics tablet (drivers + software recommended by wacom). It is a one by wacom medium. After the install, the computer rebooted.
After the reboot, Firefox opens but displays nothing in the tabs, not even the about: ... works.
Reparation do not work. So I uninstalled and reinstalled. Same error as Mathieu Leplatre [:leplatrem].
I did the same thing and it work again.
It seems that installation and uninstallation can prevent Firefox to use vcruntime140_1.dll.
It should be added to firefox package.
Comment 28•3 years ago
|
||
(In reply to Toshihito Kikuchi [:toshi] from comment #24)
(In reply to Adam Gashlin (he/him) [:agashlin] from comment #23)
I suspect it would be very difficult to make all uses late enough that we could explicitly load them first, but I don't know much about this. :toshi, does this seem feasible?
I cannot come up with a way to explicitly load a module in the executable's directory, keeping the
PreferSystem32Images
policy. We can add a logic for the launcher process to check MSVCP140.dll's import table and the existence of vcruntime140_1.dll, and to decide not to turn onPreferSystem32Images
, but it's really hacky.
We can create a private SxS assembly to load selected DLLs from our app directory even if the PreferSystem32Images
mitigation is enabled. I fixed a similar issue about mozglue.dll
(see bug 1496179).
Updated•3 years ago
|
Comment 29•3 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #28)
We can create a private SxS assembly to load selected DLLs from our app directory even if the
PreferSystem32Images
mitigation is enabled. I fixed a similar issue aboutmozglue.dll
(see bug 1496179).
I filed bug 1733734 to investigate this.
Comment 30•2 years ago
|
||
The following patch is waiting for review from an inactive reviewer:
ID | Title | Author | Reviewer Status |
---|---|---|---|
D68010 | Bug 1624546 - Include vcruntime140_1.dll for VS2019 16.5 x64 from the redist directory in the package. r=dmajor | iannbugzilla | nalexander: Resigned from review |
:iannbugzilla, could you please find another reviewer or abandon the patch if it is no longer relevant?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Comment 32•2 years ago
|
||
Firefox team -- FYI that users on the Mozilla VPN are reporting still seeing Firefox issues when uninstalling the VPN (or Firefox crashing when updating the VPN).
Comment 33•2 years ago
|
||
(In reply to Santiago from comment #32)
Firefox team -- FYI that users on the Mozilla VPN are reporting still seeing Firefox issues when uninstalling the VPN
This was reported in bug 1691782 comment 5.
Comment 34•2 years ago
|
||
This doesn't appear to be an issue with the Build System, moving over to Installer.
Updated•1 years ago
|
Comment 35•1 year ago
|
||
Fixed by bug 1832467.
Updated•1 year ago
|
Description
•