-
Notifications
You must be signed in to change notification settings - Fork 13k
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
The compiler keeps going on Ctrl-C #124212
Comments
Do you have a reproducer? I have not run into this myself. The implementation should also ensure that the compiler exits promptly if you hit ctrl+c again. Does it? |
if stuff keeps going on ctrl+c, sometimes suspending the process (ctrl+z) and then killing the terminal does the trick somehow 😅 |
Unfortunately no, I encountered this during some rustc hacking where I ended up getting well over 1k error messages in the standard library build and that turned out to be hard to cancel.
I thought I had tried that, but I am not entirely sure. |
Is it possible the shell is part of the problem? If, by the time you hit ctrl-c, it's working through a large amount of output it still has buffered then it might be awhile before you see a response. |
It's possible, sure -- but usually it reacts to Ctrl-C immediately even when there's tons of output. |
Have you tried reverting #111769 to check if that fixes it? |
No. At the time I was busy getting a PR done and now I don't have a reproducing example any more. |
#111769 only checks for ctrl-c during const eval, so if no const eval runs for an extended period of time, the ctrl-c will be silently ignored. This is not the only problem with that PR. It also caused #124265, and shows the "compilation was interrupted" error after the prompt is already drawn by bash. |
is there a good way to make rustc loop endlessly without ever touching const eval? maybe via the trait solver? 🤔 it would help for debugging this. |
Yeah, just take any
I-hang
bjorn3's analysis checks out. |
cool! I wasn't sure how much of the compiler's code flowed through const-eval, is why I asked. |
I'll post a PR that adds a timeout later today, but by all means if you feel strongly just put up a PR. The initial handler here was just added through the normal PR process, there's no reason to be more cautious on reverting or modifying it. |
Exit the process a short time after entering our ctrl-c handler Fixes rust-lang#124212 r? `@bjorn3`
Rollup merge of rust-lang#125523 - saethlin:ctrlc-timeout, r=bjorn3 Exit the process a short time after entering our ctrl-c handler Fixes rust-lang#124212 r? `@bjorn3`
Exit the process a short time after entering our ctrl-c handler Fixes rust-lang/rust#124212 r? `@bjorn3`
Sometimes when things go really wrong the compiler emits a ton of error messages. This can actually take a while to render them all. And since somewhat recently, hitting Ctrl-C no longer interrupts that, I get a thousand error messages displayed after Ctrl-C.
I suspect this may have to do with #111769. The Ctrl-C handler does nothing at all on the first Ctrl-C unless the compiler is in the middle of const-eval.
Cc @saethlin
The text was updated successfully, but these errors were encountered: