-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rustc compiler panic prints to stdout - breaks RLS comms #48816
Comments
This looks like we're printing the |
@nrc that's exactly what it looks like. I'm getting this consistently too, with the stdout each panic now requires an Rls & Rls client restart :(. The panic themselves seem to occur at certain situations when the code won't compile, ie I encounter it eventually by editing code. |
Weird indeed @alexheretic, maybe the full stack trace of the panic might help diagnose the problem. Can you provide a screenshot showing the stack frames above |
The traces themselves seemed very similar to those reported in rust-lang/rls#754. I'll add my trace next time I encounter one. |
(What is a "RI"?) |
|
That is something I can clarify easily. |
Can we reproduce this running from the command line? |
Should be plenty of ICEs to pick from in the repo :) |
Here's the output of one from just now
And the stdout
|
Could rls be executing rustc after a panic in such a way to cause stdout? Though I don't imagine it's running |
Ok clearly the panic comes from
However, added a couple of weeks ago by #48266 is what strongly seems to be source of this issue: // librustc_driver/lib.rs
...
/// Get a list of extra command-line flags provided by the user, as strings.
///
/// This function is used during ICEs to show more information useful for
/// debugging, since some ICEs only happens with non-default compiler flags
/// (and the users don't always report them).
fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
let mut args = Vec::new();
for arg in env::args_os() {
args.push(arg.to_string_lossy().to_string());
}
let matches = if let Some(matches) = handle_options(&args) { ... As this code uses It makes sense to return |
@pietroalbini, it seems that the ICE message PR had some unintended side-effects |
…rister fix rust-lang#48816 don't print help on indirect compiler ICE rust-lang#48816 (comment)
With this bug I'm less interested in the rustc bugs themselves rather that they can cause output to stdout. Doing so is unacceptable for the Rls as it breaks jsonrpc, and in a way that is not currently recoverable by vscode-jsonrpc library (used by atom & vscode RLS clients).
Is there any way we can minimise the possibility of rustc printing stdout in RLS usage?
Rustc stdout after panic
For example, printing the help instead to stderr would be enough to prevent jsonrpc abuse in RLS.
Atom console
The text was updated successfully, but these errors were encountered: