Skip to content

Fix miri test failure#870

Merged
bors[bot] merged 5 commits intomasterfrom
miri
Jul 19, 2022
Merged

Fix miri test failure#870
bors[bot] merged 5 commits intomasterfrom
miri

Conversation

@taiki-e
Copy link
Member

@taiki-e taiki-e commented Jul 19, 2022

No description provided.

@taiki-e
Copy link
Member Author

taiki-e commented Jul 19, 2022

bors r+

bors bot added a commit that referenced this pull request Jul 19, 2022
870: Fix miri test failure r=taiki-e a=taiki-e

Split the non-breaking part from #796.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 19, 2022

Canceled.

@taiki-e
Copy link
Member Author

taiki-e commented Jul 19, 2022

bors r+

bors bot added a commit that referenced this pull request Jul 19, 2022
870: Fix miri test failure r=taiki-e a=taiki-e

Split the non-breaking part from #796.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 19, 2022

Build failed:

@taiki-e taiki-e force-pushed the miri branch 2 times, most recently from 09b5fc0 to 9ef02eb Compare July 19, 2022 13:51
taiki-e added 2 commits July 19, 2022 23:30
Load as `MaybeUninit` because we may load a value that is not valid as `T`.
This fixes stacked borrows violation violations.
@taiki-e
Copy link
Member Author

taiki-e commented Jul 19, 2022

Hmm, Miri failed with ICE...

0.004090   thread 'rustc' panicked at 'slice index starts at 17 but ends at 0', library/core/src/slice/index.rs:92:5
0.000052   stack backtrace:
0.027705      0: rust_begin_unwind
0.000040                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/std/src/panicking.rs:584:5
0.000013      1: core::panicking::panic_fmt
0.000009                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/core/src/panicking.rs:142:14
0.000008      2: core::slice::index::slice_index_order_fail_rt
0.000008                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/core/src/slice/index.rs:92:5
0.000010      3: core::ops::function::FnOnce::call_once
0.000008                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/core/src/ops/function.rs:248:5
0.000010      4: core::intrinsics::const_eval_select
0.000009                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/core/src/intrinsics.rs:2701:5
0.000017      5: core::slice::index::slice_index_order_fail
0.000010                at /rustc/f8588549c3c3d45c32b404210cada01e2a45def3/library/core/src/slice/index.rs:87:14
0.000710      6: <miri::stacked_borrows::stack::Stack>::access
0.000025      7: <miri::stacked_borrows::stack::Stack>::grant
0.000259      8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator> as miri::helpers::EvalContextExt>::visit_freeze_sensitive::<<rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator> as miri::stacked_borrows::EvalContextPrivExt>::reborrow::{closure#1}>
0.000058      9: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator> as miri::stacked_borrows::EvalContextPrivExt>::retag_reference
0.000042     10: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator>>::statement
0.000019     11: miri::eval::eval_entry
0.000063     12: <rustc_interface::passes::QueryContext>::enter::<<miri::MiriCompilerCalls as rustc_driver::Callbacks>::after_analysis::{closure#0}, ()>
0.000030     13: <miri::MiriCompilerCalls as rustc_driver::Callbacks>::after_analysis
0.000425     14: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
0.000309     15: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
0.000061     16: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
0.000125     17: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
0.000010   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
0.000008   
0.000020   error: internal compiler error: unexpected panic
0.000026   
0.000061   note: the compiler unexpectedly panicked. this is a bug.
0.000027   
0.000037   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
0.000018   
0.000024   note: rustc 1.64.0-nightly (f8588549c 2022-07-18) running on x86_64-unknown-linux-gnu
0.000017   
0.000024   note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -Z randomize-layout -Z miri-symbolic-alignment-check -Z miri-ignore-leaks
0.000017   
0.000022   note: some of the compiler flags provided by cargo are hidden
0.000018   
0.000019   query stack during panic:
0.000071   end of query stack
0.012952   warning: 5 warnings emitted
0.000042   
0.007112   error: test failed, to rerun pass '-p crossbeam --test subcrates'

https://github.com/crossbeam-rs/crossbeam/runs/7411416824?check_suite_focus=true

However, I cannot reproduce this ICE in #796 which is based on this PR.
Does Miri seem confused about the Int-to-ptr casts? (cc @RalfJung)

@RalfJung
Copy link
Contributor

Hm yeah that is weird. Do you have a reproducible testcase?

@RalfJung
Copy link
Contributor

RalfJung commented Jul 19, 2022

Ah, got one.

Tracking this in Miri as rust-lang/miri#2389.

@taiki-e
Copy link
Member Author

taiki-e commented Jul 19, 2022

Thanks!

@taiki-e
Copy link
Member Author

taiki-e commented Jul 19, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 19, 2022

Build succeeded:

@bors bors bot merged commit 10af6db into master Jul 19, 2022
@bors bors bot deleted the miri branch July 19, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments