rust-lang / rust

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

Fingerprint assertion failed (Bevy/Rapier) #84269

Closed GreenXenith closed 3 years ago

GreenXenith commented 3 years ago

Note: This seems to be extremely temperamental. Sometimes it works for no apparent reason but then it fails after trying to do more.

Code

use bevy::prelude::*;

// ColliderSet resource is the specific issue. Removing it and/or using other resources works fine.
fn crash(mut colliders: ResMut<bevy_rapier3d::rapier::geometry::ColliderSet>) {}

fn main() {
    App::build()
        .insert_resource(Msaa { samples: 4 })
        .add_plugins(DefaultPlugins)
        .add_plugin(bevy_rapier3d::physics::RapierPhysicsPlugin)
        .add_system(crash.system())
        .run();
}

TOML:

[package]
name = "crashy"
version = "0.1.0"
edition = "2018"

[dependencies]
bevy = "0.5"
bevy_rapier3d = { version = "*", features = [ "simd-nightly" ] }

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (132b4e5d1 2021-04-13)
binary: rustc
commit-hash: 132b4e5d167b7e622fcc11fa2b67b931105b4de1
commit-date: 2021-04-13
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Some(Fingerprint(212923312148573672, 18320173992410164289))`,
 right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(ec72a45d41155054-768b49212a0839c0): Ok(EvaluatedToOkModuloRegions)', /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a 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 (132b4e5d1 2021-04-13) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `bevy_rapier3d::nalgebra::Translation<f32, bevy_rapier3d::nalgebra::U3>: std::marker::Send`
#1 [typeck] type-checking `main`
end of query stack
error: could not compile `crashy`
Backtrace

``` thread 'rustc' panicked at 'assertion failed: `(left == right)` left: `Some(Fingerprint(212923312148573672, 18320173992410164289))`, right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(ec72a45d41155054-768b49212a0839c0): Ok(EvaluatedToOkModuloRegions)', /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/compiler/rustc_query_system/src/query/plumbing.rs:593:5 stack backtrace: 0: 0x7f7835794320 - std::backtrace_rs::backtrace::libunwind::trace::hdcf4f90f85129e83 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5 1: 0x7f7835794320 - std::backtrace_rs::backtrace::trace_unsynchronized::h2669e30cb82f6732 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f7835794320 - std::sys_common::backtrace::_print_fmt::hfbda19e17f6db318 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys_common/backtrace.rs:67:5 3: 0x7f7835794320 - ::fmt::h1a8751bf59281272 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys_common/backtrace.rs:46:22 4: 0x7f783580567f - core::fmt::write::h7aa6cd0067dca82a at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/core/src/fmt/mod.rs:1094:17 5: 0x7f7835788b45 - std::io::Write::write_fmt::hd7dd3a1df9b6befb at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/io/mod.rs:1580:15 6: 0x7f7835797f0b - std::sys_common::backtrace::_print::h551e9ec8a9fa8106 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys_common/backtrace.rs:49:5 7: 0x7f7835797f0b - std::sys_common::backtrace::print::ha4b1c5e95fa040b3 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys_common/backtrace.rs:36:9 8: 0x7f7835797f0b - std::panicking::default_hook::{{closure}}::h0b34c9ab7fb9f857 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panicking.rs:208:50 9: 0x7f78357979ed - std::panicking::default_hook::h3067e8318decd17a at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panicking.rs:225:9 10: 0x7f7835f5cd4d - rustc_driver::report_ice::h0582ed2432eb0d01 11: 0x7f7835798620 - std::panicking::rust_panic_with_hook::h81b8facc50f34daa at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panicking.rs:595:17 12: 0x7f78357981f7 - std::panicking::begin_panic_handler::{{closure}}::ha376ab85d95a000e at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panicking.rs:497:13 13: 0x7f78357947dc - std::sys_common::backtrace::__rust_end_short_backtrace::h6795c8afdd1a77e6 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys_common/backtrace.rs:141:18 14: 0x7f7835798159 - rust_begin_unwind at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panicking.rs:493:5 15: 0x7f78357660f1 - core::panicking::panic_fmt::hbe99dddd3092ba3c at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/core/src/panicking.rs:92:14 16: 0x7f783580212e - core::panicking::assert_failed_inner::h4fdb1013d187f202 17: 0x7f7836612f3c - core::panicking::assert_failed::h2cb4c07ec1e15c78 18: 0x7f7837e4a6b8 - rustc_query_system::query::plumbing::incremental_verify_ich::hc7bc723f3d64cb27 19: 0x7f7837e56b6e - rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory::hef65e4baccecf519 20: 0x7f7837e76d18 - rustc_data_structures::stack::ensure_sufficient_stack::h716fb88f7c1bfd6b 21: 0x7f783731ea07 - rustc_query_system::query::plumbing::get_query_impl::haaf90bc2178abcb4 22: 0x7f783739ea13 - ::evaluate_obligation::hc11225f16a20b0e2 23: 0x7f783785b2a8 - ::evaluate_obligation::h0c8b2a62132aa028 24: 0x7f783785b5b0 - ::evaluate_obligation_no_overflow::hf3c078b8eaaed6d6 25: 0x7f78378695d9 - rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation::h62c69d92cfc2d8f9 26: 0x7f7837867daa - rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations::h7ee3bafec1ed42ba 27: 0x7f78378848b2 - rustc_data_structures::obligation_forest::ObligationForest::process_obligations::h2b00554f3dc3f7c0 28: 0x7f78378678fb - ::select_where_possible::h103c08b87e905efd 29: 0x7f7837137307 - rustc_typeck::check::fn_ctxt::_impl::::resolve_vars_with_obligations::hfec2dc787f42b3d6 30: 0x7f783713fd78 - rustc_typeck::check::fn_ctxt::checks::::check_method_argument_types::h9ac749b6b14cd4f6 31: 0x7f783712c67b - rustc_typeck::check::expr::::check_expr_kind::hc69621785e3c6692 32: 0x7f783712b815 - rustc_typeck::check::expr::::check_expr_with_expectation::h47456aee4a906d1b 33: 0x7f7837140572 - rustc_typeck::check::fn_ctxt::checks::::check_argument_types::h9108ef99f47bc2a0 34: 0x7f783713fe95 - rustc_typeck::check::fn_ctxt::checks::::check_method_argument_types::h9ac749b6b14cd4f6 35: 0x7f783712c67b - rustc_typeck::check::expr::::check_expr_kind::hc69621785e3c6692 36: 0x7f783712b815 - rustc_typeck::check::expr::::check_expr_with_expectation::h47456aee4a906d1b 37: 0x7f783712c582 - rustc_typeck::check::expr::::check_expr_kind::hc69621785e3c6692 38: 0x7f783712b815 - rustc_typeck::check::expr::::check_expr_with_expectation::h47456aee4a906d1b 39: 0x7f7837142aa6 - rustc_typeck::check::fn_ctxt::checks::::check_stmt::h1939f56db9cb9380 40: 0x7f7837143352 - rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected::hab00c51512c24e20 41: 0x7f783712b815 - rustc_typeck::check::expr::::check_expr_with_expectation::h47456aee4a906d1b 42: 0x7f7837136ff3 - rustc_typeck::check::expr::::check_return_expr::h40d0689891d304b0 43: 0x7f78371f6130 - rustc_typeck::check::check::check_fn::h039d226300b0410d 44: 0x7f78371b632d - rustc_infer::infer::InferCtxtBuilder::enter::he3255c23a431a459 45: 0x7f783720465d - rustc_typeck::check::typeck::hb4ebe1ffe254a5f2 46: 0x7f7837f2e31b - rustc_middle::dep_graph::::with_deps::ha97e411563a02509 47: 0x7f783738eb24 - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::h6c8a89e2423e14d7 48: 0x7f783736ea92 - rustc_data_structures::stack::ensure_sufficient_stack::h8fa95fc4535b48a2 49: 0x7f78373344f1 - rustc_query_system::query::plumbing::force_query_with_job::h4ff389903336f7ec 50: 0x7f783731d434 - rustc_query_system::query::plumbing::get_query_impl::haa013b5980622920 51: 0x7f783739caed - ::typeck::hc794e4a1ed8e251e 52: 0x7f783717d4ea - rustc_middle::ty::::par_body_owners::h5be9c37d9f112b7e 53: 0x7f7837d09f1f - rustc_typeck::check::typeck_item_bodies::h1183a7b554853710 54: 0x7f7837f2ecfc - rustc_middle::dep_graph::::with_deps::hb593b4d9fe3c3cf3 55: 0x7f7837f03798 - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::h8c4088a789993ddb 56: 0x7f7837e7ae82 - rustc_data_structures::stack::ensure_sufficient_stack::hdeeffaa9c4013f03 57: 0x7f7837e1a341 - rustc_query_system::query::plumbing::force_query_with_job::h32e909b4a0a58749 58: 0x7f7837dda50c - rustc_query_system::query::plumbing::get_query_impl::h4be8737019e13358 59: 0x7f7837f1aa8f - ::typeck_item_bodies::he285bfa3b3efa046 60: 0x7f7837ca55c1 - rustc_session::utils::::time::hdcdbadabc7500af5 61: 0x7f7837cc29af - rustc_typeck::check_crate::heb848e97b33b6184 62: 0x7f7837a7277d - rustc_interface::passes::analysis::hdf0c41e7bd20242b 63: 0x7f783663f27a - rustc_middle::dep_graph::::with_deps::h79da03c51d5eb779 64: 0x7f7837f0ae08 - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::he1753e46538bf70f 65: 0x7f7837e76097 - rustc_data_structures::stack::ensure_sufficient_stack::h55b64aa8321942c2 66: 0x7f7837e2b721 - rustc_query_system::query::plumbing::force_query_with_job::hec25eeb08c07b506 67: 0x7f7837e003a3 - rustc_query_system::query::plumbing::get_query_impl::hd4f6191670b007e2 68: 0x7f7837f18c8f - ::analysis::ha4b253866e559d53 69: 0x7f7837a510aa - rustc_interface::passes::QueryContext::enter::h1243d4d1902c3141 70: 0x7f7837a35f65 - rustc_interface::queries::::enter::hedca2acec6ab04da 71: 0x7f7837a34f04 - rustc_span::with_source_map::h67cb68e15a9ffc39 72: 0x7f7837a36f31 - rustc_interface::interface::create_compiler_and_run::he6a465670788f848 73: 0x7f7837a506b8 - scoped_tls::ScopedKey::set::h8de4c07d6e313e7a 74: 0x7f7837a50bd3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h953d4096b984a1d5 75: 0x7f7837a54505 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf2d8af4e3cccbbb1 76: 0x7f78357a8513 - as core::ops::function::FnOnce>::call_once::h3aa31cb6360b59d9 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/alloc/src/boxed.rs:1546:9 77: 0x7f78357a8513 - as core::ops::function::FnOnce>::call_once::h7719d3c7c5841461 at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/alloc/src/boxed.rs:1546:9 78: 0x7f78357a8513 - std::sys::unix::thread::Thread::new::thread_start::hfbe13ead469fd0bc at /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/sys/unix/thread.rs:71:17 79: 0x7f78356a9609 - start_thread 80: 0x7f78355b2293 - clone 81: 0x0 - 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 (132b4e5d1 2021-04-13) running on x86_64-unknown-linux-gnu note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [evaluate_obligation] evaluating trait selection obligation `bevy_rapier3d::nalgebra::Translation: std::marker::Send` #1 [typeck] type-checking `main` #2 [typeck_item_bodies] type-checking all item bodies #3 [analysis] running analysis passes on this crate end of query stack ```

illis commented 3 years ago

Have a similar issue. Can reproduce with your example by: 1/ cargo run # this works fine 2/ modify your main.crash function > replace geometry::ColliderSet with dynamics::RigidBodySet 3/ cargo run # this causes ICE

If you then rm -r target/debug/incremental/ you can run compile/run again (until you modify the affected file again).

rustc --version --verbose:

rustc 1.53.0-nightly (b0c818c5e 2021-04-16)
binary: rustc
commit-hash: b0c818c5e0fa37251d9fda2f656bf1041a2e1e1d
commit-date: 2021-04-16
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0
wesleywiser commented 3 years ago

Thanks for filing the bug report! We just shipped a patch release to work around this issue and are currently triaging related issues related to ensure each underlying problem gets resolved. Since this appears to be a duplicate of #83381, I'm going to close in favor of that issue.