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

enable -Zrandomize-layout in debug CI builds #101339

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Sep 2, 2022

This builds rustc/libs/tools with -Zrandomize-layout on *-debug CI runners.

Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives.

The config.toml flag rust.randomize-layout takes its default from rust.debug as overflow checks and debug asserts do too.

Edit(@jyn514): this is currently blocked on #101646

…layout

Additionally teach compiletest to ignore tests that rely on deterministic layout.
Tests themselves aren't built with randomization but they can still observe
slight changes in std or rustc
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 2, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 2, 2022
@the8472
Copy link
Member Author

the8472 commented Sep 2, 2022

r? @jyn514

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable, but I'm worried it makes tests more flaky. What's the plan if we merge this and suddenly a quarter of all PRs start failing randomly? I guess "revert until the tests are fixed" is good enough.

I don't see any changes to src/ci - are there already some builders that enable rust.debug? Which builders are those? Because this disables tests I want to be careful about where we enable it, we should have at least one builder on each platform with randomized layouts disabled.

config.toml.example Show resolved Hide resolved
Comment on lines +1446 to +1448
if builder.config.rust_randomize_layout {
cmd.arg("--rust-randomized-layout");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been meaning to refactor this for a while, your change only affects compiletest :( there's no one place to put it so it also affects src/test/{codegen,run-make,debuginfo}.

compiletest seems good enough for now, but it would be nice to add this everywhere else if you have time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That flag is there for the needs-deterministic-layouts directive. As long as those test types don't get broken by randomization we won't need it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as those test types don't get broken by randomization we won't need it.

well, that's what I'm worried about 😅 but given this is all internal-only, I'm fine with landing this for only a subset of the testsuite.

library/alloc/src/collections/btree/node/tests.rs Outdated Show resolved Hide resolved
@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-testsuite Area: The testsuite used to check the correctness of rustc and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 2, 2022
@jyn514
Copy link
Member

jyn514 commented Sep 2, 2022

I don't see any changes to src/ci - are there already some builders that enable rust.debug? Which builders are those? Because this disables tests I want to be careful about where we enable it, we should have at least one builder on each platform with randomized layouts disabled.

alternatively we can try and get the two failing UI tests to work with randomized layouts, that would probably be my preference. but won't block on it.

@the8472
Copy link
Member Author

the8472 commented Sep 2, 2022

I don't see any changes to src/ci - are there already some builders that enable rust.debug?

Ah, good question. x86_64-gnu-debug seems to be the only one enabling rust.debug. Other CI jobs only toggle some of the more specific flags in a pattern that's not entirely clear to me.

That builder only runs run-make-fulldeps so that doesn't get us much test-coverage, but it does make a stage-2 build, so it builds a compiler with a randomized compiler which would hopefully give us some coverage... but not all that much.
Maybe enable it for the llvm-13 builder? That even runs on PRs.

This seems reasonable, but I'm worried it makes tests more flaky. What's the plan if we merge this and suddenly a quarter of all PRs start failing randomly?

If it ever becomes too big of a problem we could set -Zlayout-seed to use a fixed randomization seed. Until that happens it seems better to stochastically cover more bases.

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2022

Maybe enable it for the llvm-13 builder? That even runs on PRs.

That seems fine :) random-layout shouldn't add any additional compile time, and running it in PRs will get us more coverage.

It does mean this will only run on linux platforms, but that seems ~fine for now, better than no coverage.

@the8472
Copy link
Member Author

the8472 commented Sep 2, 2022

alternatively we can try and get the two failing UI tests to work with randomized layouts, that would probably be my preference. but won't block on it.

One prints hir statistics from the compiler and checks them via the test-output. Those statistics involve struct sizes. So layout randomization of the compiler breaks this test quite directly. It's not the structs in the test that get randomized, it's the compiler itself.

The other one involves diagnostics that print memory contents of a std type which can get swapped under randomization.

@rustbot rustbot added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Sep 2, 2022
@jyn514
Copy link
Member

jyn514 commented Sep 2, 2022

One prints hir statistics from the compiler and checks them via the test-output. Those statistics involve struct sizes. So layout randomization of the compiler breaks this test quite directly. It's not the structs in the test that get randomized, it's the compiler itself.

You can normalize the sizes with a regex: https://rustc-dev-guide.rust-lang.org/tests/ui.html#normalization. I don't think we're directly testing the sizes, just that we output a number.

The other one involves diagnostics that print memory contents of a std type which can get swapped under randomization.

Hmm, I agree that one's harder. Not sure how to fix it without digging into it myself.

src/bootstrap/configure.py Outdated Show resolved Hide resolved
library/std/Cargo.toml Outdated Show resolved Hide resolved
@the8472
Copy link
Member Author

the8472 commented Sep 2, 2022

One prints hir statistics from the compiler and checks them via the test-output. Those statistics involve struct sizes. So layout randomization of the compiler breaks this test quite directly. It's not the structs in the test that get randomized, it's the compiler itself.

You can normalize the sizes with a regex: https://rustc-dev-guide.rust-lang.org/tests/ui.html#normalization. I don't think we're directly testing the sizes, just that we output a number.

I guess they might catch struct size-regressions if they're not all of those structs are covered by asserts in the compiler. Ping @nnethercote to clarify.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment was marked as outdated.

@bors
Copy link
Contributor

bors commented Sep 10, 2022

⌛ Testing commit ea09cbd with merge 7613125631f18e024b670e1764b3eeeca257045e...

@bors
Copy link
Contributor

bors commented Sep 10, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 10, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 ---> 232a30d9f30c
Step 7/9 : ENV NO_DOWNLOAD_CI_LLVM 1
 ---> Using cache
 ---> dd9cad906204
Step 8/9 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-13       --enable-llvm-link-shared       --set rust.randomize-layout=true       --set rust.thin-lto-import-instr-limit=10
 ---> c09b4f148c35
Step 9/9 : ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy &&            ../x --stage 2 test src/test/mir-opt                              --host='' --target=i686-unknown-linux-gnu &&            ../x.ps1 --stage 2 test src/test/ui --pass=check                              --host='' --target=i686-unknown-linux-gnu &&            python2.7 ../x.py --stage 2 test src/tools/tidy
 ---> Using cache
 ---> bdd471ba91b1
---
configure: 
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-13/bin/ll ...
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: build.print-step-timings := True
configure: build.metrics        := True
configure: rust.codegen-units-std := 1
configure: rust.verify-llvm-ir  := True
---
   Compiling rustc_privacy v0.0.0 (/checkout/compiler/rustc_privacy)
[RUSTC-TIMING] rustc_middle test:false 124.567
   Compiling rustc_interface v0.0.0 (/checkout/compiler/rustc_interface)
[RUSTC-TIMING] rustc_privacy test:false 12.898
thread 'rustc' panicked at 'assertion failed: target_offset >= offset', compiler/rustc_codegen_llvm/src/type_of.rs:129:9
   0:     0x7f2a86ee0efd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::heec03eb9b2106f99
   0:     0x7f2a86ee0efd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::heec03eb9b2106f99
   1:     0x7f2a86f46f79 - core::fmt::write::hdc2190284bc6d0d4
   2:     0x7f2a86ed1e41 - std::io::Write::write_fmt::h42741f15affd0ecb
   3:     0x7f2a86ee3f0e - std::panicking::default_hook::{{closure}}::ha3e47422d6cfd2aa
   4:     0x7f2a86ee3bd7 - std::panicking::default_hook::h06e3da70e0c4e264
   5:     0x7f2a878d5a74 - rustc_driver[3636f0421e6d8c75]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:     0x7f2a86ee46b7 - std::panicking::rust_panic_with_hook::h332b5ce1ed540d19
   7:     0x7f2a86ee44aa - std::panicking::begin_panic_handler::{{closure}}::hf2b83e53a3e49fbf
   8:     0x7f2a86ee1464 - std::sys_common::backtrace::__rust_end_short_backtrace::hc87a83fccecce6d2
   9:     0x7f2a86ee41a2 - rust_begin_unwind
  10:     0x7f2a86e97c23 - core::panicking::panic_fmt::h55dfedac6f6597d4
  11:     0x7f2a86e97af3 - core::panicking::panic::h858d0a26258d295c
  12:     0x7f2a87b12d83 - rustc_codegen_llvm[7b6a0d1032d5a3f0]::type_of::struct_llfields
  13:     0x7f2a87afbb65 - <rustc_target[8d82747607a543bd]::abi::TyAndLayout<rustc_middle[10b8fe355026857d]::ty::Ty> as rustc_codegen_llvm[7b6a0d1032d5a3f0]::type_of::LayoutLlvmExt>::llvm_type
  14:     0x7f2a87b008ba - <rustc_codegen_ssa[ace718b546837800]::mir::place::PlaceRef<&rustc_codegen_llvm[7b6a0d1032d5a3f0]::llvm_::ffi::Value>>::project_downcast::<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>
  15:     0x7f2a87c31507 - <rustc_codegen_ssa[ace718b546837800]::mir::FunctionCx<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>>::codegen_place
  16:     0x7f2a87c22b7d - <rustc_codegen_ssa[ace718b546837800]::mir::FunctionCx<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>>::codegen_rvalue_operand
  17:     0x7f2a87c2974a - <rustc_codegen_ssa[ace718b546837800]::mir::FunctionCx<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>>::codegen_block
  18:     0x7f2a87c1e446 - rustc_codegen_ssa[ace718b546837800]::mir::codegen_mir::<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>
  19:     0x7f2a87b32937 - rustc_codegen_ssa[ace718b546837800]::base::codegen_instance::<rustc_codegen_llvm[7b6a0d1032d5a3f0]::builder::Builder>
  20:     0x7f2a87bac694 - rustc_codegen_llvm[7b6a0d1032d5a3f0]::base::compile_codegen_unit::module_codegen
  21:     0x7f2a87adf407 - <rustc_query_system[9c9e75e4d6a48ae]::dep_graph::graph::DepGraph<rustc_middle[10b8fe355026857d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[10b8fe355026857d]::ty::context::TyCtxt, rustc_span[730d915af92419e1]::symbol::Symbol, rustc_codegen_ssa[ace718b546837800]::ModuleCodegen<rustc_codegen_llvm[7b6a0d1032d5a3f0]::ModuleLlvm>>
  22:     0x7f2a87bac231 - rustc_codegen_llvm[7b6a0d1032d5a3f0]::base::compile_codegen_unit
  23:     0x7f2a87b31eaf - rustc_codegen_ssa[ace718b546837800]::base::codegen_crate::<rustc_codegen_llvm[7b6a0d1032d5a3f0]::LlvmCodegenBackend>
  24:     0x7f2a87bf3aca - <rustc_codegen_llvm[7b6a0d1032d5a3f0]::LlvmCodegenBackend as rustc_codegen_ssa[ace718b546837800]::traits::backend::CodegenBackend>::codegen_crate
  25:     0x7f2a87a65cab - <rustc_session[d30048c4c30c61e5]::session::Session>::time::<alloc[45623a189840f9f9]::boxed::Box<dyn core[c1e30f1bd259d119]::any::Any>, rustc_interface[e5898ec9738d6bfc]::passes::start_codegen::{closure#0}>
  26:     0x7f2a87a1bf2d - <rustc_interface[e5898ec9738d6bfc]::passes::QueryContext>::enter::<<rustc_interface[e5898ec9738d6bfc]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[c1e30f1bd259d119]::result::Result<alloc[45623a189840f9f9]::boxed::Box<dyn core[c1e30f1bd259d119]::any::Any>, rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>
  27:     0x7f2a87a090ba - <rustc_interface[e5898ec9738d6bfc]::queries::Queries>::ongoing_codegen
  28:     0x7f2a878d7657 - <rustc_interface[e5898ec9738d6bfc]::interface::Compiler>::enter::<rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}::{closure#2}, core[c1e30f1bd259d119]::result::Result<core[c1e30f1bd259d119]::option::Option<rustc_interface[e5898ec9738d6bfc]::queries::Linker>, rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>
  29:     0x7f2a878c4466 - rustc_span[730d915af92419e1]::with_source_map::<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_interface[e5898ec9738d6bfc]::interface::create_compiler_and_run<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>::{closure#1}>
  30:     0x7f2a878eb587 - rustc_interface[e5898ec9738d6bfc]::interface::create_compiler_and_run::<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>
  31:     0x7f2a878bb592 - <scoped_tls[5efd78fa53ce51fd]::ScopedKey<rustc_span[730d915af92419e1]::SessionGlobals>>::set::<rustc_interface[e5898ec9738d6bfc]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>
  32:     0x7f2a8793773f - std[8a3c335779a4ef7b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e5898ec9738d6bfc]::util::run_in_thread_pool_with_globals<rustc_interface[e5898ec9738d6bfc]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>
  33:     0x7f2a878c5b9e - std[8a3c335779a4ef7b]::panic::catch_unwind::<core[c1e30f1bd259d119]::panic::unwind_safe::AssertUnwindSafe<<std[8a3c335779a4ef7b]::thread::Builder>::spawn_unchecked_<rustc_interface[e5898ec9738d6bfc]::util::run_in_thread_pool_with_globals<rustc_interface[e5898ec9738d6bfc]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>
  34:     0x7f2a87938f20 - <<std[8a3c335779a4ef7b]::thread::Builder>::spawn_unchecked_<rustc_interface[e5898ec9738d6bfc]::util::run_in_thread_pool_with_globals<rustc_interface[e5898ec9738d6bfc]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>, rustc_driver[3636f0421e6d8c75]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[15b461d5cc289186]::ErrorGuaranteed>>::{closure#1} as core[c1e30f1bd259d119]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7f2a86ef06f5 - std::sys::unix::thread::Thread::new::thread_start::h4ca20864c1f05a1d
  36:     0x7f2a86c90b43 - <unknown>
  37:     0x7f2a86d22a00 - <unknown>
  38:                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.65.0-nightly (761312563 2022-09-10) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C debug-assertions=on -Z unstable-options -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C split-debuginfo=off -Z unstable-options -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked
note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

@the8472
Copy link
Member Author

the8472 commented Sep 10, 2022

'assertion failed: target_offset >= offset', compiler/rustc_codegen_llvm/src/type_of.rs:129:9

I guess that assert didn't account for the possibility of field reordering? But I'm not sure if this isn't a genuine issue.

CC @Kixiron

@bjorn3
Copy link
Member

bjorn3 commented Sep 10, 2022

The respective loop uses index_by_increasing_offset() to get the fields in order of increasing offset. As such this assertion should be impossible to hit no matter what order fields are stored in.

@the8472
Copy link
Member Author

the8472 commented Sep 10, 2022

Filed #101646 with some additional tracing output.

@jyn514 jyn514 added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2022
@bors
Copy link
Contributor

bors commented Sep 21, 2022

⌛ Testing commit ea09cbd with merge 34e35a95c7b4e5d60f09f05cfa3853773d89ad18...

@bors
Copy link
Contributor

bors commented Sep 21, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Sep 21, 2022
@jyn514 jyn514 added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 21, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 ---> 232a30d9f30c
Step 7/9 : ENV NO_DOWNLOAD_CI_LLVM 1
 ---> Using cache
 ---> dd9cad906204
Step 8/9 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-13       --enable-llvm-link-shared       --set rust.randomize-layout=true       --set rust.thin-lto-import-instr-limit=10
 ---> c09b4f148c35
Step 9/9 : ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy &&            ../x --stage 2 test src/test/mir-opt                              --host='' --target=i686-unknown-linux-gnu &&            ../x.ps1 --stage 2 test src/test/ui --pass=check                              --host='' --target=i686-unknown-linux-gnu &&            python2.7 ../x.py --stage 2 test src/tools/tidy
 ---> Using cache
 ---> bdd471ba91b1
---
configure: 
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-13/bin/ll ...
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: build.print-step-timings := True
configure: build.metrics        := True
configure: rust.codegen-units-std := 1
configure: rust.verify-llvm-ir  := True
---
[RUSTC-TIMING] rustc_lint test:false 45.566
   Compiling rustc_interface v0.0.0 (/checkout/compiler/rustc_interface)
[RUSTC-TIMING] rustc_privacy test:false 13.718
[RUSTC-TIMING] rustc_middle test:false 128.352
thread 'rustc' panicked at 'assertion failed: target_offset >= offset', compiler/rustc_codegen_llvm/src/type_of.rs:129:9
   0:     0x7f20e7d016b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h189266b990bc4cfa
   1:     0x7f20e7d6c1b9 - core::fmt::write::hdc2190284bc6d0d4
   1:     0x7f20e7d6c1b9 - core::fmt::write::hdc2190284bc6d0d4
   2:     0x7f20e7cf1b41 - std::io::Write::write_fmt::hcd3f9e3061f38481
   3:     0x7f20e7d04a8e - std::panicking::default_hook::{{closure}}::hc35d6a83060811fc
   4:     0x7f20e7d04751 - std::panicking::default_hook::h4025000d4f88908e
   5:     0x7f20e86fda64 - rustc_driver[5a9a929c23ac41f2]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:     0x7f20e7d0525f - std::panicking::rust_panic_with_hook::hef0d594d8cdfe6a9
   7:     0x7f20e7d0504a - std::panicking::begin_panic_handler::{{closure}}::h2eca50bd66c97083
   8:     0x7f20e7d01c74 - std::sys_common::backtrace::__rust_end_short_backtrace::hbbeb6c379416c254
   9:     0x7f20e7d04d22 - rust_begin_unwind
  10:     0x7f20e7cb5073 - core::panicking::panic_fmt::h55dfedac6f6597d4
  11:     0x7f20e7cb4f43 - core::panicking::panic::h858d0a26258d295c
  12:     0x7f20e89d4fbf - rustc_codegen_llvm[a25c3b705918d870]::type_of::struct_llfields
  13:     0x7f20e899ceff - <rustc_target[911f7b142972ffe9]::abi::TyAndLayout<rustc_middle[30138fff79654cb0]::ty::Ty> as rustc_codegen_llvm[a25c3b705918d870]::type_of::LayoutLlvmExt>::llvm_type
  14:     0x7f20e89a1d6b - <rustc_codegen_ssa[9115261bc2c1df99]::mir::place::PlaceRef<&rustc_codegen_llvm[a25c3b705918d870]::llvm_::ffi::Value>>::project_downcast::<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>
  15:     0x7f20e8aa2b9c - <rustc_codegen_ssa[9115261bc2c1df99]::mir::FunctionCx<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>>::codegen_place
  16:     0x7f20e8a977be - <rustc_codegen_ssa[9115261bc2c1df99]::mir::FunctionCx<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>>::codegen_rvalue_operand
  17:     0x7f20e8a913ea - rustc_codegen_ssa[9115261bc2c1df99]::mir::codegen_mir::<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>
  18:     0x7f20e89142e7 - rustc_codegen_ssa[9115261bc2c1df99]::base::codegen_instance::<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>
  19:     0x7f20e8a263d9 - <rustc_middle[30138fff79654cb0]::mir::mono::MonoItem as rustc_codegen_ssa[9115261bc2c1df99]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[a25c3b705918d870]::builder::Builder>
  20:     0x7f20e8a6608f - rustc_codegen_llvm[a25c3b705918d870]::base::compile_codegen_unit::module_codegen
  21:     0x7f20e897b89d - <rustc_query_system[5d45b85c8959cba6]::dep_graph::graph::DepGraph<rustc_middle[30138fff79654cb0]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[30138fff79654cb0]::ty::context::TyCtxt, rustc_span[4fe8128055cb8f86]::symbol::Symbol, rustc_codegen_ssa[9115261bc2c1df99]::ModuleCodegen<rustc_codegen_llvm[a25c3b705918d870]::ModuleLlvm>>
  22:     0x7f20e8a65cc1 - rustc_codegen_llvm[a25c3b705918d870]::base::compile_codegen_unit
  23:     0x7f20e891342e - rustc_codegen_ssa[9115261bc2c1df99]::base::codegen_crate::<rustc_codegen_llvm[a25c3b705918d870]::LlvmCodegenBackend>
  24:     0x7f20e894447a - <rustc_codegen_llvm[a25c3b705918d870]::LlvmCodegenBackend as rustc_codegen_ssa[9115261bc2c1df99]::traits::backend::CodegenBackend>::codegen_crate
  25:     0x7f20e886b3b6 - <rustc_interface[a43ed275f0382cfd]::passes::QueryContext>::enter::<<rustc_interface[a43ed275f0382cfd]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[c1e30f1bd259d119]::result::Result<alloc[45623a189840f9f9]::boxed::Box<dyn core[c1e30f1bd259d119]::any::Any>, rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>
  26:     0x7f20e88422ce - <rustc_interface[a43ed275f0382cfd]::queries::Queries>::ongoing_codegen
  27:     0x7f20e86ff9a0 - <rustc_interface[a43ed275f0382cfd]::interface::Compiler>::enter::<rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}::{closure#2}, core[c1e30f1bd259d119]::result::Result<core[c1e30f1bd259d119]::option::Option<rustc_interface[a43ed275f0382cfd]::queries::Linker>, rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>
  28:     0x7f20e86e8a08 - rustc_span[4fe8128055cb8f86]::with_source_map::<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_interface[a43ed275f0382cfd]::interface::create_compiler_and_run<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>::{closure#1}>
  29:     0x7f20e8700dcd - rustc_interface[a43ed275f0382cfd]::interface::create_compiler_and_run::<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>
  30:     0x7f20e87832c2 - <scoped_tls[5efd78fa53ce51fd]::ScopedKey<rustc_span[4fe8128055cb8f86]::SessionGlobals>>::set::<rustc_interface[a43ed275f0382cfd]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>
  31:     0x7f20e876d3ff - std[b19370fede7caea]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a43ed275f0382cfd]::util::run_in_thread_pool_with_globals<rustc_interface[a43ed275f0382cfd]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>
  32:     0x7f20e86ea2fe - std[b19370fede7caea]::panicking::try::<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, core[c1e30f1bd259d119]::panic::unwind_safe::AssertUnwindSafe<<std[b19370fede7caea]::thread::Builder>::spawn_unchecked_<rustc_interface[a43ed275f0382cfd]::util::run_in_thread_pool_with_globals<rustc_interface[a43ed275f0382cfd]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
  33:     0x7f20e876f510 - <<std[b19370fede7caea]::thread::Builder>::spawn_unchecked_<rustc_interface[a43ed275f0382cfd]::util::run_in_thread_pool_with_globals<rustc_interface[a43ed275f0382cfd]::interface::run_compiler<core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>, rustc_driver[5a9a929c23ac41f2]::run_compiler::{closure#1}>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>::{closure#0}, core[c1e30f1bd259d119]::result::Result<(), rustc_errors[f550ba839837ab93]::ErrorGuaranteed>>::{closure#1} as core[c1e30f1bd259d119]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f20e7d113c5 - std::sys::unix::thread::Thread::new::thread_start::h8972e60baefc7a3d
  35:     0x7f20e7aacb43 - <unknown>
  36:     0x7f20e7b3ea00 - <unknown>
  37:                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.66.0-nightly (34e35a95c 2022-09-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C debug-assertions=on -Z unstable-options -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C split-debuginfo=off -Z unstable-options -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked
note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

@fee1-dead
Copy link
Member

Somehow this is still in the queue?

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Sep 25, 2022
@jyn514 jyn514 added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 25, 2022
@bors
Copy link
Contributor

bors commented Sep 26, 2022

☔ The latest upstream changes (presumably #102051) made this pull request unmergeable. Please resolve the merge conflicts.

@workingjubilee workingjubilee added the -Zrandomize-layout Unstable option: Randomize the layout of types. label Mar 5, 2023
@jyn514 jyn514 assigned Mark-Simulacrum and unassigned jyn514 Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Zrandomize-layout Unstable option: Randomize the layout of types. A-testsuite Area: The testsuite used to check the correctness of rustc S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet