-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Occasional deadlock in ConptyConnection dtor when a process exits too quickly #7392
Labels
Area-TerminalConnection
Issues pertaining to the terminal<->backend connection interface
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-1
A description (P1)
Product-Terminal
The new Windows Terminal.
Resolution-Fix-Committed
Fix is checked in, but it might be 3-4 weeks until a release.
Severity-Crash
Crashes are real bad news.
Milestone
Comments
DHowett
added
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Area-TerminalConnection
Issues pertaining to the terminal<->backend connection interface
Severity-Crash
Crashes are real bad news.
Product-Terminal
The new Windows Terminal.
Priority-1
A description (P1)
labels
Aug 25, 2020
ghost
added
the
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
label
Aug 25, 2020
DHowett
removed
the
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
label
Aug 25, 2020
|
I’m planning on using C++/WinRT’s final release coroutine support :) |
DHowett
added a commit
that referenced
this issue
Sep 8, 2020
This commit leverages C++/WinRT's final_release [extension point] to pull the final destruction of ConptyConnection off onto a background thread. We've been seeing some deadlocks during teardown where the output thread (holding the last owning reference to the connection) was trying to destruct the threadpool wait while the threadpool wait was simultaneously running its callback and waiting for the output thread to terminate. It turns out that trying to release a threadpool wait while it's running a callback that's blocked on you will absolutely result in a deadlock. Fixes #7392. [extension point]: https://devblogs.microsoft.com/oldnewthing/20191018-00
ghost
pushed a commit
that referenced
this issue
Sep 9, 2020
This commit leverages C++/WinRT's final_release [extension point] to pull the final destruction of ConptyConnection off onto a background thread. We've been seeing some deadlocks during teardown where the output thread (holding the last owning reference to the connection) was trying to destruct the threadpool wait while the threadpool wait was simultaneously running its callback and waiting for the output thread to terminate. It turns out that trying to release a threadpool wait while it's running a callback that's blocked on you will absolutely result in a deadlock. Fixes #7392. [extension point]: https://devblogs.microsoft.com/oldnewthing/20191018-00/?p=103010
ghost
added
the
Resolution-Fix-Committed
Fix is checked in, but it might be 3-4 weeks until a release.
label
Sep 9, 2020
DHowett
added a commit
that referenced
this issue
Sep 18, 2020
This commit leverages C++/WinRT's final_release [extension point] to pull the final destruction of ConptyConnection off onto a background thread. We've been seeing some deadlocks during teardown where the output thread (holding the last owning reference to the connection) was trying to destruct the threadpool wait while the threadpool wait was simultaneously running its callback and waiting for the output thread to terminate. It turns out that trying to release a threadpool wait while it's running a callback that's blocked on you will absolutely result in a deadlock. Fixes #7392. [extension point]: https://devblogs.microsoft.com/oldnewthing/20191018-00/?p=103010 (cherry picked from commit 27f7ce7)
🎉This issue was addressed in #7575, which has now been successfully released as Handy links: |
🎉This issue was addressed in #7575, which has now been successfully released as Handy links: |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-TerminalConnection
Issues pertaining to the terminal<->backend connection interface
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-1
A description (P1)
Product-Terminal
The new Windows Terminal.
Resolution-Fix-Committed
Fix is checked in, but it might be 3-4 weeks until a release.
Severity-Crash
Crashes are real bad news.
Seen in the wild. The output thread (last owning reference to
ConptyConnection
) is tearing down and theConptyConnection
dtor tries to tear down our threadpool wait. The threadpool, however, is waiting for the output thread to drain and complete. Whoops.Stack traces (partial)
tp teardown
output thread
The text was updated successfully, but these errors were encountered: