mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-08 18:16:28 +00:00
Pre-warm SHGetKnownFolder to avoid a deadlock in the nvidia driver (#20351)
The nvidia driver attempts to use SHGetKnownFolder (which has its own lock!) under the loader lock, which occasionally triggers a deadlock when we attempt to do the same thing during settings load. Closes #20350 (superseded) Closes #20348 Co-authored-by: gleb <46842077+groovg@users.noreply.github.com>
This commit is contained in:
2
.github/actions/spelling/expect/expect.txt
vendored
2
.github/actions/spelling/expect/expect.txt
vendored
@@ -1139,7 +1139,7 @@ nullopts
|
||||
NUMSCROLL
|
||||
NUnit
|
||||
nupkg
|
||||
NVIDIA
|
||||
nvidia
|
||||
NVT
|
||||
OACR
|
||||
ocolor
|
||||
|
||||
@@ -544,6 +544,15 @@ void WindowEmperor::HandleCommandlineArgs(int nCmdShow)
|
||||
__assume(false);
|
||||
}
|
||||
|
||||
// !! LOAD BEARING !!
|
||||
// This prevents loader lock contention with some versions of the nvidia
|
||||
// driver, which calls SHGetKnownFolderPath triggering a delay load while
|
||||
// under lock during application startup. See GH#20348.
|
||||
{
|
||||
wil::unique_cotaskmem_string localAppDataFolder;
|
||||
SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localAppDataFolder);
|
||||
}
|
||||
|
||||
_app = winrt::TerminalApp::App{};
|
||||
_app.Logic().ReloadSettings();
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ Abstract:
|
||||
#include <shellscalingapi.h>
|
||||
#include <windowsx.h>
|
||||
#include <ShObjIdl.h>
|
||||
#include <shlobj_core.h>
|
||||
|
||||
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
||||
#define BLOCK_TIL
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"Plugins": [
|
||||
{
|
||||
"Type": "Microsoft.TestInfrastructure.UniversalTest.TestMD.Plugins.Etw.EtwPlugin",
|
||||
"Name": "Collecting conhost logs during FTs",
|
||||
"Name": "Collecting conhost logs during feature tests",
|
||||
"Parameters": {
|
||||
"$schema": "Microsoft.TestInfrastructure.UniversalTest.TestMD.Plugins.Etw.EtwPlugin-1.json",
|
||||
"Profiles": [
|
||||
|
||||
Reference in New Issue
Block a user