Skip to content

"No counters provided the source_hash for used function" when compiling with -Z instrument-coverage #85128

@rajivshah3

Description

@rajivshah3

Code

Will try to put together a minimal example, but it's currently occurring with https://github.com/iotaledger/wallet.rs

<code>

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (881c1ac40 2021-05-08)
binary: rustc
commit-hash: 881c1ac408d93bb7adaa3a51dabab9266e82eee8
commit-date: 2021-05-08
host: x86_64-apple-darwin
release: 1.54.0-nightly
LLVM version: 12.0.0

Error output

thread 'rustc' panicked at 'No counters provided the source_hash for used function: Instance { def: DropGlue(DefId(2:2347 ~ core[8495]::ptr::drop_in_place), Some([static generator@/Users/rajiv/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.5.0/src/sync/watch.rs:258:69: 272:6 for<'r, 's> {std::future::ResumeTy, &'r mut sync::watch::Receiver<()>, sync::notify::Notified<'s>, ()}])), substs: [[static generator@/Users/rajiv/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.5.0/src/sync/watch.rs:258:69: 272:6 for<'r, 's> {std::future::ResumeTy, &'r mut sync::watch::Receiver<()>, sync::notify::Notified<'s>, ()}]] }', compiler/rustc_codegen_ssa/src/coverageinfo/map.rs:147:9
Backtrace

thread 'rustc' panicked at 'No counters provided the source_hash for used function: Instance { def: DropGlue(DefId(2:2347 ~ core[8495]::ptr::drop_in_place), Some([static generator@/Users/rajiv/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.5.0/src/sync/watch.rs:258:69: 272:6 for<'r, 's> {std::future::ResumeTy, &'r mut sync::watch::Receiver<()>, sync::notify::Notified<'s>, ()}])), substs: [[static generator@/Users/rajiv/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.5.0/src/sync/watch.rs:258:69: 272:6 for<'r, 's> {std::future::ResumeTy, &'r mut sync::watch::Receiver<()>, sync::notify::Notified<'s>, ()}]] }', compiler/rustc_codegen_ssa/src/coverageinfo/map.rs:147:9
stack backtrace:
   0: _rust_begin_unwind
   1: std::panicking::begin_panic_fmt
   2: rustc_codegen_ssa::coverageinfo::map::FunctionCoverage::get_expressions_and_counter_regions
   3: rustc_codegen_llvm::coverageinfo::mapgen::finalize
   4: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
   5: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
   6: rustc_codegen_llvm::base::compile_codegen_unit
   7: rustc_codegen_ssa::base::codegen_crate
   8: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   9: rustc_interface::passes::QueryContext::enter
  10: rustc_interface::queries::Queries::ongoing_codegen
  11: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  12: rustc_span::with_source_map
  13: rustc_interface::interface::create_compiler_and_run
  14: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.54.0-nightly (881c1ac40 2021-05-08) running on x86_64-apple-darwin

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

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

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions