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

invalid attempt to unwrap a None some_prev with -Cinstrument-coverage #118662

Open
PalmPTSJ opened this issue Dec 6, 2023 · 5 comments
Open

invalid attempt to unwrap a None some_prev with -Cinstrument-coverage #118662

PalmPTSJ opened this issue Dec 6, 2023 · 5 comments
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) 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

@PalmPTSJ
Copy link

PalmPTSJ commented Dec 6, 2023

Code

<code>

This is noticed on this oss-fuzz build for cras. I haven't tried to create a verifiable example, but from the log it is failing on a public crate dbus. It is also failing only when compiling with -Cinstrument-coverage

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (9fad68599 2023-12-03)
binary: rustc
commit-hash: 9fad6859925b34f9a0b1af592a7839ccb1e71f60
commit-date: 2023-12-03
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Error output

error: internal compiler error: compiler/rustc_mir_transform/src/coverage/spans.rs:432:49: invalid attempt to unwrap a None some_prev

thread 'rustc' panicked at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/compiler/rustc_errors/src/lib.rs:1653:9:
Box<dyn Any>
stack backtrace:
   0:     0x7f20ab68250c - std::backtrace_rs::backtrace::libunwind::trace::h6061033325ca8d5f
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f20ab68250c - std::backtrace_rs::backtrace::trace_unsynchronized::h3e9a48c0c4a79b3a
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f20ab68250c - std::sys_common::backtrace::_print_fmt::h985d7a9b6e153b96
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f20ab68250c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcaf5c0187bbeca0c
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f20ab6d5540 - core::fmt::rt::Argument::fmt::h5f37de5ff02bcb40
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/fmt/rt.rs:142:9
   5:     0x7f20ab6d5540 - core::fmt::write::hc8bf769fed76ea64
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f20ab67636f - std::io::Write::write_fmt::h114ebebf8c9b16a9
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/io/mod.rs:1810:15
   7:     0x7f20ab6822f4 - std::sys_common::backtrace::_print::h898ca07f2a79c2cd
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f20ab6822f4 - std::sys_common::backtrace::print::h4b2c3082b37331f3
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f20ab684f87 - std::panicking::default_hook::{{closure}}::hc9ef7d8adff7b1f3
  10:     0x7f20ab684cef - std::panicking::default_hook::h0b53001e401c6ada
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:292:9
  11:     0x7f20ae3e1f90 - std[ca116cedd296397e]::panicking::update_hook::<alloc[f7f5c0c53ccdabe6]::boxed::Box<rustc_driver_impl[4e1279a210f875d1]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f20ab6856c8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2e3061dd490aba0e
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2021:9
  13:     0x7f20ab6856c8 - std::panicking::rust_panic_with_hook::ha3012055304d5173
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:783:13
  14:     0x7f20ae8286d4 - std[ca116cedd296397e]::panicking::begin_panic::<rustc_errors[506d090330ef3b9e]::ExplicitBug>::{closure#0}
  15:     0x7f20ae822916 - std[ca116cedd296397e]::sys_common::backtrace::__rust_end_short_backtrace::<std[ca116cedd296397e]::panicking::begin_panic<rustc_errors[506d090330ef3b9e]::ExplicitBug>::{closure#0}, !>
  16:     0x7f20ae81d416 - std[ca116cedd296397e]::panicking::begin_panic::<rustc_errors[506d090330ef3b9e]::ExplicitBug>
  17:     0x7f20ae805cf4 - <rustc_errors[506d090330ef3b9e]::HandlerInner>::bug::<alloc[f7f5c0c53ccdabe6]::string::String>
  18:     0x7f20ae8059fa - <rustc_errors[506d090330ef3b9e]::Handler>::bug::<alloc[f7f5c0c53ccdabe6]::string::String>
  19:     0x7f20ae8a2ead - rustc_middle[7c00a81cb0b3bac5]::util::bug::opt_span_bug_fmt::<rustc_span[eae331e1b7d19547]::span_encoding::Span>::{closure#0}
  20:     0x7f20ae889f7a - rustc_middle[7c00a81cb0b3bac5]::ty::context::tls::with_opt::<rustc_middle[7c00a81cb0b3bac5]::util::bug::opt_span_bug_fmt<rustc_span[eae331e1b7d19547]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f20ae889e18 - rustc_middle[7c00a81cb0b3bac5]::ty::context::tls::with_context_opt::<rustc_middle[7c00a81cb0b3bac5]::ty::context::tls::with_opt<rustc_middle[7c00a81cb0b3bac5]::util::bug::opt_span_bug_fmt<rustc_span[eae331e1b7d19547]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f20ac857850 - rustc_middle[7c00a81cb0b3bac5]::util::bug::bug_fmt
  23:     0x7f20aea3db1e - <rustc_mir_transform[cb44be0bd28f4d40]::coverage::spans::CoverageSpansGenerator>::take_prev
  24:     0x7f20aea3f2eb - <rustc_mir_transform[cb44be0bd28f4d40]::coverage::Instrumentor>::inject_counters
  25:     0x7f20aea3e4e0 - <rustc_mir_transform[cb44be0bd28f4d40]::coverage::InstrumentCoverage as rustc_middle[7c00a81cb0b3bac5]::mir::MirPass>::run_pass
  26:     0x7f20af7d28a8 - rustc_mir_transform[cb44be0bd28f4d40]::pass_manager::run_passes_inner
  27:     0x7f20ad98164c - rustc_mir_transform[cb44be0bd28f4d40]::mir_promoted
  28:     0x7f20afc976aa - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 16usize]>>
  29:     0x7f20afc9796a - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::VecCache<rustc_span[eae331e1b7d19547]::def_id::LocalDefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  30:     0x7f20afc975af - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7f20b05519ad - rustc_borrowck[f0e26e51a8682d07]::mir_borrowck
  32:     0x7f20b05518ef - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>
  33:     0x7f20af86f643 - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::VecCache<rustc_span[eae331e1b7d19547]::def_id::LocalDefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  34:     0x7f20af86f090 - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7f20afb5180a - <rustc_borrowck[f0e26e51a8682d07]::type_check::TypeChecker>::prove_closure_bounds
  36:     0x7f20b05356e2 - <rustc_borrowck[f0e26e51a8682d07]::type_check::TypeChecker>::typeck_mir
  37:     0x7f20acba41fb - rustc_borrowck[f0e26e51a8682d07]::type_check::type_check
  38:     0x7f20acb88298 - rustc_borrowck[f0e26e51a8682d07]::nll::compute_regions
  39:     0x7f20b056180e - rustc_borrowck[f0e26e51a8682d07]::do_mir_borrowck
  40:     0x7f20b0551e4a - rustc_borrowck[f0e26e51a8682d07]::mir_borrowck
  41:     0x7f20b05518ef - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>
  42:     0x7f20af86f643 - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::VecCache<rustc_span[eae331e1b7d19547]::def_id::LocalDefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  43:     0x7f20af86f090 - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7f20b04f3094 - rustc_hir_analysis[aa935ef28292d8cf]::collect::type_of::type_of_opaque
  45:     0x7f20b04f2df3 - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>
  46:     0x7f20af747dd4 - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::DefaultCache<rustc_span[eae331e1b7d19547]::def_id::DefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  47:     0x7f20b0706b5e - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  48:     0x7f20af7fa078 - rustc_middle[7c00a81cb0b3bac5]::query::plumbing::query_get_at::<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::DefaultCache<rustc_span[eae331e1b7d19547]::def_id::DefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>>
  49:     0x7f20ad913a32 - rustc_hir_analysis[aa935ef28292d8cf]::collect::type_of::type_of
  50:     0x7f20af748f66 - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>
  51:     0x7f20af747dd4 - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::DefaultCache<rustc_span[eae331e1b7d19547]::def_id::DefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  52:     0x7f20af74799b - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  53:     0x7f20af7fa078 - rustc_middle[7c00a81cb0b3bac5]::query::plumbing::query_get_at::<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::DefaultCache<rustc_span[eae331e1b7d19547]::def_id::DefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 8usize]>>>
  54:     0x7f20b048e93a - rustc_hir_analysis[aa935ef28292d8cf]::check::check::check_mod_item_types
  55:     0x7f20b048cc79 - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 0usize]>>
  56:     0x7f20b015c23b - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::DefaultCache<rustc_span[eae331e1b7d19547]::def_id::LocalModDefId, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  57:     0x7f20b015bc17 - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  58:     0x7f20aff77f23 - rustc_hir_analysis[aa935ef28292d8cf]::check_crate
  59:     0x7f20b0167662 - rustc_interface[de342c667529d873]::passes::analysis
  60:     0x7f20b016729d - rustc_query_impl[b20232bf4d4ffc8c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b20232bf4d4ffc8c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 1usize]>>
  61:     0x7f20b065f780 - rustc_query_system[5bf07fe88c8b9bfa]::query::plumbing::try_execute_query::<rustc_query_impl[b20232bf4d4ffc8c]::DynamicConfig<rustc_query_system[5bf07fe88c8b9bfa]::query::caches::SingleCache<rustc_middle[7c00a81cb0b3bac5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b20232bf4d4ffc8c]::plumbing::QueryCtxt, false>
  62:     0x7f20b065f587 - rustc_query_impl[b20232bf4d4ffc8c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  63:     0x7f20b066de52 - rustc_interface[de342c667529d873]::interface::run_compiler::<core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>, rustc_driver_impl[4e1279a210f875d1]::run_compiler::{closure#0}>::{closure#0}
  64:     0x7f20b0661249 - std[ca116cedd296397e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[de342c667529d873]::util::run_in_thread_with_globals<rustc_interface[de342c667529d873]::util::run_in_thread_pool_with_globals<rustc_interface[de342c667529d873]::interface::run_compiler<core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>, rustc_driver_impl[4e1279a210f875d1]::run_compiler::{closure#0}>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>
  65:     0x7f20b0661073 - <<std[ca116cedd296397e]::thread::Builder>::spawn_unchecked_<rustc_interface[de342c667529d873]::util::run_in_thread_with_globals<rustc_interface[de342c667529d873]::util::run_in_thread_pool_with_globals<rustc_interface[de342c667529d873]::interface::run_compiler<core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>, rustc_driver_impl[4e1279a210f875d1]::run_compiler::{closure#0}>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#1} as core[c0bc3e49ab39a50c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  66:     0x7f20ab68f555 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd1c6f093d833cd0b
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2007:9
  67:     0x7f20ab68f555 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc0da20453235ce5e
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2007:9
  68:     0x7f20ab68f555 - std::sys::unix::thread::Thread::new::thread_start::he4d6253d6192e596
                               at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys/unix/thread.rs:108:17
  69:     0x7f20ab5a3609 - start_thread
  70:     0x7f20ab4c6133 - clone
  71:                0x0 - <unknown>

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: please attach the file at `/rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/rustc-ice-2023-12-06T03_53_32-2281.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C overflow-checks=on -C debuginfo=1 -C force-frame-pointers -C instrument-coverage -C link-arg=-lc++

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

query stack during panic:
#0 [mir_promoted] promoting constants in MIR for `nonblock::<impl at /rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/nonblock.rs:226:1: 226:8>::request_name::{closure#0}`
#1 [mir_borrowck] borrow-checking `nonblock::<impl at /rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/nonblock.rs:226:1: 226:8>::request_name::{closure#0}`
#2 [mir_borrowck] borrow-checking `nonblock::<impl at /rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/nonblock.rs:226:1: 226:8>::request_name`
#3 [type_of_opaque] computing type of opaque `nonblock::<impl at /rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/nonblock.rs:226:1: 226:8>::request_name::{opaque#0}`
#4 [type_of] computing type of `nonblock::<impl at /rust/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/nonblock.rs:226:1: 226:8>::request_name::{opaque#0}`
#5 [check_mod_item_types] checking item types in module `nonblock`
#6 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `dbus` (lib)
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::HandlerInner>::bug::<alloc::string::String>
   2: <rustc_errors::Handler>::bug::<alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_mir_transform::coverage::spans::CoverageSpansGenerator>::take_prev
   8: <rustc_mir_transform::coverage::Instrumentor>::inject_counters
   9: <rustc_mir_transform::coverage::InstrumentCoverage as rustc_middle::mir::MirPass>::run_pass
  10: rustc_mir_transform::pass_manager::run_passes_inner
  11: rustc_mir_transform::mir_promoted
      [... omitted 1 frame ...]
  12: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  13: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  14: <rustc_borrowck::type_check::TypeChecker>::typeck_mir
  15: rustc_borrowck::type_check::type_check
  16: rustc_borrowck::nll::compute_regions
  17: rustc_borrowck::do_mir_borrowck
  18: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  19: rustc_hir_analysis::collect::type_of::type_of_opaque
      [... omitted 1 frame ...]
  20: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  21: rustc_hir_analysis::collect::type_of::type_of
      [... omitted 1 frame ...]
  22: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  23: rustc_hir_analysis::check::check::check_mod_item_types
      [... omitted 1 frame ...]
  24: rustc_hir_analysis::check_crate
  25: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  26: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I think this is the same error as #118643. Also tried to bisect the oss-fuzz builder version and the regression is between (26333c732 2023-11-28) and (623b78849 2023-12-02):

# BAD
docker run -it gcr.io/oss-fuzz-base/base-builder-rust@sha256:d3833ad1befb9441b4a95b6dd3aae002dafca54edd2f08e23b8315ab186dae54 /bin/bash
root@52cbf0f87ca5:/src# cargo version
cargo 1.76.0-nightly (623b78849 2023-12-02)

# GOOD
docker run -it gcr.io/oss-fuzz-base/base-builder-rust@sha256:06843f64901b1819ce5157d04f0ec9d28c199ed9cba5423a6c6560d9d565b0f2 /bin/bash
root@54afa8cb0ae7:/src# cargo version
cargo 1.76.0-nightly (26333c732 2023-11-28)
@PalmPTSJ PalmPTSJ 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 Dec 6, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 6, 2023
@Zalathar
Copy link
Contributor

Zalathar commented Dec 6, 2023

@rustbot label +A-code-coverage

@rustbot rustbot added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Dec 6, 2023
@Zalathar
Copy link
Contributor

Zalathar commented Dec 6, 2023

According to that regression range, this predates #118525 and doesn't coincide with any coverage-specific change that I know of.

So presumably a change elsewhere in the compiler confused the coverage instrumentor into encountering a latent bug.

@afq984
Copy link

afq984 commented Dec 7, 2023

I reproduced this with:

git clone https://github.com/diwic/dbus-rs  # which is 618262f5e3217cdd173d46d705bbac26c5141e21
cd dbus-rs
RUSTFLAGS='-C instrument-coverage'  cargo bisect-rustc

The report seems to be suggesting a different regression range as #118662 (comment)

searched nightlies: from nightly-2023-12-03 to nightly-2023-12-07
regressed nightly: nightly-2023-12-04
searched commit range: 90e321d...9fad685
regressed commit: 9fad685

bisected with cargo-bisect-rustc v0.6.7

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 

@PalmPTSJ
Copy link
Author

PalmPTSJ commented Dec 7, 2023

I just found out that the cargo and rustc version can be different. The rustc version of the first bad image is the same as the comment above

docker run -it gcr.io/oss-fuzz-base/base-builder-rust@sha256:d3833ad1befb9441b4a95b6dd3aae002dafca54edd2f08e23b8315ab186dae54 /bin/bash
root@155a141d569c:/src# rustc --version --verbose
rustc 1.76.0-nightly (9fad68599 2023-12-03)
binary: rustc
commit-hash: 9fad6859925b34f9a0b1af592a7839ccb1e71f60
commit-date: 2023-12-03
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Sorry for the confusion

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 8, 2023
@afq984
Copy link

afq984 commented Dec 10, 2023

Confirmed this is fixed with #118666.

RUSTFLAGS="-C instrument-coverage" cargo bisect-rustc --preserve --start 2023-12-06 --end 2023-12-10 --regress=non-ice

Regression in rust-lang-ci@a10d556

searched nightlies: from nightly-2023-12-06 to nightly-2023-12-10
regressed nightly: nightly-2023-12-10
searched commit range: f967532...06e02d5
regressed commit: ce67033

bisected with cargo-bisect-rustc v0.6.7

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --preserve --start 2023-12-06 --end 2023-12-10 --regress=non-ice 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) 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

5 participants