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

ICE encountered in 1.37 stable borrowck #64365

Closed
spacejam opened this issue Sep 10, 2019 · 3 comments
Closed

ICE encountered in 1.37 stable borrowck #64365

spacejam opened this issue Sep 10, 2019 · 3 comments
Labels
A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. 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

@spacejam
Copy link

spacejam commented Sep 10, 2019

reproduction branch:
https://github.com/spacejam/sled/tree/tyler_ice_ice_baby

the last commit is the one-line-change that induces the panic

rustc 1.37.0 (eae3437 2019-08-13) running on x86_64-unknown-linux-gnu

λ cargo build --verbose
       Fresh unicode-xid v0.2.0
       Fresh semver-parser v0.7.0
       Fresh autocfg v0.1.6
       Fresh scopeguard v1.0.0
       Fresh nodrop v0.1.13
       Fresh smallvec v0.6.10
       Fresh lazy_static v1.4.0
       Fresh cfg-if v0.1.9
       Fresh semver v0.9.0
       Fresh lock_api v0.3.1
       Fresh proc-macro2 v1.0.3
       Fresh rustc_version v0.2.3
       Fresh libc v0.2.62
       Fresh crossbeam-utils v0.6.6
       Fresh byteorder v1.3.2
       Fresh arrayvec v0.4.11
       Fresh crc32fast v1.2.0
       Fresh quote v1.0.2
       Fresh crossbeam-channel v0.3.9
       Fresh fxhash v0.2.1
       Fresh fs2 v0.4.3
       Fresh log v0.4.8
       Fresh syn v1.0.5
       Fresh serde_derive v1.0.100
       Fresh memoffset v0.5.1
       Fresh parking_lot_core v0.6.2
       Fresh serde v1.0.100
       Fresh crossbeam-epoch v0.7.2
       Fresh parking_lot v0.9.0
       Fresh bincode v1.1.4
       Fresh serde_bytes v0.11.2
       Fresh pagecache v0.19.3 (/home/t/src/sled/crates/pagecache)
   Compiling sled v0.27.0 (/home/t/src/sled/crates/sled)
     Running `rustc --edition=2018 --crate-name sled /home/t/src/sled/crates/sled/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=2acb3c3e0ff06fc3 -C extra-filename=-2acb3c3e0ff06fc3 --out-dir /home/t/src/sled-debug/target/debug/deps -C incremental=/home/t/src/sled-debug/target/debug/incremental -L dependency=/home/t/src/sled-debug/target/debug/deps --extern log=/home/t/src/sled-debug/target/debug/deps/liblog-4e901f1a3fefb1b6.rlib --extern pagecache=/home/t/src/sled-debug/target/debug/deps/libpagecache-f5439c50a69613b4.rlib --extern parking_lot=/home/t/src/sled-debug/target/debug/deps/libparking_lot-bca2b5a814139bef.rlib --extern serde=/home/t/src/sled-debug/target/debug/deps/libserde-9bd90558114cf56f.rlib --extern serde_bytes=/home/t/src/sled-debug/target/debug/deps/libserde_bytes-1a92f9f5462d075a.rlib`
thread 'rustc' panicked at 'assertion failed: self.bccx.region_scope_tree.scopes_intersect(old_loan.kill_scope,
                                             new_loan.kill_scope)', src/librustc_borrowck/borrowck/check_loans.rs:493:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: rustc::util::common::panic_hook
   7: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:481
   8: std::panicking::begin_panic
   9: rustc_borrowck::borrowck::check_loans::CheckLoanCtxt::report_error_if_loans_conflict
  10: rustc_borrowck::dataflow::DataFlowContext<O>::each_bit_on_entry
  11: <rustc_borrowck::borrowck::check_loans::CheckLoanCtxt as rustc::middle::expr_use_visitor::Delegate>::borrow
  12: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  13: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  14: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  15: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  16: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  17: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  18: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  19: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  20: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  21: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  22: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  23: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  24: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  25: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  26: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  27: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  28: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  29: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  30: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  31: rustc::middle::expr_use_visitor::ExprUseVisitor::consume_expr
  32: rustc_borrowck::borrowck::check_loans::check_loans
  33: rustc_borrowck::borrowck::borrowck
  34: rustc::ty::query::__query_compute::borrowck
  35: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::borrowck>::compute
  36: rustc::dep_graph::graph::DepGraph::with_task_impl
  37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  38: rustc_mir::borrow_check::do_mir_borrowck
  39: rustc::ty::context::GlobalCtxt::enter_local
  40: rustc_mir::borrow_check::mir_borrowck
  41: rustc::ty::query::__query_compute::mir_borrowck
  42: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::mir_borrowck>::compute
  43: rustc::dep_graph::graph::DepGraph::with_task_impl
  44: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  45: rustc::ty::<impl rustc::ty::context::TyCtxt>::par_body_owners
  46: rustc::util::common::time
  47: rustc_interface::passes::analysis
  48: rustc::ty::query::__query_compute::analysis
  49: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute
  50: rustc::dep_graph::graph::DepGraph::with_task_impl
  51: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  52: rustc::ty::context::tls::enter_global
  53: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  54: rustc_interface::passes::create_global_ctxt::{{closure}}
  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.
query stack during panic:
#0 [borrowck] processing `<iter::Iter as std::iter::Iterator>::next`
#1 [mir_borrowck] processing `<iter::Iter as std::iter::Iterator>::next`
#2 [analysis] running analysis passes on this crate
end of query stack

error: internal compiler error: unexpected panic

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.37.0 (eae3437df 2019-08-13) 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

error: Could not compile `sled`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name sled /home/t/src/sled/crates/sled/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=2acb3c3e0ff06fc3 -C extra-filename=-2acb3c3e0ff06fc3 --out-dir /home/t/src/sled-debug/target/debug/deps -C incremental=/home/t/src/sled-debug/target/debug/incremental -L dependency=/home/t/src/sled-debug/target/debug/deps --extern log=/home/t/src/sled-debug/target/debug/deps/liblog-4e901f1a3fefb1b6.rlib --extern pagecache=/home/t/src/sled-debug/target/debug/deps/libpagecache-f5439c50a69613b4.rlib --extern parking_lot=/home/t/src/sled-debug/target/debug/deps/libparking_lot-bca2b5a814139bef.rlib --extern serde=/home/t/src/sled-debug/target/debug/deps/libserde-9bd90558114cf56f.rlib --extern serde_bytes=/home/t/src/sled-debug/target/debug/deps/libserde_bytes-1a92f9f5462d075a.rlib` (exit code: 101)

edit: confirmed this works without target-cpu=native, edited that out of the text above

@jonas-schievink jonas-schievink added A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. 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. labels Sep 10, 2019
@memoryruins
Copy link
Contributor

It also emits ICE for me on stable 1.37.0. The assert message is the same that occurred in #62107 and #63932. Trying on beta and nightly, it no longer produces an ICE

error[E0596]: cannot borrow `guard` as mutable, as it is not declared as mutable
   --> crates/sled/src/iter.rs:118:21
    |
92  |         let (mut pid, mut node, guard) =
    |                                 ----- help: consider changing this to be mutable: `mut guard`
...
118 |                     guard.repin();
    |                     ^^^^^ cannot borrow as mutable

rustc 1.38.0-beta.5 (d097af105 2019-09-03) / rustc 1.39.0-nightly (0b36e9dea 2019-09-09)

@jonas-schievink
Copy link
Contributor

Closing as fixed then.

@hellow554
Copy link
Contributor

Related: #64453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-borrow-checker Area: The borrow checker C-bug Category: This is a bug. 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

4 participants