-
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
Fixed a deadlock when printing surrogate pairs #4150
Conversation
This has been a historically dangerous area to touch (already!) -- we have had a number of fixes and reversions in this function already. |
(I think #1360 is the same issue, actually) |
Fixes GH#4145.
You're right - You guys even found the exact same line. 😄 But I believe the conclusion in #1360 was slightly off / incomplete: Given a surrogate pair in => @DHowett-MSFT The actual fix AFAICS is to not use |
Huh... @DHowett-MSFT @miniksa turns out that the cell distance will always be 1 for surrogate pairs? Here's the before/after with this PR with the string "𐐌𐐜𐐬" (3 surrogate pairs): As you can see the current |
Okay so this has historically been challenging - could we maybe add the tests from #2924 and a test for the #3052 case to this PR? I'd really hate to have another "simple" change in this area secretly bite us again (I'm inclined to trust that this works better, but I'm more inclined to trust tests 😝) |
@miniksa Using the minimal reproduction program? Yup. 🙂 |
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.
@miniksa Michael Niksa FTE Using the minimal reproduction program? Yup. 🙂
Beautiful.
@zadjii-msft I've tried to adapt the referenced test case, but was unable to figure out how make it work in the first place. If I call |
@lhecker ruh-roh I just copy-pasted the test and built it locally, and it passed just fine. So maybe your change broke it 😅 Usually, when I'm debugging tests, I add a |
I tried it on the master branch - even after
Thank you so much! I'll try fixing it using that tomorrow. 🤗 |
Go to Then when you run something with The top ones will be new instances of the Visual Studios installed on your system. The bottom ones will be the running instances of Visual Studio. You can see I have one open already. If I choose the bottom one, VS will attach straight up as if I F5'd from the solution at the point from the |
Here's my trick! Setting the command to You can place and hit breakpoints and everything this way. |
This is probably another good one for the #4163 treatment. |
I added a test. Can you guys re-review? 🙂 The long explanation for the actual cause of the freeze: The strings that get fed into @zadjii-msft Thanks for making me write the test. I hardened the code a bit more now! Regarding DebugBreakWhen I add a `DebugBreak()` statement as the first thing in a `TEST() { ... }` group I get the following error in my terminal: > A crash with exception code 0x80000003 occurred in module "KERNELBASE.dll" in the process hosting the test code while invoking a test operation...and no window opens. ¯\_(ツ)_/¯ |
I'm just writing to make sure this PR isn't forgotten. 😄 |
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.
Thanks for adding the test case!
Hello @zadjii-msft! 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 (
|
## Summary of the Pull Request See [my code comment](#4150 (comment)) below for technical details of the issue that caused #4145. ## PR Checklist * [x] Closes #1360, Closes #4145. * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments TBH I kinda hope this project could migrate to an internal use of UTF-8 in the future. 😶 ## Validation Steps Performed Followed the "Steps to reproduce" in #4145 and ensured the "Expected behavior" happens. (cherry picked from commit 3e6b4b5)
🎉 Handy links: |
🎉 Handy links: |
## Summary of the Pull Request See [my code comment](microsoft/terminal#4150 (comment)) below for technical details of the issue that caused #4145. ## PR Checklist * [x] Closes #1360, Closes #4145. * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments TBH I kinda hope this project could migrate to an internal use of UTF-8 in the future. 😶 ## Validation Steps Performed Followed the "Steps to reproduce" in #4145 and ensured the "Expected behavior" happens.
Summary of the Pull Request
See my code comment below for technical details of the issue that caused #4145.
PR Checklist
Detailed Description of the Pull Request / Additional comments
TBH I kinda hope this project could migrate to an internal use of UTF-8 in the future. 😶
Validation Steps Performed
Followed the "Steps to reproduce" in #4145 and ensured the "Expected behavior" happens.