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

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:1888:17 #120830

Closed
weiznich opened this issue Feb 9, 2024 · 6 comments · Fixed by #121167
Closed

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:1888:17 #120830

weiznich opened this issue Feb 9, 2024 · 6 comments · Fixed by #121167
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority 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

@weiznich
Copy link
Contributor

weiznich commented Feb 9, 2024

Code

diesel-rs/diesel@dfeec4b

Clone the repo and, set RUSTFLAGS=-Zsanitizer=address run cargo test --manifest-path diesel_tests/Cargo.toml --no-default-features --features "sqlite libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan" --target x86_64-unknown-linux-gnu to reproduce the ICE

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (98aa3624b 2024-02-08)
binary: rustc
commit-hash: 98aa3624be70462d6a25ed5544333e3df62f4c66
commit-date: 2024-02-08
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 17.0.6

Error output

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:1888:17:
assertion `left == right` failed
  left: crate29
 right: crate28
Backtrace

stack backtrace:
   0:     0x7f6d427f5dd6 - std::backtrace_rs::backtrace::libunwind::trace::hcf4842620364d535
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f6d427f5dd6 - std::backtrace_rs::backtrace::trace_unsynchronized::h615a7d3c4b72d07a
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6d427f5dd6 - std::sys_common::backtrace::_print_fmt::h777946980bbce9d4
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f6d427f5dd6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0fdadf67cf82c3e5
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f6d42848830 - core::fmt::rt::Argument::fmt::h40bec717748a6a66
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/core/src/fmt/rt.rs:142:9
   5:     0x7f6d42848830 - core::fmt::write::hfb3923fb2f513fc0
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f6d427e964f - std::io::Write::write_fmt::h7dd8ba1b7fdc9479
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/io/mod.rs:1854:15
   7:     0x7f6d427f5bb4 - std::sys_common::backtrace::_print::hffce9865d8ccd857
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f6d427f5bb4 - std::sys_common::backtrace::print::h532d3566cc4254d4
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f6d427f8947 - std::panicking::default_hook::{{closure}}::hfa7000b32c4e888b
  10:     0x7f6d427f86a9 - std::panicking::default_hook::haaf1b4b762fde1ac
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/panicking.rs:292:9
  11:     0x7f6d3f33b78c - std[5c40b41967587ec6]::panicking::update_hook::<alloc[5d4b954b8b3d7648]::boxed::Box<rustc_driver_impl[ab5bb327712dbf0b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f6d427f9096 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4c230f69fdc2df31
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/alloc/src/boxed.rs:2029:9
  13:     0x7f6d427f9096 - std::panicking::rust_panic_with_hook::h89e8d9a00153591c
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/panicking.rs:785:13
  14:     0x7f6d427f8de2 - std::panicking::begin_panic_handler::{{closure}}::h0fe7a7a11cf6b670
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/panicking.rs:659:13
  15:     0x7f6d427f62d6 - std::sys_common::backtrace::__rust_end_short_backtrace::h5875974741c16bab
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f6d427f8b34 - rust_begin_unwind
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/panicking.rs:647:5
  17:     0x7f6d42844f35 - core::panicking::panic_fmt::h58288a9f4ffa83be
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/core/src/panicking.rs:72:14
  18:     0x7f6d428454cb - core::panicking::assert_failed_inner::h22c9753a230525e4
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/core/src/panicking.rs:342:17
  19:     0x7f6d3f6e5767 - core[2f2a284c56ca7af5]::panicking::assert_failed::<rustc_span[e69a7bbb34a31e54]::def_id::CrateNum, rustc_span[e69a7bbb34a31e54]::def_id::CrateNum>
  20:     0x7f6d415f9fc2 - <rustc_metadata[c819bf0142ad3cc8]::rmeta::encoder::EncodeContext>::encode_crate_root
  21:     0x7f6d41618f3b - rustc_metadata[c819bf0142ad3cc8]::rmeta::encoder::encode_metadata
  22:     0x7f6d41617568 - rustc_metadata[c819bf0142ad3cc8]::fs::encode_and_write_metadata
  23:     0x7f6d415a0bc3 - rustc_interface[f5c5c4389ec3cf3a]::passes::start_codegen
  24:     0x7f6d415a03b4 - <rustc_interface[f5c5c4389ec3cf3a]::queries::Queries>::codegen_and_build_linker
  25:     0x7f6d4131744c - rustc_interface[f5c5c4389ec3cf3a]::interface::run_compiler::<core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>, rustc_driver_impl[ab5bb327712dbf0b]::run_compiler::{closure#0}>::{closure#0}
  26:     0x7f6d40fa9386 - std[5c40b41967587ec6]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[f5c5c4389ec3cf3a]::util::run_in_thread_with_globals<rustc_interface[f5c5c4389ec3cf3a]::util::run_in_thread_pool_with_globals<rustc_interface[f5c5c4389ec3cf3a]::interface::run_compiler<core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>, rustc_driver_impl[ab5bb327712dbf0b]::run_compiler::{closure#0}>::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>
  27:     0x7f6d40fa91b3 - <<std[5c40b41967587ec6]::thread::Builder>::spawn_unchecked_<rustc_interface[f5c5c4389ec3cf3a]::util::run_in_thread_with_globals<rustc_interface[f5c5c4389ec3cf3a]::util::run_in_thread_pool_with_globals<rustc_interface[f5c5c4389ec3cf3a]::interface::run_compiler<core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>, rustc_driver_impl[ab5bb327712dbf0b]::run_compiler::{closure#0}>::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2f2a284c56ca7af5]::result::Result<(), rustc_span[e69a7bbb34a31e54]::ErrorGuaranteed>>::{closure#1} as core[2f2a284c56ca7af5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  28:     0x7f6d42802735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd35908ec403131f0
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/alloc/src/boxed.rs:2015:9
  29:     0x7f6d42802735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6d654616ee0757b9
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/alloc/src/boxed.rs:2015:9
  30:     0x7f6d42802735 - std::sys::pal::unix::thread::Thread::new::thread_start::h987e3b25a01ed571
                               at /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/std/src/sys/pal/unix/thread.rs:108:17
  31:     0x7f6d425bd897 - start_thread
  32:     0x7f6d4264480c - clone3

  33:                0x0 - <unknown>

rustc-ice-2024-02-09T07_36_46-724311.txt

Running cargo bisect-rustc points to #120767

searched nightlies: from nightly-2024-02-08 to nightly-2024-02-09
regressed nightly: nightly-2024-02-09
searched commit range: 8ace7ea...98aa362
regressed commit: 1280928

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

RUSTFLAGS=-Zsanitizer=address cargo bisect-rustc --start=2024-02-08 --end=2024-02-09 --with-src -- test --manifest-path diesel_tests/Cargo.toml --no-default-features --features sqlite libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan --target x86_64-unknown-linux-gnu --no-run 
@weiznich weiznich 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 Feb 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 9, 2024
@weiznich
Copy link
Contributor Author

weiznich commented Feb 9, 2024

From looking at the list of PR's in that rollup PR, it might be #119592? So cc @petrochenkov

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 9, 2024

cargo-bisect-rustc v0.6.5

if you update to 0.6.8 you may be able to bisect the specific merge inside the rollup that caused this :)
at least the latest version can do that

@weiznich
Copy link
Contributor Author

weiznich commented Feb 9, 2024

Thanks for letting me know. The new output is:

searched nightlies: from nightly-2024-02-08 to nightly-2024-02-09
regressed nightly: nightly-2024-02-09
searched commit range: 8ace7ea...98aa362
regressed commit: 1280928

bisected with cargo-bisect-rustc v0.6.8

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2024-02-08 --end=2024-02-09 --with-src -- test --manifest-path diesel_tests/Cargo.toml --no-default-features --features sqlite libsqlite3-sys libsqlite3-sys/bundled libsqlite3-sys/with-asan --target x86_64-unknown-linux-gnu --no-run 

So yes, that was introduced by #119592

weiznich added a commit to weiznich/diesel that referenced this issue Feb 9, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
weiznich added a commit to weiznich/diesel that referenced this issue Feb 9, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
weiznich added a commit to weiznich/diesel that referenced this issue Feb 9, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
weiznich added a commit to weiznich/diesel that referenced this issue Feb 9, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
@weiznich
Copy link
Contributor Author

weiznich commented Feb 9, 2024

I just want to leave another note here: Using RUSTFLAGS=-Zsanitizer=address is not necessary. You can reproduce this issue with cargo +nightly test -p diesel_tests --no-default-features -F sqlite in the linked repo

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 11, 2024
@saethlin saethlin added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Feb 13, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 13, 2024
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 13, 2024
@petrochenkov petrochenkov self-assigned this Feb 13, 2024
@petrochenkov
Copy link
Contributor

Fixed in #121167.

weiznich added a commit to weiznich/diesel that referenced this issue Feb 19, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
Noratrieb added a commit to Noratrieb/rust that referenced this issue Feb 20, 2024
resolve: Scale back unloading of speculatively loaded crates

Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772.

I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
Noratrieb added a commit to Noratrieb/rust that referenced this issue Feb 20, 2024
resolve: Scale back unloading of speculatively loaded crates

Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772.

I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
@bors bors closed this as completed in 073d298 Feb 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 20, 2024
Rollup merge of rust-lang#121167 - petrochenkov:unload2, r=wesleywiser

resolve: Scale back unloading of speculatively loaded crates

Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772.

I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
weiznich added a commit to 1Dragoon/diesel that referenced this issue Mar 14, 2024
We also need to fix the sqlite-bundled job to the yesterday nightly due
to rust-lang/rust#120830
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) ❄️ P-critical Critical priority 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
6 participants