Skip to content

ICE: DepNode Hir(btrs[5509]::metainfo[0]::torrent[0]::Torrent[0]::source[0]) should have been pre-allocated but wasn't #67983

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

Closed
95th opened this issue Jan 7, 2020 · 13 comments
Labels
A-incr-comp Area: Incremental compilation 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-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@95th
Copy link
Contributor

95th commented Jan 7, 2020

Rust version: 1.40.0
Platform: Ubuntu 18.04

error: internal compiler error: src/librustc/dep_graph/graph.rs:680: DepNode Hir(btrs[5509]::metainfo[0]::torrent[0]::Torrent[0]::source[0]) should have been pre-allocated but wasn't.
Backtrace:
error: internal compiler error: src/librustc/dep_graph/graph.rs:680: DepNode Hir(btrs[5509]::metainfo[0]::torrent[0]::Torrent[0]::source[0]) should have been pre-allocated but wasn't.

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:931:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1028
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:468
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::bug
  14: rustc_errors::Handler::bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::bug_fmt
  21: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  22: rustc::dep_graph::graph::DepGraph::try_mark_green
  23: rustc::dep_graph::graph::DepGraph::try_mark_green_and_read
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  25: <rustc_typeck::outlives::implicit_infer::InferVisitor as rustc::hir::itemlikevisit::ItemLikeVisitor>::visit_item
  26: rustc::hir::Crate::visit_all_item_likes
  27: rustc_typeck::outlives::inferred_outlives_crate
  28: rustc::dep_graph::graph::DepGraph::with_task_impl
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::force_query
  30: rustc::ty::query::plumbing::force_from_dep_node
  31: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  32: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  33: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  34: rustc::dep_graph::graph::DepGraph::try_mark_green
  35: rustc::dep_graph::graph::DepGraph::try_mark_green_and_read
  36: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  37: <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item
  38: rustc::hir::map::Map::visit_item_likes_in_module
  39: rustc_typeck::collect::collect_mod_item_types
  40: rustc::ty::query::__query_compute::collect_mod_item_types
  41: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute
  42: rustc::dep_graph::graph::DepGraph::with_task_impl
  43: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  44: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query
  45: rustc_typeck::check_crate::{{closure}}::{{closure}}
  46: rustc::util::common::time
  47: rustc_typeck::check_crate
  48: rustc_interface::passes::analysis
  49: rustc::ty::query::__query_compute::analysis
  50: rustc::dep_graph::graph::DepGraph::with_task_impl
  51: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  52: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  53: rustc_interface::passes::create_global_ctxt::{{closure}}
  54: rustc_interface::passes::BoxedGlobalCtxt::enter
  55: rustc_interface::interface::run_compiler_in_existing_thread_pool
  56: std::thread::local::LocalKey<T>::with
  57: scoped_tls::ScopedKey<T>::set
  58: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.40.0 (73528e339 2019-12-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_of] processing `metainfo::torrent::Torrent::source`
#1 [inferred_outlives_crate] computing the inferred outlives predicates for items in this crate
#2 [predicates_of] processing `data::fs::FileSystemStorage`
#3 [collect_mod_item_types] collecting item types in module `data::fs`
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
@95th
Copy link
Contributor Author

95th commented Jan 7, 2020

If I ran cargo clean and then cargo check again, the error stopped coming. 🤔

@jonas-schievink
Copy link
Contributor

Can you provide the source code needed to reproduce this?

@jonas-schievink jonas-schievink added A-incr-comp Area: Incremental compilation 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-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 7, 2020
@95th
Copy link
Contributor Author

95th commented Jan 7, 2020

The (not a lot of) code is at:
https://github.com/95th/btrs

I myself cant reproduce with the same code now.. I tried cargo clean once and now it doesnt ICE.

@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 7, 2020
@eloraiby
Copy link

eloraiby commented Jan 17, 2020

Have similar issue:

