rust-lang / rust

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

ICE: attempted to read from stolen value: rustc_middle::mir::Body #96219

Closed sashinexists closed 1 week ago

sashinexists commented 2 years ago

Code

It is for this project, to run it locally you need twitter API credentials in an .env file
https://github.com/sashinexists/better-twitter-archiver

Meta

rustc --version --verbose:

<version>

Error output

cargo check
    Checking better-twitter-archiver v0.1.0 (/var/home/sashin/ドキュメント/projects/better-twitter-archiver)
thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:435:36
stack backtrace:
   0:     0x7f3cd116c86d - std::backtrace_rs::backtrace::libunwind::trace::hee598835bc88d35b
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3cd116c86d - std::backtrace_rs::backtrace::trace_unsynchronized::h9cdc730ba5cf5d72
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3cd116c86d - std::sys_common::backtrace::_print_fmt::h75aeaf7ed30e43fa
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f3cd116c86d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h606862f787600875
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f3cd11cc4ec - core::fmt::write::he803f0f418caf762
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/fmt/mod.rs:1190:17
   5:     0x7f3cd115ca98 - std::io::Write::write_fmt::h70bc45872f37e7bb
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/io/mod.rs:1657:15
   6:     0x7f3cd1170847 - std::sys_common::backtrace::_print::h64d038cf8ac3e13e
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f3cd1170847 - std::sys_common::backtrace::print::h359300b4a7fccf65
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f3cd1170847 - std::panicking::default_hook::{{closure}}::hf51be35e2f510149
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:295:22
   9:     0x7f3cd1170510 - std::panicking::default_hook::h03ca0f22e1d2d25e
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:314:9
  10:     0x7f3cd18fc2c1 - rustc_driver[6eeb127b85fe99ac]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3cb6475393 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1d9293c579db6a4c
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/alloc/src/boxed.rs:1867:9
  12:     0x7f3cb6475b0c - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h146869cb2435e715
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/proc_macro/src/bridge/client.rs:319:21
  13:     0x7f3cb64696c0 - std::panicking::update_hook::{{closure}}::h3214b229fa989889
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:258:41
  14:     0x7f3cd1171124 - std::panicking::rust_panic_with_hook::h3b7380e99b825b63
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:702:17
  15:     0x7f3cd1170dd7 - std::panicking::begin_panic_handler::{{closure}}::h8e849d0710154ce0
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:588:13
  16:     0x7f3cd116cd34 - std::sys_common::backtrace::__rust_end_short_backtrace::hedcdaddbd4c46cc5
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:138:18
  17:     0x7f3cd1170ae9 - rust_begin_unwind
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
  18:     0x7f3cd1139863 - core::panicking::panic_fmt::he1bbc7336d49a357
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
  19:     0x7f3cd2c4a9b3 - rustc_mir_transform[9e737481de61c19e]::check_unsafety::unsafety_check_result
  20:     0x7f3cd2c478b7 - <rustc_mir_transform[9e737481de61c19e]::check_unsafety::provide::{closure#0} as core[2734bb1f7d9ec6a5]::ops::function::FnOnce<(rustc_middle[c145adf1c4567bf]::ty::context::TyCtxt, rustc_span[4b4bb4534443c42f]::def_id::LocalDefId)>>::call_once
  21:     0x7f3cd232960b - <rustc_middle[c145adf1c4567bf]::dep_graph::dep_node::DepKind as rustc_query_system[cf3d2502706fe991]::dep_graph::DepKind>::with_deps::<rustc_query_system[cf3d2502706fe991]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_span[4b4bb4534443c42f]::def_id::LocalDefId, &rustc_middle[c145adf1c4567bf]::mir::query::UnsafetyCheckResult>::{closure#1}, &rustc_middle[c145adf1c4567bf]::mir::query::UnsafetyCheckResult>
  22:     0x7f3cd3c2aa42 - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_span[4b4bb4534443c42f]::def_id::LocalDefId, &rustc_middle[c145adf1c4567bf]::mir::query::UnsafetyCheckResult>
  23:     0x7f3cd31b6a71 - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_execute_query::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_query_system[cf3d2502706fe991]::query::caches::DefaultCache<rustc_span[4b4bb4534443c42f]::def_id::LocalDefId, &rustc_middle[c145adf1c4567bf]::mir::query::UnsafetyCheckResult>>
  24:     0x7f3cd32131d1 - <rustc_query_impl[8218de0923c6cd45]::Queries as rustc_middle[c145adf1c4567bf]::ty::query::QueryEngine>::unsafety_check_result
  25:     0x7f3cd2c526b7 - rustc_mir_transform[9e737481de61c19e]::check_unsafety::check_unsafety
  26:     0x7f3cd2b368c0 - <rustc_session[95a8f1c94d15e5dc]::session::Session>::time::<(), rustc_interface[afc566840a941718]::passes::analysis::{closure#3}>
  27:     0x7f3cd377ef2c - rustc_interface[afc566840a941718]::passes::analysis
  28:     0x7f3cd3cd6b62 - <rustc_query_system[cf3d2502706fe991]::dep_graph::graph::DepGraph<rustc_middle[c145adf1c4567bf]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[c145adf1c4567bf]::ty::context::TyCtxt, (), core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>
  29:     0x7f3cd3d29303 - rustc_data_structures[762b64c8eff0c924]::stack::ensure_sufficient_stack::<(core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_query_system[cf3d2502706fe991]::dep_graph::graph::DepNodeIndex), rustc_query_system[cf3d2502706fe991]::query::plumbing::execute_job<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, (), core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#3}>
  30:     0x7f3cd3c18bae - rustc_query_system[cf3d2502706fe991]::query::plumbing::try_execute_query::<rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt, rustc_query_system[cf3d2502706fe991]::query::caches::DefaultCache<(), core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>>
  31:     0x7f3cd3c57c05 - rustc_query_system[cf3d2502706fe991]::query::plumbing::get_query::<rustc_query_impl[8218de0923c6cd45]::queries::analysis, rustc_query_impl[8218de0923c6cd45]::plumbing::QueryCtxt>
  32:     0x7f3cd375d608 - <rustc_interface[afc566840a941718]::passes::QueryContext>::enter::<rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>
  33:     0x7f3cd374bac5 - rustc_interface[afc566840a941718]::interface::create_compiler_and_run::<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>
  34:     0x7f3cd3731134 - std[cd3cf6af28dff6de]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[afc566840a941718]::util::run_in_thread_pool_with_globals<rustc_interface[afc566840a941718]::interface::run_compiler<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>
  35:     0x7f3cd37643e9 - <<std[cd3cf6af28dff6de]::thread::Builder>::spawn_unchecked_<rustc_interface[afc566840a941718]::util::run_in_thread_pool_with_globals<rustc_interface[afc566840a941718]::interface::run_compiler<core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>, rustc_driver[6eeb127b85fe99ac]::run_compiler::{closure#1}>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#0}, core[2734bb1f7d9ec6a5]::result::Result<(), rustc_errors[bd800fb2a5e0b9f5]::ErrorReported>>::{closure#1} as core[2734bb1f7d9ec6a5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7f3cd117cd03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf70ac038171e3e1a
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/alloc/src/boxed.rs:1853:9
  37:     0x7f3cd117cd03 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he6690128792365ad
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/alloc/src/boxed.rs:1853:9
  38:     0x7f3cd117cd03 - std::sys::unix::thread::Thread::new::thread_start::ha07928d93d5a5ec9
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7f3cd0f40b1a - start_thread
  40:     0x7f3cd0fc5650 - __clone3
  41:                0x0 - <unknown>

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.60.0 (7737e0b5c 2022-04-04) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `app::api::get_tweets_from_user`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `better-twitter-archiver`
❯ cargo check
    Checking better-twitter-archiver v0.1.0 (/var/home/sashin/ドキュメント/projects/better-twitter-archiver)
thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:435:36
stack backtrace:
   0:     0x7faddfde186d - std::backtrace_rs::backtrace::libunwind::trace::hee598835bc88d35b
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7faddfde186d - std::backtrace_rs::backtrace::trace_unsynchronized::h9cdc730ba5cf5d72
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7faddfde186d - std::sys_common::backtrace::_print_fmt::h75aeaf7ed30e43fa
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7faddfde186d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h606862f787600875
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7faddfe414ec - core::fmt::write::he803f0f418caf762
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/fmt/mod.rs:1190:17
   5:     0x7faddfdd1a98 - std::io::Write::write_fmt::h70bc45872f37e7bb
Backtrace

``` ❯ RUST_BACKTRACE=1 cargo build Compiling better-twitter-archiver v0.1.0 (/var/home/sashin/ドキュメント/projects/better-twitter-archiver) Finished dev [unoptimized + debuginfo] target(s) in 4.32s ```

mcvicuna commented 2 years ago

using commit e0b1a8a9dfb3c34342115a1ad516a92816c7af7e from https://github.com/sashinexists/better-twitter-archiver rustc --version --verbose

rustc 1.60.0 (7737e0b5c 2022-04-04)
  host: x86_64-unknown-linux-gnu
  release: 1.60.0
  LLVM version: 14.0.0

cargo check

Finished dev [unoptimized + debuginfo] target(s) in 1m 13s

Doesn't seem to reproduce it. Is there a different commit that causes the ICE? Any differences in dev env you can think of that might aid in reproducing it?

kpreid commented 11 months ago

Triage: Relabeling issues which don't have a runnable reproduction (as opposed to having a non-minimized one) to the new label S-needs-repro. @rustbot label +S-needs-repro -E-needs-mcve

Noratrieb commented 1 week ago

This issue does not have a reproduction and is therefore not really actionable, closing. If you find the problem again, please open a new issue, ideally with a reproduction.