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

Internal compiler error compiling Neovide #99284

Closed
nowave7 opened this issue Jul 15, 2022 · 2 comments · Fixed by #99263
Closed

Internal compiler error compiling Neovide #99284

nowave7 opened this issue Jul 15, 2022 · 2 comments · Fixed by #99263
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

@nowave7
Copy link

nowave7 commented Jul 15, 2022

Code

I'm unable to isolate a small piece of code. In order to reproduce this bug, please clone the following repository, with this specific hash

git clone https://github.com/neovide/neovide.git
48dfe95b6e3b2552afbf805921aeeb26cf124d05

Meta

rustc --version --verbose:

rustc 1.64.0-nightly (c2f428d2f 2022-07-14)
binary: rustc
commit-hash: c2f428d2f3340a0e7d995f4726223db91b93704c
commit-date: 2022-07-14
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6

Error output

error: internal compiler error: unexpected panic
Backtrace

   Compiling time v0.3.11
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 2', compiler/rustc_builtin_macros/src/format.rs:1001:28
stack backtrace:
   0:     0x7f89e94be950 - std::backtrace_rs::backtrace::libunwind::trace::heeafe1f1ea6b4c2f
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f89e94be950 - std::backtrace_rs::backtrace::trace_unsynchronized::hf08684e78cd6c167
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f89e94be950 - std::sys_common::backtrace::_print_fmt::had9e99c2c8763a1e
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f89e94be950 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b4c432d2a1e6303
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f89e9517f2c - core::fmt::write::h87085de871a99231
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/fmt/mod.rs:1198:17
   5:     0x7f89e94b0015 - std::io::Write::write_fmt::h7635d2f423aa55dc
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/io/mod.rs:1672:15
   6:     0x7f89e94c15e1 - std::sys_common::backtrace::_print::hc003bc1c22b7967b
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f89e94c15e1 - std::sys_common::backtrace::print::h1baa1ab7758e52b0
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f89e94c15e1 - std::panicking::default_hook::{{closure}}::he2f5e84c6ab77817
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:295:22
   9:     0x7f89e94c12b3 - std::panicking::default_hook::h3f96069db270c68f
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:314:9
  10:     0x7f89e9ce8de4 - rustc_driver[1ce26eb46f30f4d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f89e94c1db6 - std::panicking::rust_panic_with_hook::hed0c1597bbc695a6
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:702:17
  12:     0x7f89e94c1c07 - std::panicking::begin_panic_handler::{{closure}}::h0fc9e6b3154da131
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:588:13
  13:     0x7f89e94bee34 - std::sys_common::backtrace::__rust_end_short_backtrace::hb9c2240a67931ff9
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f89e94c1932 - rust_begin_unwind
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:584:5
  15:     0x7f89e9485c33 - core::panicking::panic_fmt::h6bda1b0556b509cd
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/panicking.rs:142:14
  16:     0x7f89e9485b72 - core::panicking::panic_bounds_check::hf8fc252dfbb36006
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/panicking.rs:84:5
  17:     0x7f89ec123643 - rustc_builtin_macros[6a564b3b10d3c327]::format::expand_preparsed_format_args
  18:     0x7f89ec11cdac - rustc_builtin_macros[6a564b3b10d3c327]::format::expand_format_args_impl
  19:     0x7f89eba5bbed - <rustc_expand[ec7f7165620ca96d]::expand::MacroExpander>::fully_expand_fragment
  20:     0x7f89ec5d094b - <rustc_expand[ec7f7165620ca96d]::expand::MacroExpander>::expand_crate
  21:     0x7f89ebef5aa2 - <rustc_session[4ac326324d613686]::session::Session>::time::<core[32c218dbf3427c26]::result::Result<rustc_ast[f9ddef6e3c579104]::ast::Crate, rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_interface[694c7ab70a1d38bc]::passes::configure_and_expand::{closure#1}>
  22:     0x7f89ebedf832 - rustc_interface[694c7ab70a1d38bc]::passes::configure_and_expand
  23:     0x7f89ebeec2c1 - <rustc_interface[694c7ab70a1d38bc]::queries::Queries>::expansion
  24:     0x7f89ebeaafcc - <rustc_interface[694c7ab70a1d38bc]::interface::Compiler>::enter::<rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}::{closure#2}, core[32c218dbf3427c26]::result::Result<core[32c218dbf3427c26]::option::Option<rustc_interface[694c7ab70a1d38bc]::queries::Linker>, rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
  25:     0x7f89ebea71ff - rustc_span[717885ec7c6cd182]::with_source_map::<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_interface[694c7ab70a1d38bc]::interface::create_compiler_and_run<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#1}>
  26:     0x7f89ebec34b0 - rustc_interface[694c7ab70a1d38bc]::interface::create_compiler_and_run::<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>
  27:     0x7f89ebed75b2 - <scoped_tls[f235d80db834c386]::ScopedKey<rustc_span[717885ec7c6cd182]::SessionGlobals>>::set::<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
  28:     0x7f89ebea978f - std[167b23ae759531ff]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[694c7ab70a1d38bc]::util::run_in_thread_pool_with_globals<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
  29:     0x7f89ebec3909 - <<std[167b23ae759531ff]::thread::Builder>::spawn_unchecked_<rustc_interface[694c7ab70a1d38bc]::util::run_in_thread_pool_with_globals<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#1} as core[32c218dbf3427c26]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x7f89e94cb803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h86b1834fb0da834b
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/alloc/src/boxed.rs:1934:9
  31:     0x7f89e94cb803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h124d05192aaf60e0
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/alloc/src/boxed.rs:1934:9
  32:     0x7f89e94cb803 - std::sys::unix::thread::Thread::new::thread_start::h01e8d05fb6e030ea
                               at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys/unix/thread.rs:108:17
  33:     0x7f89e9259927 - start_thread
                               at ./nptl/./nptl/pthread_create.c:435:8
  34:     0x7f89e92e99e4 - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
  35:                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.64.0-nightly (c2f428d2f 2022-07-14) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C linker-plugin-lto

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

query stack during panic:
end of query stack
error: could not compile `time`
warning: build failed, waiting for other jobs to finish...

@nowave7 nowave7 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 15, 2022
@nowave7
Copy link
Author

nowave7 commented Jul 15, 2022

This looks to be a duplicate of the bug #99273
Which is in turn a duplicate of #99261

@nowave7
Copy link
Author

nowave7 commented Jul 15, 2022

Closing as a duplicate.

@nowave7 nowave7 closed this as completed Jul 15, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 16, 2022
Fix ICE in `named_arguments_used_positionally` lint

Fixes rust-lang#99261
Fixes rust-lang#99289
Fixes rust-lang#99284
Fixes rust-lang#99273
Fixes rust-lang#99297
Fixes rust-lang#99271

This match pattern:

```
 FormatSpec { width: Count::CountIsName(s, _), .. }
| FormatSpec { precision: Count::CountIsName(s, _), .. }
```

does not account for when both `width` and `precision` are both `Count::CountIsName`, so split the check for these two fields into two separate `if let`.

Also, remove any future potential for ICEs by removing the index operator altogether.

---

It is still suspicious that this indexing was broken and caused the ICE, as opposed to just causing a spurious lint message.

cc `@PrestonFrom,` who may be familiar with this code because of implementing the lint this touches, perhaps you'd like to look into why named arguments in `FormatSpec.precision` seem to have indices that don't correspond to a span in `Context.arg_spans`?

Edit: Opened rust-lang#99265 to track a (related?) incorrect argument indexing issue.
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

Successfully merging a pull request may close this issue.

1 participant