error: internal compiler error: src/librustc/dep_graph/graph.rs:680: DepNode Hir(manifold[2147]::manifold[0]::Vertex[0]::position[0]) should have been pre-allocated but wasn't.

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:931:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1028
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:188
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:205
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:468
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::bug
  14: rustc_errors::Handler::bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::bug_fmt
  21: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  22: rustc::dep_graph::graph::DepGraph::try_mark_green
  23: rustc::dep_graph::graph::DepGraph::try_mark_green_and_read
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  25: <rustc_typeck::outlives::implicit_infer::InferVisitor as rustc::hir::itemlikevisit::ItemLikeVisitor>::visit_item
  26: rustc::hir::Crate::visit_all_item_likes
  27: rustc_typeck::outlives::inferred_outlives_crate
  28: rustc::ty::query::__query_compute::inferred_outlives_crate
  29: rustc::dep_graph::graph::DepGraph::with_task_impl
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  31: rustc_typeck::outlives::inferred_outlives_of
  32: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::inferred_outlives_of>::compute
  33: rustc::dep_graph::graph::DepGraph::with_task_impl
  34: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::force_query
  35: rustc::ty::query::plumbing::force_from_dep_node
  36: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  37: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  38: rustc::dep_graph::graph::DepGraph::try_mark_green
  39: rustc::dep_graph::graph::DepGraph::try_mark_green_and_read
  40: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  41: <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item
  42: rustc::hir::map::Map::visit_item_likes_in_module
  43: rustc_typeck::collect::collect_mod_item_types
  44: rustc::ty::query::__query_compute::collect_mod_item_types
  45: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute
  46: rustc::dep_graph::graph::DepGraph::with_task_impl
  47: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  48: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query
  49: rustc_typeck::check_crate::{{closure}}::{{closure}}
  50: rustc::util::common::time
  51: rustc_typeck::check_crate
  52: rustc_interface::passes::analysis
  53: rustc::ty::query::__query_compute::analysis
  54: rustc::dep_graph::graph::DepGraph::with_task_impl
  55: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  56: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  57: rustc_interface::passes::create_global_ctxt::{{closure}}
  58: rustc_interface::passes::BoxedGlobalCtxt::enter
  59: rustc_interface::interface::run_compiler_in_existing_thread_pool
  60: std::thread::local::LocalKey<T>::with
  61: scoped_tls::ScopedKey<T>::set
  62: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.40.0 (73528e339 2019-12-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_of] processing `manifold::Vertex::position`
#1 [inferred_outlives_crate] computing the inferred outlives predicates for items in this crate
#2 [inferred_outlives_of] processing `manifold::EdgeHandle`
#3 [predicates_of] processing `manifold::EdgeHandle`
#4 [collect_mod_item_types] collecting item types in module `manifold`
#5 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

running cargo clean and then cargo build fixes the issue.

@jonas-schievink
Copy link
Contributor

It is unlikely that we will be able to do anything here unless:

  • This is reproducible on nightly
  • A reliable way to reproduce the issue is found (eg. two commits that cause the issue when built in sequence)

@95th
Copy link
Contributor Author

95th commented Jan 26, 2020

Closing as I don't have an MCVE and it doesn't reproduce even with the same code.

@95th 95th closed this as completed Jan 26, 2020
@eloraiby
Copy link

Wait, this is a bug, being hard to produce doesn't mean it doesn't exist. It should be reopened as it's not solved. Worst case put it to low priority, but definitely not closed.

@95th
Copy link
Contributor Author

95th commented Jan 26, 2020

Sure.. I guess if someone else finds an MCVE, they can post here.

@95th 95th reopened this Jan 26, 2020
@grenewode
Copy link

I am also seeing this issue. For me, it happened after I did something like this:

  1. Create a new library project with https://github.com/grenewode/replicate_67983/releases/tag/trait_foo
// ./src/lib.rs:

pub trait Foo {
    a_value(&self) -> u8;
}

pub struct Bar {
    foo: Box<dyn Foo>
}

impl Bar {
    pub fn use_my_foo(&self) -> u8 {
        self.foo.a_value()
    }
}
  1. Build with cargo build
  2. Refactor Foo to be a struct https://github.com/grenewode/replicate_67983/releases/tag/struct_foo
// ./src/lib.rs:

pub struct Foo {
    a_value: u8
}

pub struct Bar {
    foo: Foo
}

impl Bar {
    pub fn use_my_foo(&self) -> u8 {
        // Forget to change this to self.foo.a_value
        self.foo.a_value()
    }
}
  1. Build with cargo build gives this build log

@grenewode
Copy link

This was using rustc 1.41.0 (5e1a79984 2020-01-27) running on x86_64-unknown-linux-gnu

@grenewode
Copy link

This does not occur when I am using cargo +nightly build

@eloraiby
Copy link

@grenewode does it happen systematically when you do these steps on rust-stable ?

@jonas-schievink
Copy link
Contributor

Closing in favor of #69596, which has a reliable reproduction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation 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-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

5 participants