Skip to content

rmeta encoder panic #117045

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

Closed
crides opened this issue Oct 22, 2023 · 2 comments
Closed

rmeta encoder panic #117045

crides opened this issue Oct 22, 2023 · 2 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

@crides
Copy link

crides commented Oct 22, 2023

Code

I don't think I can find a minimum example now (it's almost 2am), but the error is produced when compiling wezterm, specifically the wezterm-dynamic crate.

rustc also noted:

note: compiler flags: --crate-type rlib -C opt-level=3 -C embed-bitcode=no

This is actually a bit weird. I successfully compiled wezterm in release mode, opened neovim for some changes (which also runs rust-analyzer), and the ICE is hit when recompiling. cargo cleaning the wezterm-dynamic package doesn't help.

I'm currently on commit fec90ae04bf448d4b1475ba1d0ba1392846a70d6 of wezterm

Meta

rustc --version --verbose:

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2

Error output

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:442:9:
assertion failed: pos.get() <= self.position()
Backtrace

stack backtrace:
   0:     0x7f58c816349c - std::backtrace_rs::backtrace::libunwind::trace::he43a6a3949163f8c
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f58c816349c - std::backtrace_rs::backtrace::trace_unsynchronized::h50db52ca99f692e7
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f58c816349c - std::sys_common::backtrace::_print_fmt::hd37d595f2ceb2d3c
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f58c816349c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h678bbcf9da6d7d75
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f58c81c93fc - core::fmt::rt::Argument::fmt::h3a159adc080a6fc9
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/rt.rs:138:9
   5:     0x7f58c81c93fc - core::fmt::write::hb8eaf5a8e45a738e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f58c815612e - std::io::Write::write_fmt::h9663fe36b2ee08f9
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/io/mod.rs:1714:15
   7:     0x7f58c8163284 - std::sys_common::backtrace::_print::hcd4834796ee88ad2
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f58c8163284 - std::sys_common::backtrace::print::h1360e9450e4f922a
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f58c8166193 - std::panicking::default_hook::{{closure}}::h2609fa95cd5ab1f4
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:270:22
  10:     0x7f58c8165eac - std::panicking::default_hook::h6d75f5747cab6e8d
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:290:9
  11:     0x7f58cb330a3e - <alloc[98253621d83cbf53]::boxed::Box<rustc_driver_impl[566d207f92c3d9d2]::install_ice_hook::{closure#0}> as core[d28c4e8d9c4eebaa]::ops::function::Fn<(&dyn for<'a, 'b> core[d28c4e8d9c4eebaa]::ops::function::Fn<(&'a core[d28c4e8d9c4eebaa]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[d28c4e8d9c4eebaa]::marker::Sync + core[d28c4e8d9c4eebaa]::marker::Send, &core[d28c4e8d9c4eebaa]::panic::panic_info::PanicInfo)>>::call
  12:     0x7f58c81669be - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h05249de742e1768e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2021:9
  13:     0x7f58c81669be - std::panicking::rust_panic_with_hook::h57e78470c47c84de
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:711:13
  14:     0x7f58c8166701 - std::panicking::begin_panic_handler::{{closure}}::h3dfd2453cf356ecb
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:597:13
  15:     0x7f58c81639c6 - std::sys_common::backtrace::__rust_end_short_backtrace::hdb177d43678e4d7e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f58c8166492 - rust_begin_unwind
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
  17:     0x7f58c81c5803 - core::panicking::panic_fmt::hd1e971d8d7c78e0e
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
  18:     0x7f58c81c5893 - core::panicking::panic::hd907d42d09324a32
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:117:5
  19:     0x7f58ca6a161c - <rustc_span[4c9f011e8b033119]::hygiene::HygieneEncodeContext>::encode::<(&mut rustc_metadata[e6fe6e19e901579]::rmeta::encoder::EncodeContext, &mut rustc_metadata[e6fe6e19e901579]::rmeta::table::TableBuilder<u32, core[d28c4e8d9c4eebaa]::option::Option<rustc_metadata[e6fe6e19e901579]::rmeta::LazyValue<rustc_span[4c9f011e8b033119]::hygiene::SyntaxContextData>>>, &mut rustc_metadata[e6fe6e19e901579]::rmeta::table::TableBuilder<rustc_span[4c9f011e8b033119]::hygiene::ExpnIndex, core[d28c4e8d9c4eebaa]::option::Option<rustc_metadata[e6fe6e19e901579]::rmeta::LazyValue<rustc_span[4c9f011e8b033119]::hygiene::ExpnData>>>, &mut rustc_metadata[e6fe6e19e901579]::rmeta::table::TableBuilder<rustc_span[4c9f011e8b033119]::hygiene::ExpnIndex, core[d28c4e8d9c4eebaa]::option::Option<rustc_metadata[e6fe6e19e901579]::rmeta::LazyValue<rustc_span[4c9f011e8b033119]::hygiene::ExpnHash>>>), <rustc_metadata[e6fe6e19e901579]::rmeta::encoder::EncodeContext>::encode_hygiene::{closure#0}, <rustc_metadata[e6fe6e19e901579]::rmeta::encoder::EncodeContext>::encode_hygiene::{closure#1}>
  20:     0x7f58ca680476 - <rustc_metadata[e6fe6e19e901579]::rmeta::encoder::EncodeContext>::encode_crate_root
  21:     0x7f58ca5fdea8 - rustc_metadata[e6fe6e19e901579]::rmeta::encoder::encode_metadata_impl
  22:     0x7f58ca5f3559 - rustc_metadata[e6fe6e19e901579]::rmeta::encoder::encode_metadata
  23:     0x7f58ca5f1bfc - rustc_metadata[e6fe6e19e901579]::fs::encode_and_write_metadata
  24:     0x7f58ca5e7e40 - rustc_interface[5bdd18de9f5858d8]::passes::start_codegen
  25:     0x7f58ca5e24fa - <rustc_middle[5935fdd60c99b3fe]::ty::context::GlobalCtxt>::enter::<<rustc_interface[5bdd18de9f5858d8]::queries::Queries>::ongoing_codegen::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<alloc[98253621d83cbf53]::boxed::Box<dyn core[d28c4e8d9c4eebaa]::any::Any>, rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>
  26:     0x7f58ca5e19a6 - <rustc_interface[5bdd18de9f5858d8]::interface::Compiler>::enter::<rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}::{closure#2}, core[d28c4e8d9c4eebaa]::result::Result<core[d28c4e8d9c4eebaa]::option::Option<rustc_interface[5bdd18de9f5858d8]::queries::Linker>, rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>
  27:     0x7f58ca5dec68 - std[3759e478f3a6c4f2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5bdd18de9f5858d8]::util::run_in_thread_pool_with_globals<rustc_interface[5bdd18de9f5858d8]::interface::run_compiler<core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>, rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}>::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>
  28:     0x7f58ca5de3ee - <<std[3759e478f3a6c4f2]::thread::Builder>::spawn_unchecked_<rustc_interface[5bdd18de9f5858d8]::util::run_in_thread_pool_with_globals<rustc_interface[5bdd18de9f5858d8]::interface::run_compiler<core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>, rustc_driver_impl[566d207f92c3d9d2]::run_compiler::{closure#1}>::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d28c4e8d9c4eebaa]::result::Result<(), rustc_span[4c9f011e8b033119]::ErrorGuaranteed>>::{closure#1} as core[d28c4e8d9c4eebaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f58c8171295 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haadd4e5af2ab0d62
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2007:9
  30:     0x7f58c8171295 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he4ba1fb09c16d807
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/boxed.rs:2007:9
  31:     0x7f58c8171295 - std::sys::unix::thread::Thread::new::thread_start::he524ecf4b47bee95
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/thread.rs:108:17
  32:     0x7f58c7e8c9eb - <unknown>
  33:     0x7f58c7f10dfc - <unknown>
  34:                0x0 - <unknown>

@crides crides 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 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 22, 2023
@crides
Copy link
Author

crides commented Oct 22, 2023

Uhh apparently my disk was full. Clearing up made that go away. Would be nice if there's a proper message for something like this

@lqd
Copy link
Member

lqd commented Oct 22, 2023

This failure on a full disk has had many duplicates in the past and will not ICE like this anymore. This was fixed on nightly and beta by @saethlin in #115542 and will be stable in 1.74 in 3 weeks or so.

Let's close this as fixed, feel free to reopen if it happens again from 1.74 forward.

@lqd lqd closed this as completed Oct 22, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 22, 2023
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

4 participants