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 when building a project after changing rustflags. #84225

Closed
xd009642 opened this issue Apr 15, 2021 · 2 comments
Closed

ICE when building a project after changing rustflags. #84225

xd009642 opened this issue Apr 15, 2021 · 2 comments
Labels
A-incr-comp Area: Incremental compilation 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

@xd009642
Copy link
Contributor

So I found this while trying to solve a tarpaulin issue on a project where I'm not familiar with the code at all. The project is https://github.com/winksaville/rust-binance-auto-sell Using cargo 1.53.0-nightly (65d57e6f3 2021-04-04) my steps were:

cargo build 
`RUSTFLAGS=" -C link-dead-code -C debuginfo=2` cargo build

Tarpaulin changes the rustflags to add RUSTFLAGS=" -C link-dead-code -C debuginfo=2 hence the minimal instructions. This also doesn't happen in stable, instead I get this issue (rust-lang/cargo#9220). Also both stable and nightly work if started from a clean build

I'll try and look into the code to figure out a minimal reproducible example but like I said I'm not familiar at all with it at all. I'll also let a maintainer know about this and maybe they'll have a better idea.

Error output

I get a list of types that fills up my terminal I've attached it here:
output.txt

Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/panicking.rs:92:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: rustc_query_system::query::plumbing::incremental_verify_ich
   5: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
   6: rustc_data_structures::stack::ensure_sufficient_stack
   7: rustc_query_system::query::plumbing::get_query_impl
   8: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::exported_symbols
   9: rustc_codegen_ssa::back::symbol_export::upstream_monomorphizations_provider
  10: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::upstream_monomorphizations>::compute
  11: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  12: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
  13: rustc_data_structures::stack::ensure_sufficient_stack
  14: rustc_query_system::query::plumbing::get_query_impl
  15: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::upstream_monomorphizations
  16: rustc_codegen_ssa::back::symbol_export::upstream_monomorphizations_for_provider
  17: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  18: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
  19: rustc_data_structures::stack::ensure_sufficient_stack
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::upstream_monomorphizations_for
  22: rustc_codegen_ssa::back::symbol_export::upstream_drop_glue_for_provider
  23: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  24: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  25: rustc_data_structures::stack::ensure_sufficient_stack
  26: rustc_query_system::query::plumbing::force_query_with_job
  27: rustc_query_system::query::plumbing::get_query_impl
  28: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::upstream_drop_glue_for
  29: rustc_middle::ty::instance::Instance::upstream_monomorphization
  30: rustc_mir::monomorphize::collector::should_codegen_locally
  31: <rustc_mir::monomorphize::collector::RootCollector as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item
  32: rustc_hir::hir::Crate::visit_all_item_likes
  33: rustc_mir::monomorphize::collector::collect_roots
  34: rustc_mir::monomorphize::collector::collect_crate_mono_items
  35: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  36: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::collect_and_partition_mono_items>::compute
  37: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  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::force_query_with_job
  41: rustc_query_system::query::plumbing::get_query_impl
  42: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_and_partition_mono_items
  43: rustc_codegen_ssa::base::codegen_crate
  44: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  45: rustc_interface::passes::QueryContext::enter
  46: rustc_interface::queries::Queries::ongoing_codegen
  47: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  48: rustc_span::with_source_map
  49: rustc_interface::interface::create_compiler_and_run
  50: 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.53.0-nightly (16bf626a3 2021-04-14) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C link-dead-code -C debuginfo=2 --crate-type bin

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

query stack during panic:
#0 [exported_symbols] exported_symbols
#1 [upstream_monomorphizations] collecting available upstream monomorphizations `crate0`
#2 [upstream_monomorphizations_for] collecting available upstream monomorphizations for `std::ptr::drop_in_place`
#3 [upstream_drop_glue_for] available upstream drop-glue for `[exchange_info::Symbol]`
#4 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

@xd009642 xd009642 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 Apr 15, 2021
@jyn514 jyn514 added the A-incr-comp Area: Incremental compilation label Apr 15, 2021
@Aaron1011
Copy link
Member

This will be fixed by #84226

@jyn514
Copy link
Member

jyn514 commented May 19, 2021

Fixed in #84226

@jyn514 jyn514 closed this as completed May 19, 2021
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. 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