Skip to content

Compiler panic with '-Z instrument-coverage' on 1.48.0 w/ RUSTC_BOOTSTRAP=1 #81669

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
timkordas opened this issue Feb 2, 2021 · 4 comments
Closed
Labels
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

@timkordas
Copy link

Meta

Compiler panic with '-Z instrument-coverage' on 1.48.0 w/ RUSTC_BOOTSTRAP=1

Running with RUSTC_BOOTSTRAP=1

$ RUSTC_BOOTSTRAP=1 RUST_BACKTRACE=1 rustc --version --verbose
rustc 1.48.0 (7eac88abb 2020-11-16)
binary: rustc
commit-hash: 7eac88abb2e57e752f3302f02be5f3ce3d7adfb4
commit-date: 2020-11-16
host: x86_64-apple-darwin
release: 1.48.0
LLVM version: 11.0

Error output

$ RUSTC_BOOTSTRAP=1 RUST_BACKTRACE=1 cargo test -p workflow
   Compiling typenum v1.12.0
   Compiling once_cell v1.5.2
   Compiling serde_json v1.0.61
   Compiling percent-encoding v2.1.0
   Compiling slab v0.4.2
   Compiling matches v0.1.8
   Compiling pin-utils v0.1.0
   Compiling ahash v0.4.7
   Compiling futures-io v0.3.12
   Compiling byteorder v1.4.2
error: internal compiler error: compiler/rustc_mir/src/transform/instrument_coverage.rs:411:14: start.file.name should be a RealFileName, but it was: Real(Devirtualized { local_path: "/Users/tim/.rustup/toolchains/1.48.0-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/macros/mod.rs", virtual_name: "/rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/macros/mod.rs" })

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
   Compiling tinyvec_macros v0.1.0
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::transform::instrument_coverage::Instrumentor::inject_statement
   9: <rustc_mir::transform::instrument_coverage::InstrumentCoverage as rustc_mir::transform::MirPass>::run_pass
  10: rustc_mir::transform::run_passes
  11: rustc_mir::transform::mir_promoted
  12: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  14: rustc_data_structures::stack::ensure_sufficient_stack
  15: rustc_query_system::query::plumbing::get_query_impl
  16: rustc_mir::borrow_check::mir_borrowck
  17: core::ops::function::FnOnce::call_once
  18: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  19: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  20: rustc_data_structures::stack::ensure_sufficient_stack
  21: rustc_query_system::query::plumbing::get_query_impl
  22: rustc_mir::borrow_check::type_check::TypeChecker::check_rvalue
  23: rustc_mir::borrow_check::type_check::TypeChecker::typeck_mir
  24: rustc_mir::borrow_check::type_check::type_check
  25: rustc_mir::borrow_check::nll::compute_regions
  26: rustc_mir::borrow_check::do_mir_borrowck
  27: rustc_infer::infer::InferCtxtBuilder::enter
  28: rustc_mir::borrow_check::mir_borrowck
  29: core::ops::function::FnOnce::call_once
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_data_structures::stack::ensure_sufficient_stack
  33: rustc_query_system::query::plumbing::get_query_impl
  34: rustc_query_system::query::plumbing::ensure_query_impl
  35: rustc_session::utils::<impl rustc_session::session::Session>::time
  36: rustc_interface::passes::analysis
  37: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  38: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  39: rustc_data_structures::stack::ensure_sufficient_stack
  40: rustc_query_system::query::plumbing::get_query_impl
  41: rustc_interface::passes::QueryContext::enter
  42: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  43: rustc_span::with_source_map
  44: scoped_tls::ScopedKey<T>::set
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0 (7eac88abb 2020-11-16) running on x86_64-apple-darwin

note: compiler flags: -Z instrument-coverage -C embed-bitcode=no -C debuginfo=2 --crate-type lib

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

query stack during panic:
#0 [mir_promoted] processing `<unsync::Lazy<T, F> as std::ops::DerefMut>::deref_mut::{closure#0}`
#1 [mir_borrowck] borrow-checking `<unsync::Lazy<T, F> as std::ops::DerefMut>::deref_mut::{closure#0}`
#2 [mir_borrowck] borrow-checking `<unsync::Lazy<T, F> as std::ops::DerefMut>::deref_mut`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `once_cell`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: internal compiler error: compiler/rustc_mir/src/transform/instrument_coverage.rs:411:14: start.file.name should be a RealFileName, but it was: Real(Devirtualized { local_path: "/Users/tim/.rustup/toolchains/1.48.0-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/macros.rs", virtual_name: "/rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/macros.rs" })

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_mir::transform::instrument_coverage::Instrumentor::inject_statement
   9: <rustc_mir::transform::instrument_coverage::InstrumentCoverage as rustc_mir::transform::MirPass>::run_pass
  10: rustc_mir::transform::run_passes
  11: rustc_mir::transform::mir_promoted
  12: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  14: rustc_data_structures::stack::ensure_sufficient_stack
  15: rustc_query_system::query::plumbing::get_query_impl
  16: rustc_mir::borrow_check::mir_borrowck
  17: core::ops::function::FnOnce::call_once
  18: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  19: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  20: rustc_data_structures::stack::ensure_sufficient_stack
  21: rustc_query_system::query::plumbing::get_query_impl
  22: rustc_mir::borrow_check::type_check::TypeChecker::check_rvalue
  23: rustc_mir::borrow_check::type_check::TypeChecker::typeck_mir
  24: rustc_mir::borrow_check::type_check::type_check
  25: rustc_mir::borrow_check::nll::compute_regions
  26: rustc_mir::borrow_check::do_mir_borrowck
  27: rustc_infer::infer::InferCtxtBuilder::enter
  28: rustc_mir::borrow_check::mir_borrowck
  29: core::ops::function::FnOnce::call_once
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_data_structures::stack::ensure_sufficient_stack
  33: rustc_query_system::query::plumbing::get_query_impl
  34: rustc_query_system::query::plumbing::ensure_query_impl
  35: rustc_session::utils::<impl rustc_session::session::Session>::time
  36: rustc_interface::passes::analysis
  37: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  38: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  39: rustc_data_structures::stack::ensure_sufficient_stack
  40: rustc_query_system::query::plumbing::get_query_impl
  41: rustc_interface::passes::QueryContext::enter
  42: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  43: rustc_span::with_source_map
  44: scoped_tls::ScopedKey<T>::set
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0 (7eac88abb 2020-11-16) running on x86_64-apple-darwin

note: compiler flags: -Z instrument-coverage -C embed-bitcode=no -C debuginfo=2 --crate-type bin

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

query stack during panic:
#0 [mir_promoted] processing `op::write_op_macro::{closure#7}`
#1 [mir_borrowck] borrow-checking `op::write_op_macro::{closure#7}`
#2 [mir_borrowck] borrow-checking `op::write_op_macro`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: build failed
@timkordas timkordas added 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 Feb 2, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 2, 2021

@timkordas can you reproduce this on nightly? RUSTC_BOOTSTRAP isn't supported on stable.

@wesleywiser
Copy link
Member

This also looks very similar to a bug we had a while ago which was fixed (#79393).

@timkordas
Copy link
Author

with nightly it appears to have a different problem
nightly-x86_64-apple-darwin unchanged - rustc 1.51.0-nightly (04caa63 2021-01-30)

error: internal compiler error: failed to process buffered lint here
...
    = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:974:13
stack backtrace:
   0:        0x11390b14c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd841328aa7dc06cc
   1:        0x11396f64d - core::fmt::write::hefe95a44532fe6ed
   2:        0x1138fd566 - std::io::Write::write_fmt::haeb49d4f9ecd789d
   3:        0x11390f019 - std::panicking::default_hook::{{closure}}::h465a961bccd4d390
   4:        0x11390eba9 - std::panicking::default_hook::h7e189743c9acab0a
   5:        0x10bc02b18 - rustc_driver::report_ice::h560f670b897314ed
   6:        0x11390f7fe - std::panicking::rust_panic_with_hook::he74e9eac8174d6dd
   7:        0x11390f305 - std::panicking::begin_panic_handler::{{closure}}::h122c1e0e85c150a9
   8:        0x11390b608 - std::sys_common::backtrace::__rust_end_short_backtrace::he103784f07f740ac
   9:        0x11390f26a - _rust_begin_unwind
  10:        0x11399725b - std::panicking::begin_panic_fmt::h9385c4006b676237
  11:        0x1101fb1e6 - rustc_errors::HandlerInner::flush_delayed::ha814ae8fc66f459e
  12:        0x1101f73cb - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h604d573a9d19f76b
  13:        0x10bc45d0d - core::ptr::drop_in_place<rustc_session::parse::ParseSess>::he1042ff96c3a2292
  14:        0x10bc4c9a8 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::hbbedb60f235c87aa
  15:        0x10bc47095 - core::ptr::drop_in_place<rustc_interface::interface::Compiler>::h32ce24398f080a07
  16:        0x10bc320b1 - rustc_span::with_source_map::hb15b187d8726f95a
  17:        0x10bbb3ed4 - rustc_interface::interface::create_compiler_and_run::h676e33808641f5cb
  18:        0x10bc3e713 - std::sys_common::backtrace::__rust_begin_short_backtrace::h17f5da3f25073b11
  19:        0x10bbdd9a9 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h099c825c1a0d0ef5
  20:        0x11391ca0d - std::sys::unix::thread::Thread::new::thread_start::h23116ad77b076564
  21:     0x7fff72a08109 - __pthread_start

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (04caa632d 2021-01-30) running on x86_64-apple-darwin

note: compiler flags: -Z macro-backtrace -Z instrument-coverage -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
error: build failed

@timkordas
Copy link
Author

and that looks exactly like: #81531 which appears to have a merged fix, I'll try the next nightly and see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

3 participants