-
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
Fix a potential deadlock for PtySignal::SetParent #14463
Conversation
_DoShowHide(_initialShowHide->show); | ||
_DoShowHide(*_initialShowHide); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(for my education) why is ShowHideData
a struct? Why not just make _initialShowHide
an optional<unsigned short>
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it was done to make the code more consistent? I'd probably would've done it the same way. (And because of that I built on this to store the struct in the optional.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI We made everything structs so that they could be read directly "off the wire".
_DoShowHide(_initialShowHide->show); | ||
_DoShowHide(*_initialShowHide); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI We made everything structs so that they could be read directly "off the wire".
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This changeset consists of two parts: * Refactor `PtySignalInputThread` to move more code from `_InputThread` into the various `_Do*` handlers. This allows us to precisely control console locking behavior which is the cause of this bug. * Add the 1-line fix to `_DoSetWindowParent` to unlock the console before calling foreign functions (`SetWindowLongPtrW` in this case). This fix is theoretical in nature, based on a memory dump from an affected user and most likely fixes: https://developercommunity.visualstudio.com/t/10199439 ## Validation Steps Performed * ConPTY tests complete. ✅
This changeset consists of two parts: * Refactor `PtySignalInputThread` to move more code from `_InputThread` into the various `_Do*` handlers. This allows us to precisely control console locking behavior which is the cause of this bug. * Add the 1-line fix to `_DoSetWindowParent` to unlock the console before calling foreign functions (`SetWindowLongPtrW` in this case). This fix is theoretical in nature, based on a memory dump from an affected user and most likely fixes: https://developercommunity.visualstudio.com/t/10199439 ## Validation Steps Performed * ConPTY tests complete. ✅ (cherry picked from commit 3c78e01)
This changeset consists of two parts: * Refactor `PtySignalInputThread` to move more code from `_InputThread` into the various `_Do*` handlers. This allows us to precisely control console locking behavior which is the cause of this bug. * Add the 1-line fix to `_DoSetWindowParent` to unlock the console before calling foreign functions (`SetWindowLongPtrW` in this case). This fix is theoretical in nature, based on a memory dump from an affected user and most likely fixes: https://developercommunity.visualstudio.com/t/10199439 ## Validation Steps Performed * ConPTY tests complete. ✅ (cherry picked from commit 3c78e01) Service-Card-Id: 87207820 Service-Version: 1.15
This changeset consists of two parts: * Refactor `PtySignalInputThread` to move more code from `_InputThread` into the various `_Do*` handlers. This allows us to precisely control console locking behavior which is the cause of this bug. * Add the 1-line fix to `_DoSetWindowParent` to unlock the console before calling foreign functions (`SetWindowLongPtrW` in this case). This fix is theoretical in nature, based on a memory dump from an affected user and most likely fixes: https://developercommunity.visualstudio.com/t/10199439 ## Validation Steps Performed * ConPTY tests complete. ✅ (cherry picked from commit 3c78e01) Service-Card-Id: 87207821 Service-Version: 1.16
🎉 Handy links: |
🎉 Handy links: |
This changeset consists of two parts:
PtySignalInputThread
to move more code from_InputThread
into the various
_Do*
handlers. This allows us to precisely controlconsole locking behavior which is the cause of this bug.
_DoSetWindowParent
to unlock the console beforecalling foreign functions (
SetWindowLongPtrW
in this case).This fix is theoretical in nature, based on a memory dump from an affected user
and most likely fixes: https://developercommunity.visualstudio.com/t/10199439
Validation Steps Performed