Skip to content

Run hello world error on m1 mbp(macOS 12.0 (21A5506j)) #89085

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
xunfeng1980 opened this issue Sep 19, 2021 · 16 comments
Closed

Run hello world error on m1 mbp(macOS 12.0 (21A5506j)) #89085

xunfeng1980 opened this issue Sep 19, 2021 · 16 comments
Labels
A-metadata Area: Crate metadata C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS 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

@xunfeng1980
Copy link

Code

fn main() {
    println!("Hello, world!");
}

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-apple-darwin
release: 1.57.0-nightly
LLVM version: 13.0.0

Error output

<output>
Backtrace

❯ RUST_BACKTRACE=1 cargo build
   Compiling light v0.1.0 (/Users/lux/src/github.com/xunfeng1980/light)
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
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rustc_metadata::rmeta::decoder::CrateMetadata::new
   4: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   5: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   6: rustc_metadata::creader::CrateLoader::process_extern_crate
   7: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   8: rustc_ast::visit::walk_item
   9: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
  10: rustc_expand::expand::AstFragment::visit_with
  11: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  12: rustc_expand::expand::MacroExpander::collect_invocations
  13: rustc_expand::expand::MacroExpander::fully_expand_fragment
  14: rustc_expand::expand::MacroExpander::expand_crate
  15: rustc_session::utils::<impl rustc_session::session::Session>::time
  16: rustc_interface::passes::configure_and_expand
  17: rustc_interface::queries::Queries::expansion
  18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  19: rustc_span::with_source_map
  20: 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-apple-darwin

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

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

query stack during panic:
end of query stack
error: could not compile `light`

@xunfeng1980 xunfeng1980 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 Sep 19, 2021
@xunfeng1980 xunfeng1980 changed the title run rust helloword on m1 mbp(macOS 12.0 (21A5506j)) error run rust hello world on m1 mbp(macOS 12.0 (21A5506j)) error Sep 19, 2021
@xunfeng1980 xunfeng1980 changed the title run rust hello world on m1 mbp(macOS 12.0 (21A5506j)) error Run hello world on m1 mbp(macOS 12.0 (21A5506j)) error Sep 19, 2021
@xunfeng1980 xunfeng1980 changed the title Run hello world on m1 mbp(macOS 12.0 (21A5506j)) error Run hello world error on m1 mbp(macOS 12.0 (21A5506j)) Sep 19, 2021
@ryanolf
Copy link

ryanolf commented Sep 19, 2021

I also have m1 MBP and nightly 2021-09-18 does this for me but 2021-09-17 is fine. I suspect a lot of people are going to notice this.

@Urgau
Copy link
Member

Urgau commented Sep 19, 2021

@rustbot label +I-prioritize +requires-nightly +regression-from-nightly-to-nightly

@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. requires-nightly This issue requires a nightly compiler in some way. labels Sep 19, 2021
@camelid camelid added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed requires-nightly This issue requires a nightly compiler in some way. labels Sep 19, 2021
@camelid
Copy link
Member

camelid commented Sep 19, 2021

I haven't bisected, but #82183 looks to have landed in nightly-2021-09-18, so cc @michaelwoerister (also they are more knowledgeable about this code in general).

@camelid camelid added the A-metadata Area: Crate metadata label Sep 19, 2021
@hkratz
Copy link
Contributor

hkratz commented Sep 19, 2021

Indeed. Bisected to d6cd2c6 which is #82183.

@Aaron1011
Copy link
Member

@Aaron1011
Copy link
Member

cc @michaelwoerister

@hkratz
Copy link
Contributor

hkratz commented Sep 20, 2021

Hmm, can't reproduce with rustc built locally on an M1 macbook with a default config.toml, how are the nightlies built?

@tifrel
Copy link

tifrel commented Sep 20, 2021

Hmm, can't reproduce with rustc built locally on an M1 macbook, how are the nightlies built?

Opposing question, how do I build rustc locally?

@michaelwoerister
Copy link
Member

I'll look into it.

@michaelwoerister
Copy link
Member

I think this is a cross-compilation related issue. The aarch64-apple-darwin compiler seems to be built on x86_64-apple-darwin and because of that the odht crate makes some assumptions that are true for x86_64 but not for aarch64. So the bug is odht making platform dependent assumptions where it shouldn't.

I hope I can fix this without having an aarch64-apple-darwin device available. @rust-lang/infra, do we not run tests on aarch64-apple-darwin? Or is the compiler we use for testing built differently from the dist build?

@tifrel, you can find a description of how to build the compiler locally at https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html.

@shepmaster
Copy link
Member

we not run tests on aarch64-apple-darwin

that’s correct. GitHub does not offer M1 machines for CI.

@michaelwoerister
Copy link
Member

I have a potential fix for this issue in rust-lang/odht#16. Once that is merged the compiler needs to be updated to use the new version of odht too.

michaelwoerister added a commit to michaelwoerister/rust that referenced this issue Sep 20, 2021
This version of odht contains a potential fix for rust-lang#89085.
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 20, 2021
…r=wesleywiser

Update odht crate to 0.3.0

This version of odht contains a potential fix for rust-lang#89085.

r? `@wesleywiser`
@camelid
Copy link
Member

camelid commented Sep 20, 2021

The fix looks to have landed in time to be included in the 2021-09-20 nightly being released in a few hours.

@camelid
Copy link
Member

camelid commented Sep 21, 2021

Note that there was an error building the 2021-09-20 nightly, so it wasn't actually released. Hopefully the 2021-09-21 nightly will build successfully and be released in ~8 hours.

@xunfeng1980
Copy link
Author

Note that there was an error building the 2021-09-20 nightly, so it wasn't actually released. Hopefully the 2021-09-21 nightly will build successfully and be released in ~8 hours.

yep, 2021-09-21 nightly version is normal

@camelid camelid removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 22, 2021
@michaelwoerister
Copy link
Member

Awesome :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-metadata Area: Crate metadata C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS 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

10 participants