-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
never finishes after emitting error diagnostic
#116996
Comments
Can you share the top and bottom 200 frames (or ideally all of them)? The ones you shared aren't really useful if trying to diagnose exactly how we got here. |
Here's a gist of all of the frames in the callstack I captured. I added it to the main issue description as well. |
After letting the compiler run for 30+ minutes, we managed to get a rustc-ice during selection which comes with a very large backtrace. |
I ran our build again, and it produced essentially the same ice, so good news it's repeatable. The downside is it was compiling for about 7 hours for the ICE to occur :) |
After some bisecting and code reduction, it looks like this may be related to #87012 |
rustc
never finishes after emitting partial error diagnosticrustc
never finishes after emitting error diagnostic
This is an attempt to reduce the amount of namespace globs to see if it can help out with the trait expansion bug rust-lang/rust#116996. Change-Id: I58b6aa8484bab186980b76ccea1fcd34091b60ed Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/941676 Fuchsia-Auto-Submit: Erick Tryzelaar <[email protected]> Commit-Queue: Auto-Submit <[email protected]> Reviewed-by: Kevin Lindkvist <[email protected]>
Example use std::collections::{BTreeMap, HashMap, HashSet};
use std::sync::{Arc, RwLock, Weak};
pub struct Kernel {
pub pids: RwLock<PidTable>,
}
pub struct PidTable {
table: HashMap<u32, PidEntry>,
}
struct PidEntry {
process_group: Option<Weak<ProcessGroup>>,
}
pub struct ProcessGroupMutableState {
thread_groups: BTreeMap<u32, Weak<ThreadGroup>>,
}
pub struct ProcessGroup {
mutable_state: RwLock<ProcessGroupMutableState>,
}
pub struct Task {
fs: Option<Arc<FsContext>>,
}
pub struct ThreadGroup {
pub kernel: Arc<Kernel>,
mutable_state: RwLock<ThreadGroupMutableState>,
}
pub struct ThreadGroupMutableState {
tasks: BTreeMap<u32, TaskContainer>,
}
pub struct TaskContainer(Arc<Task>);
pub struct FileSystem {
pub kernel: Weak<Kernel>,
}
struct FsContextState {
namespace: Arc<Namespace>,
}
pub struct FsContext {
state: RwLock<FsContextState>,
}
pub struct Namespace {
root_mount: Arc<Mount>,
}
pub struct Mount {
fs: Arc<FileSystem>,
state: RwLock<MountState>,
}
pub struct MountState {
submounts: HashMap<Arc<ERROR>, Arc<Mount>>,
peer_group_: Option<(Arc<PeerGroup>, Arc<Mount>)>, // +6s
upstream_: Option<(Weak<PeerGroup>, Arc<Mount>)>, // +5s
}
struct PeerGroup {
state: RwLock<PeerGroupState>,
}
struct PeerGroupState {
downstream: HashSet<Arc<Mount>>,
}
pub trait SocketOps: Send + Sync {} // + Sync = +5s
struct UEventNetlinkSocket {
kernel: Arc<Kernel>,
}
impl SocketOps for UEventNetlinkSocket {} // load-bearing
fn main() {} The above is:
This behavior started in 1.73:
I'm pretty sure it appeared in
|
This issue was identified in Fuchsia. We're were unable to move this issue out of tree for reproduction.
Adding a relatively innocuous
HashMap<u32, String>
field to an existing struct causes the compiler to hang forever:Right before it hangs, it prints:
The trailing pipe seems to suggest that some additional diagnostic information is intended to be printed. Adding
use std::collections::HashMap;
to the file fixes the error and causes the compilation to finish normally.By attaching to a debug build with gdb, we were able to capture a full call stack. We noticed that the call stack contained many repetitions of this particular set of frames:
In our case, the total number of frames reached about 2500. It looks like this may be hitting some kind of exponential computation edge case.
Potentially related: #116914
Meta
rustc --version --verbose
:This is a custom-built toolchain following our toolchain build instructions.
The text was updated successfully, but these errors were encountered: