-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Terminal Sometimes Hangs, ControlCore::UpdatePatternLocations
#12607
Comments
This can be either of these two things:
In case of the latter we can just check the threads in the crash dump for any stack that includes a prior lock acquisition. 🙂 |
According to the latest dump from the user it's a deadlock due to the Nvidia driver.
Since the renderer is holding the lock and has no means for timeouts for synchronous calls like |
I've taken this off of our 1.14 & and 1.12/1.13 backport targets, because I found that this is a bug that almost certainly originates from the Nvidia driver. I left it in 22H1 if we want to follow up on this. |
Thought - can we do |
Since it reads from the What we could do however is to rewrite our asynchronous rendering functions (like
In the near future we'll get another one:
So we got 6 timers soon which all lock the buffer in one way or another and all of them are supposed to sorta run in sync with the rendering loop. Now I'm not saying it's trivial to invert control from "ControlCore updates RenderThread" to "RenderThread updates ControlCore", but I'm sure that this is worth the effort, because we can then avoid issues like that easily and simplify our code by reducing the amount of "state" of our application. |
note to future readersChecking the "Use software rendering (WARP)" box in the settings will likely mitigate this for you, at the cost of some performance penalty. At least until we've got this sorted out. |
We have a number of theories why #12607 is happening, one of which is that some GPU drivers somehow rely on Win32 messages or similar which we process on the main thread. If we then try to acquire the console lock on the main thread, while the GPU-driver thread itself is holding that lock, we've got ourselves a deadlock. This PR makes this less likely by running the repeat offender `UpdatePatternLocations` on a background thread instead. We have a number of other locations which acquire the console lock on the main thread and a thorough bug fix must be done in a different way. ## Validation Steps Performed * After pasting an URL it gets underlined on hover ✅
We have a number of theories why microsoft#12607 is happening, one of which is that some GPU drivers somehow rely on Win32 messages or similar which we process on the main thread. If we then try to acquire the console lock on the main thread, while the GPU-driver thread itself is holding that lock, we've got ourselves a deadlock. This PR makes this less likely by running the repeat offender `UpdatePatternLocations` on a background thread instead. We have a number of other locations which acquire the console lock on the main thread and a thorough bug fix must be done in a different way. ## Validation Steps Performed * After pasting an URL it gets underlined on hover ✅ (cherry picked from commit 23e4d31) Service-Card-Id: 85033019 Service-Version: 1.15
We have a number of theories why microsoft#12607 is happening, one of which is that some GPU drivers somehow rely on Win32 messages or similar which we process on the main thread. If we then try to acquire the console lock on the main thread, while the GPU-driver thread itself is holding that lock, we've got ourselves a deadlock. This PR makes this less likely by running the repeat offender `UpdatePatternLocations` on a background thread instead. We have a number of other locations which acquire the console lock on the main thread and a thorough bug fix must be done in a different way. * After pasting an URL it gets underlined on hover ✅ (cherry picked from commit 23e4d31) Service-Card-Id: 85033018 Service-Version: 1.14
Windows 11 22h2 KB5022913 seems to have fixed this hang for me in chrome and edge. It may be fixed in Windows Terminal as well. |
This will most likely be fixed by #14959 because it doesn't call any graphics APIs while the console lock is being held. |
Anyone still seeing this on 1.18 Stable & 1.19 Preview/? |
This issue seems to have been solved for me since 22H2 windows 11 update. |
Welp, that sounds good to me. Thanks for following up! |
This issue seems to be back with 24H2. Enabling WARP software rendering instantly unlocks my terminal (ssh session). I can even toggle it on/off and freeze / unfreeze my shell.. NICE! Was it an NVIDIA driver issue? |
It may be related to this issue which is a bug in 24H2 (the fix is currently in the process of being released): #18040 |
From MSFT:38068994
(Dumps are in the internal bug, didn't feel comfortable sharing their dumps publicly)
The text was updated successfully, but these errors were encountered: