-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Bug] 连续ctrl+c ,窗口卡死 #2789
Comments
对不起,不清楚你在说什么。Post an screenshot of the problem if possible. |
What is your Surface device? Arm or x64 Intel? |
x64 Intel |
Thanks, please write in English, and can you capture a video, I still can not understand what is happening. |
@DRSDavidSoft what @siruoren is reporting is that holding down Ctrl-C eventually causes a hang in the cmd shell. I am able to reproduce that inside Cmder with the 1.3.20 release (which is the current at the moment). I attached a debugger to the cmd.exe process, and the hang is occurring because the Ctrl-C occurred while the prompt filter was invoking git, and the background git.exe process has become stuck within a Some observations:
|
Confirmed: The Also, the So the best solution is to make these changes:
I've made those changes and confirmed they produce a significant and noticeable improvement, especially outside of a git directory. I'll send a pull request after I finish investigating why Ctrl-C is causing git to hang. |
Fixing the issue about how With that fix in place, I held Ctrl-C for over a minute, and:
But I'll still try to track down specifically why git.exe was hanging. |
Here's what happens:
I tried with several other programs being launched instead of git.exe. But only git.exe gets stuck. (I made the other programs produce varying degrees of output to test whether they get stuck trying to print output after the in-between cmd.exe gets terminated by the Ctrl-C, but they don't get stuck regardless how much output they produce.) This makes it look like the hang lies inside git.exe itself. Clink and Cmder can't do anything about that, but the changes I made in Cmder's prompt filter successfully avoid the problem in git.exe when async prompt filtering is enabled in Clink (and it is enabled by default). I'll put together a pull request with the change to Cmder's prompt script. |
@chrisant996 Wow, that was fast! Thanks for the investigation and the quick bug fix. I didn't understand what was happening as described in the bug report at first, so this is a huge help. Quick question, do you think it would be worthwhile to also report the hang to the git-for-windows developers? It's awesome that clink would handle situations where it would hang, but it'd be best if we could prevent it in the first place, since as you said it's isolated to git.exe executable at the moment, and no other programs. Great job, and thanks! 😄 👍🏻 |
PR is #2791
To report the issue to git would require tracking down a minimal repro that does not involve Cmder or Clink or Lua. It's certainly possible to do, but it would take a day or two. There were 3 bugs in the Cmder prompt script regardless, and once those bugs are fixed then git.exe no longer hangs. If I were on the git team and received a report "git has a bug, and when we fixed our bugs the git bug went away" then I would want to see more research and evidence to substantiate the claim that there's a bug in git. On the surface it's easy for it to sound like the bug must have been in the caller, rather than in git. And I can't tell if it's git.exe's fault, or if it's the fault of the C runtime implementation from whichever compiler is used to build git.exe for Windows, or if it's an inherent OS issue involving pipes that take over the current console, or something else. So, I'm not interested in spending time to come up with a minimal repro for the problem occurring in git.exe. It's not worth the couple of days of investment if no one else has encountered similar problems in a console mode .exe program that invoke git repeatedly in rapid succession (and I think such programs are exceedingly rare to begin with). There isn't enough info to file an actionable issue, and I typically avoid filing an unsubstantiated claim against some code base, because I intensely dislike receiving such claims myself. They're expensive to respond to in a polite and constructive manner, and the first two questions will always be "how can I investigate this without installing 3 other programs and learning how to configure them and use them well enough to reproduce the problem -- and how have you reached the conclusion that the problem isn't in one of the other programs?" 😉 |
Version Information
Cmder Edition
Cmder Full (with Git)
Description of the issue
[Bug] 连续ctrl+c ,窗口卡死
How to reproduce
连续ctrl+c
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: