-
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 hangs after running ripgrep in a loop #1360
Comments
The callstack and dump given appears to be in a state of appropriate locks with output being written to the buffer at the time of the dump/stack break. I'm trying to repro this locally to see if I can find something a bit more obvious. |
@miniksa I was able to reproduce it just now on my primary machine so if there is anything I can do to help debug it please let me know. |
@miniksa Just adding some of the details I sent in email here for reference. The issue I am hitting appears to be an infinite loop in:
This is in Terminal.cpp, line 326 On line 372 we have the following code:
I can see in the debugger when this hang reproduces that cellDistance has become 0. Thus, this becomes a decrement instead of an increment. So, the variable is decremented by one on line 372 and is then incremented by one at the start of the next loop iteration. When it comes back to line 372, i is decremented again, and this process repeats forever. Further investigation will be needed to determine how cellDistance can become zero and trigger this infinite loop. |
I have found an easier way to reproduce this issue, by running the following trivial C# program:
|
Two issues here:
All of this really comes down to.... #780 needs to get done. It would head off this entire class of issue. I'll patch up |
Reopening: the cure was worse than the disease, so we may well just have to wait for #780 to land here. Sorry! |
🎉This issue was addressed in #2924, which has now been successfully released as Handy links: |
## 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.
## 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)
🎉This issue was addressed in #4150, which has now been successfully released as Handy links: |
🎉This issue was addressed in #4150, which has now been successfully released as Handy links: |
Environment
Windows version 1903 OS build 18899.1000
Windows Terminal (Preview) version 0.2.1703.0
Any other software?
ripgrep 11.0.0
Steps to reproduce
Install ripgrep
Open wt (Windows Terminal), running PowerShell.
Run the following from the root of a large drive
while ($true) { rg -i "foo" }
Expected behavior
The terminal continually runs ripgrep against all files on the drive
Actual behavior
The terminal eventually hangs and is completely unresponsive.
The call stack for the main thread when the window hangs is attached.
HungTerminal1.callstack.txt
A minidump of the hung process is available here:
HungWindowsTerminal
The text was updated successfully, but these errors were encountered: