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

unexpected panic in rustc #87286

Open
muellerpeter-pms opened this issue Jul 19, 2021 · 7 comments
Open

unexpected panic in rustc #87286

muellerpeter-pms opened this issue Jul 19, 2021 · 7 comments
Labels
C-bug Category: This is a bug. 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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@muellerpeter-pms
Copy link

Code

There is no special code, I tried to compile libc 0.2.98 as a dependency.

Meta

rustc --version --verbose:

rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: armv7-unknown-linux-gnueabihf
release: 1.53.0
LLVM version: 12.0.1

As you can see i try to compile on a raspberry pi

cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a020d3
Serial          : 000000008034e28d
Model           : Raspberry Pi 3 Model B Plus Rev 1.3

Error output

   Compiling autocfg v1.0.1
   Compiling libc v0.2.98
   Compiling proc-macro2 v1.0.27
   Compiling unicode-xid v0.2.2
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler
metadata/src/rmeta/decoder.rs:328:61
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
+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

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

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

query stack during panic:
end of query stack
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler
metadata/src/rmeta/decoder.rs:328:61
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
+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

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

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

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

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler
metadata/src/rmeta/decoder.rs:328:61
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
+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

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

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

query stack during panic:
end of query stack
error: build failed
Backtrace

   Compiling autocfg v1.0.1
   Compiling libc v0.2.98
   Compiling proc-macro2 v1.0.27
   Compiling unicode-xid v0.2.2
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler/rustc_metadata/src/rmeta/decoder.rs:328:61
stack backtrace:
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler/rustc_metadata/src/rmeta/decoder.rs:328:61
stack backtrace:
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler/rustc_metadata/src/rmeta/decoder.rs:328:61
stack backtrace:
error: could not compile `unicode-xid`

Caused by:
  process didn't exit successfully: `rustc --crate-name unicode_xid /home/pi/.cargo/registry/src/gitpro.ttaallkk.top-1285ae84e5963aae/unicode-xid-0.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=e095e5353733add3 -C extra-filename=-e095e5353733add3 --out-dir /home/pi/src/pms_home/target/debug/deps -L dependency=/home/pi/src/pms_home/target/debug/deps --cap-lints allow` (signal: 4, SIGILL: illegal instruction)
warning: build failed, waiting for other jobs to finish...
   0: rust_begin_unwind
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
   0: rust_begin_unwind
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:69:5
   0: rust_begin_unwind
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
   1: core::panicking::panic_fmt
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:69:5
   2: core::panicking::panic_bounds_check
             at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:69:5
   3: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::span_encoding::Span>::decode
   3: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::span_encoding::Span>::decode
   3: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::span_encoding::Span>::decode
   4: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::get_span_untracked
   4: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::get_span_untracked
   5: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module
   6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   5: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module
   6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   4: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::get_span_untracked
   5: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module
   6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   7: rustc_ast::visit::walk_item
   7: rustc_ast::visit::walk_item
   8: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   8: <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
   9: rustc_expand::expand::AstFragment::visit_with
   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
  10: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  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
  11: rustc_expand::expand::MacroExpander::collect_invocations
  11: rustc_expand::expand::MacroExpander::collect_invocations
  12: rustc_expand::expand::MacroExpander::fully_expand_fragment
  12: rustc_expand::expand::MacroExpander::fully_expand_fragment
  12: rustc_expand::expand::MacroExpander::fully_expand_fragment
  13: rustc_expand::expand::MacroExpander::expand_crate
  13: rustc_expand::expand::MacroExpander::expand_crate
  13: rustc_expand::expand::MacroExpander::expand_crate
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
  15: rustc_interface::passes::configure_and_expand_inner
  15: rustc_interface::passes::configure_and_expand_inner
  15: rustc_interface::passes::configure_and_expand_inner
  16: rustc_interface::passes::configure_and_expand::{{closure}}
  16: rustc_interface::passes::configure_and_expand::{{closure}}
  16: rustc_interface::passes::configure_and_expand::{{closure}}
  17: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  17: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  17: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  18: rustc_interface::passes::configure_and_expand
  18: rustc_interface::passes::configure_and_expand
  19: rustc_interface::queries::Queries::expansion
  19: rustc_interface::queries::Queries::expansion
  18: rustc_interface::passes::configure_and_expand
  19: rustc_interface::queries::Queries::expansion
  20: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  20: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  20: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  21: rustc_span::with_source_map
  21: rustc_span::with_source_map
  21: rustc_span::with_source_map
  22: rustc_interface::interface::create_compiler_and_run
  22: rustc_interface::interface::create_compiler_and_run
  22: rustc_interface::interface::create_compiler_and_run
  23: scoped_tls::ScopedKey<T>::set
  23: scoped_tls::ScopedKey<T>::set
  23: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.



