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

"Provided allocation has wrong size for slot count 131072", "the compiler unexpectedly panicked. this is a bug" #89749

Closed
eliasrudberg opened this issue Oct 10, 2021 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eliasrudberg
Copy link

Code

I don't have a minimal verifiable example for this, but here is how to reproduce it:

git clone https://github.com/signalapp/zkgroup.git
cd zkgroup/
git checkout bbd71fd1fb56 # to make it specific, not sure if the exact commit matters
make libzkgroup

that leads to the error:

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (aa8f2d432 2021-09-18)
binary: rustc
commit-hash: aa8f2d432b23575929a48f87b8746f41ba723318
commit-date: 2021-09-18
host: aarch64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

Error output

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
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.57.0-nightly (aa8f2d432 2021-09-18) running on aarch64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debug-assertions=off -C link-arg=-s --crate-type bin
Backtrace

<backtrace>

RUST_BACKTRACE=1 make libzkgroup gives the following backtrace:

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
stack backtrace:
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
stack backtrace:
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
stack backtrace:
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
stack backtrace:
   0: rust_begin_unwind
             at /rustc/aa8f2d432b23575929a48f87b8746f41ba723318/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/aa8f2d432b23575929a48f87b8746f41ba723318/library/core/src/panicking.rs:103:14
   2: core::result::unwrap_failed
             at /rustc/aa8f2d432b23575929a48f87b8746f41ba723318/library/core/src/result.rs:1617:5
   3: rustc_metadata::rmeta::decoder::CrateMetadata::new
   4: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   5: rustc_metadata::creader::CrateLoader::process_extern_crate
   6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   7: rustc_ast::visit::walk_item
   8: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   9: rustc_expand::expand::AstFragment::visit_with
  10: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  11: rustc_expand::expand::MacroExpander::collect_invocations
  12: rustc_expand::expand::MacroExpander::fully_expand_fragment
  13: rustc_expand::expand::MacroExpander::expand_crate
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  15: rustc_interface::passes::configure_and_expand
  16: rustc_interface::queries::Queries::expansion
  17: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  18: rustc_span::with_source_map
  19: scoped_tls::ScopedKey<T>::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.57.0-nightly (aa8f2d432 2021-09-18) running on aarch64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C link-arg=-s --crate-type lib

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

query stack during panic:
end of query stack

followed by similar backtrace for the other three threads, looks like whatever the problem was, it happened in the same way for 4 threads.

@eliasrudberg eliasrudberg added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 10, 2021
@klensy
Copy link
Contributor

klensy commented Oct 11, 2021

Duplicate #89085? Try nightly 2021-09-21 at least.

@eliasrudberg
Copy link
Author

Hello @klensy and thanks for the advice. Now I tried doing "rustup override set nightly-2021-09-22" first which gave me version "rustc 1.57.0-nightly (ac2d9fc 2021-09-21)" and then things work, I no longer get the error.

@JohnTitor
Copy link
Member

I presume this is a duplicate of the mentioned issue and am going to close as fixed. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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