rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.96k stars 12.69k forks source link

ICE when building a project after changing rustflags. #84225

Closed xd009642 closed 3 years ago

xd009642 commented 3 years ago

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 (https://github.com/rust-lang/cargo/issues/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: ::exported_symbols 9: rustc_codegen_ssa::back::symbol_export::upstream_monomorphizations_provider 10: rustc_query_impl:: for rustc_query_impl::queries::upstream_monomorphizations>::compute 11: rustc_middle::dep_graph::::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: ::upstream_monomorphizations 16: rustc_codegen_ssa::back::symbol_export::upstream_monomorphizations_for_provider 17: rustc_middle::dep_graph::::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: ::upstream_monomorphizations_for 22: rustc_codegen_ssa::back::symbol_export::upstream_drop_glue_for_provider 23: rustc_middle::dep_graph::::with_deps 24: rustc_query_system::dep_graph::graph::DepGraph::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: ::upstream_drop_glue_for 29: rustc_middle::ty::instance::Instance::upstream_monomorphization 30: rustc_mir::monomorphize::collector::should_codegen_locally 31: ::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:: for rustc_query_impl::queries::collect_and_partition_mono_items>::compute 37: rustc_middle::dep_graph::::with_deps 38: rustc_query_system::dep_graph::graph::DepGraph::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: ::collect_and_partition_mono_items 43: rustc_codegen_ssa::base::codegen_crate 44: ::codegen_crate 45: rustc_interface::passes::QueryContext::enter 46: rustc_interface::queries::Queries::ongoing_codegen 47: rustc_interface::queries::::enter 48: rustc_span::with_source_map 49: rustc_interface::interface::create_compiler_and_run 50: scoped_tls::ScopedKey::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 ```

Aaron1011 commented 3 years ago

This will be fixed by https://github.com/rust-lang/rust/pull/84226

jyn514 commented 3 years ago

Fixed in https://github.com/rust-lang/rust/pull/84226