error: internal compiler error: unexpected panic

error: internal compiler error: unexpected panic

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.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

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

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

query stack during panic:
end of query stack
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.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

note: the compiler unexpectedly panicked. this is a bug.
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib


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

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
query stack during panic:

note: rustc 1.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf
end of query stack

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

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

query stack during panic:
end of query stack
error: build failed

@muellerpeter-pms muellerpeter-pms 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 Jul 19, 2021
@muellerpeter-pms
Copy link
Author

this also happens to a completely fresh project without any dependencies.

tcargo v0.1.0 (/home/pi/src/tcargo)
thread 'rustc' panicked at 'index out of bounds: the len is 18 but the index is 56', compiler/rustc_metadata/src/rmeta/decoder.rs:328:61
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.53.0 (53cb7b09b 2021-06-17) running on armv7-unknown-linux-gnueabihf

note: compiler flags: -C embed-bitcode=no -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 `tcargo`

To learn more, run the command again with --verbose.

@jyn514
Copy link
Member

jyn514 commented Jul 20, 2021

Does this still happen on nightly? It may have been fixed by #86876.

@muellerpeter-pms
Copy link
Author

It also panics but the message is another one.
The project is an untouched new one created with cargo new.

cargo +nightly b
   Compiling tcargo v0.1.0 (/home/pi/src/tcargo)
thread 'rustc' panicked at 'called `set` on feature `` which is not `active`', compiler/rustc_feature/src/active.rs:100:18
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.55.0-nightly (59216858a 2021-07-18) running on armv7-unknown-linux-gnueabihf

note: compiler flags: -C embed-bitcode=no -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 `tcargo`

@jyn514
Copy link
Member

jyn514 commented Jul 20, 2021

Hmm, interesting. Can you post the backtrace for that second panic?

@muellerpeter-pms
Copy link
Author

here is the backtrace:

Compiling tcargo v0.1.0 (/home/pi/src/tcargo)
thread 'rustc' panicked at 'called `set` on feature `` which is not `active`', compiler/rustc_feature/src/active.rs:100:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/59216858a323978a97593cba22b5ed84350a3783/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/59216858a323978a97593cba22b5ed84350a3783/library/std/src/panicking.rs:457:5
   2: rustc_feature::active::<impl rustc_feature::Feature>::set
   3: rustc_expand::config::features
   4: rustc_interface::passes::register_plugins
   5: rustc_interface::queries::Queries::register_plugins
   6: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
   7: rustc_span::with_source_map
   8: rustc_interface::interface::create_compiler_and_run
   9: 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.55.0-nightly (59216858a 2021-07-18) running on armv7-unknown-linux-gnueabihf

note: compiler flags: -C embed-bitcode=no -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 `tcargo````

@muellerpeter-pms
Copy link
Author

Hi,

is there anything new about that? Can I assist in any way further?

@JohnTitor JohnTitor added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Jul 29, 2021
@Enselic
Copy link
Member

Enselic commented Sep 8, 2023

Triage: @muellerpeter-pms One way to help right now is to see if you can still reproduce on latest nightly. If you know how to reproduce this without a physical Raspberry Pie, that would also be great.

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) ❄️ O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state 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

4 participants