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 in nightly when using trying to preserve rand::rngs::ThreadRng across awaits #67832

Closed
vi opened this issue Jan 3, 2020 · 1 comment
Closed
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@vi
Copy link
Contributor

vi commented Jan 3, 2020

rustc 1.41.0-nightly (3eeb8d4f2 2019-12-12)

error: internal compiler error: src/librustc/hir/map/mod.rs:1031: no name for expr move ||
...
  15: rustc_errors::HandlerInner::bug
  16: rustc_errors::Handler::bug
  17: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  18: rustc::ty::context::tls::with_opt::{{closure}}
  19: rustc::ty::context::tls::with_opt
  20: rustc::util::bug::opt_span_bug_fmt
  21: rustc::util::bug::bug_fmt
  22: rustc::hir::map::Map::name
  23: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt>::note_obligation_cause
  24: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt>::report_selection_error
  25: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt>::report_fulfillment_errors
  26: rustc_typeck::check::FnCtxt::resolve_generator_interiors
  27: rustc::ty::context::tls::with_context::{{closure}}
  28: rustc_typeck::check::typeck_tables_of
  29: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::typeck_tables_of>::compute
  30: rustc::dep_graph::graph::DepGraph::with_task_impl
  31: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::force_query
  32: rustc::ty::query::plumbing::force_from_dep_node
  33: rustc::dep_graph::graph::DepGraph::try_mark_previous_green
  34: rustc::dep_graph::graph::DepGraph::try_mark_green
  35: rustc::dep_graph::graph::DepGraph::try_mark_green_and_read
  36: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  37: rustc_typeck::collect::type_of
  38: rustc::ty::query::__query_compute::type_of
  39: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::type_of>::compute
  40: rustc::dep_graph::graph::DepGraph::with_task_impl
  41: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  42: rustc::hir::intravisit::walk_expr
  43: rustc::hir::intravisit::Visitor::visit_fn
  44: rustc::hir::intravisit::walk_item
  45: <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item
  46: rustc::hir::map::Map::visit_item_likes_in_module
  47: rustc_typeck::collect::collect_mod_item_types
  48: rustc::ty::query::__query_compute::collect_mod_item_types
  49: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute
  50: rustc::dep_graph::graph::DepGraph::with_task_impl
  51: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  52: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query
  53: rustc_typeck::check_crate::{{closure}}::{{closure}}
  54: rustc::util::common::time
  55: rustc_typeck::check_crate
  56: rustc_interface::passes::analysis
  57: rustc::ty::query::__query_compute::analysis
  58: rustc::dep_graph::graph::DepGraph::with_task_impl
  59: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  60: rustc::ty::context::tls::enter_global
  61: rustc_interface::interface::run_compiler_in_existing_thread_pool
  62: std::thread::local::LocalKey<T>::with
  63: scoped_tls::ScopedKey<T>::set
  64: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.41.0-nightly (3eeb8d4f2 2019-12-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental -C link-arg=-fuse-ld=lld --crate-type bin

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

query stack during panic:
#0 [typeck_tables_of] processing `client::client`
#1 [typeck_tables_of] processing `client::client::{{closure}}#0`
#2 [type_of] processing `client::client::{{closure}}#0`
#3 [collect_mod_item_types] collecting item types in module `client`
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `natram`.

Source code: vi/natram@d9cadb2

Full log: rustcbug.txt

Stable Rust correctly shows error:

248 |     tokio::spawn(async move {
    |     ^^^^^^^^^^^^ `std::ptr::NonNull<rand::rngs::adapter::reseeding::ReseedingRng<rand_chacha::chacha::ChaCha20Core, rand_core::os::OsRng>>` cannot be sent between threads safely

(although further message is rather big).

@jonas-schievink jonas-schievink added A-async-await Area: Async & Await C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 3, 2020
@csmoe csmoe removed A-async-await Area: Async & Await C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 3, 2020
@csmoe csmoe added A-async-await Area: Async & Await C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 3, 2020
@csmoe
Copy link
Member

csmoe commented Jan 3, 2020

Fixed by #67289

@csmoe csmoe closed this as completed Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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