You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustup show -v could go beyond the defined timeout during Toolchain::rustc_version() #5228
Currently, rustc_version() issues a rustc subprocess call via child.wait_timeout(Duration::from_secs(10)) and then try to read from child.stdout.unwrap() if the return value is an Ok(Some()).
If a custom rustc wrapper itself spawns a background process inheriting stdout, writes no newline, then exits, wait_timeout returns but read_line can block until the helper writes a newline or closes the pipe. This can hang rustup update or verbose rustup show indefinitely despite the ten-second timeout. Keep stdout collection within the same deadline and handle the case accordingly if no stdout line is available in time.
Further work
Extract the read_line logic so that we can also read the first line from child.stderr.unwrap() in case of a non-zero exit code to enrich the error messages.
changed the title [-]`rustup show -v` could timeout during `Toolchain::rustc_version()`[/-][+]`rustup show -v` could go beyond the defined timeout during `Toolchain::rustc_version()`[/+]on Nov 18, 2026
This is unlikely to happen on official toolchains since create_command() only points to "real" rustc binaries. However linked toolchains can have more flexibility and thus this situation might indeed be possible.
Activity
[-]`rustup show -v` could timeout during `Toolchain::rustc_version()`[/-][+]`rustup show -v` could go beyond the defined timeout during `Toolchain::rustc_version()`[/+]rami3l commentedon Nov 18, 2026
This is unlikely to happen on official toolchains since
create_command()only points to "real"rustcbinaries. However linked toolchains can have more flexibility and thus this situation might indeed be possible.