Skip to content
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 doesn't finish stuck at rustc_trait_selection::traits::normalize::normalize_with_depth_to #132032

Open
fabianmurariu opened this issue Oct 22, 2024 · 7 comments
Labels
A-traits Area: Trait system C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fabianmurariu
Copy link

After a re factoring, moving some structs into different crates the build won't finish.
Raphtory

These finish

cargo check -p raphtory-api
cargo check -p raphtory-memstorage

This doesn't

cargo check -p raphtory

I need some help to track down what causes this?
I suspect our use of traits is the cause of this but I don't know how to find out which ones are causing this issue.

I expected to see this happen: cargo would finish compiling

Instead, this happened: cargo doesn't finish compiling

Meta

rustc --version --verbose:

rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1
The end of Rustc LOG where depth seems to degenerate

rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=0, value=ImplHeader { impl_def_id: DefId(2:2820 ~ core[d898]::ptr::{impl#0}), impl_args: [?0t], self
_ty: ?0t, trait_ref: Some(<_ as std::cmp::PartialEq>), predicates: [Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder {
value: TraitPredicate(<_ as std::marker::FnPtr>, polarity:Positive), bound_vars: [] }] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=0, value=ImplHeader { impl_def_id: DefId(0:5278 ~ raphtory[29e2]::db::graph::graph::{impl#1}), impl_
args: ['?0, ?1t], self_ty: raphtory_memstorage::db::graph::views::graph::Graph, trait_ref: Some(<raphtory_memstorage::db::graph::views::graph::Graph as std::cmp::PartialEq<_
>>), predicates: [Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<_ as db::api::view::graph::
GraphViewOps<'_>>, polarity:Positive), bound_vars: [] }, Binder { value: OutlivesPredicate(raphtory_memstorage::db::graph::views::graph::Graph, '?0), bound_vars: [] }] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=<_ as db::api::view::graph::GraphViewOps<'_>>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=<_ as db::api::view::graph::GraphViewOps<'_>>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [
] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as db::api::view::internal::BoxableGraphView>, polarity:P
ositive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as std::clone::Clone>, polarity:Positive), bound_vars: []
 }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(?2t, '?1), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(?2t, '?1), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=3, value=<_ as db::api::view::internal::BoxableGraphView>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=3, value=<_ as db::api::view::internal::BoxableGraphView>
...
 
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=Binder { value: TraitPredicate(<alloc::raw_vec::RawVecInner as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=std::ptr::Unique<u8>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=alloc::raw_vec::Cap
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=std::alloc::Global
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=<std::ptr::Unique<_> as std::marker::Sync>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=<std::ptr::Unique<_> as std::marker::Sync>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<_ as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=68, value=Binder { value: TraitPredicate(<u8 as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<alloc::raw_vec::Cap as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=usize
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=68, value=Binder { value: TraitPredicate(<usize as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<std::alloc::Global as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=Binder { value: TraitPredicate(<std::marker::PhantomData<u8> as std::marker::Sync>, polarity:Positive), bound_vars: [] }

@fabianmurariu fabianmurariu added the C-bug Category: This is a bug. label Oct 22, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 22, 2024
@yingmanwumen
Copy link

Hi, I'm trying to reproduce it and the rustc doesn't stop as described. And I am curious about how the rustc log messages are enabled ^_^ Should I add some environment variables or just pass some arguments to cargo? @fabianmurariu

@fmease fmease added A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 22, 2024
@fmease
Copy link
Member

fmease commented Oct 22, 2024

Can repro.

@fmease fmease added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Oct 22, 2024
@fmease
Copy link
Member

fmease commented Oct 22, 2024

(Potentially fixed by the next-gen solver, though I can't check this without an MCVE as the next-gen solver hangs on rayon atm which is a dependency of Raphtory)

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Oct 22, 2024

I can't repro on nightly rustc 1.84.0-nightly (439284741 2024-10-21)

I wonder if this was fixed by coherence stabilisation, can't really check myself right now because the servers will only give me 20 kb/s downloading the respective nightlies :/

@fabianmurariu
Copy link
Author

fabianmurariu commented Oct 22, 2024

Hi, I'm trying to reproduce it and the rustc doesn't stop as described. And I am curious about how the rustc log messages are enabled ^_^ Should I add some environment variables or just pass some arguments to cargo? @fabianmurariu

I used RUSTC_LOG=debug

@yingmanwumen
Copy link

I suspect our use of traits is the cause of this but I don't know how to find out which ones are causing this issue.

I've read the logs and found that the trait GraphViewOps was suspicious. Or more specifically, the trait BoxableGraphView might cause the dead loop. And the structure TimeIndexEntry in TCell is definitely related. But more details are still unclear for me :-) @fabianmurariu

@lqd
Copy link
Member

lqd commented Oct 22, 2024

I wonder if this was fixed by coherence stabilisation

It looks like this doesn't hang on a0c2aba (builds with errors in 4s) but does on its parent f79fae3 (I didn't check logs to see if it actually hangs, just stopped it after 5 minutes or so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants