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

ICE: 'copy LTO artifacts' panicked at 'no saved object file in work product' #109879

Open
JangSchopenhauer opened this issue Apr 3, 2023 · 6 comments
Labels
A-codegen Area: Code generation A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@JangSchopenhauer
Copy link

As you can see in my code. I'm rookie at programming. I don't know how to write a report, so I wrote every information that I know. I hope this information is useful to you.

Code

fn main() {

let value_size = (true,false);
let number = 110;
// I test many numbers at "number" variable.
// At 99, 101 value, it worked well. but when I use "100" it start to broke up, and it keep doesn't work,

if number>100 {
    print_msg(value_size.0);
    } else {
        print_msg(value_size.1);
    }
}    

// * Use a function to print the messages
fn print_msg (result : bool) {
    // * Use a match expression to determine which message
    //   to print
    match result {
        true => println!("its big"),
        false => println!("its small"),
    }
    
}

Meta

<version>
rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-pc-windows-msvc
release: 1.68.2
LLVM version: 15.0.6

Error output

<output>

thread 'copy LTO artifacts for ocgxck580qsbn29' panicked at 'no saved object file in work product', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\compiler\rustc_codegen_ssa\src\back\write.rs:890:45
stack backtrace:
   0:     0x7ffe0e6b9d02 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb6eec21cb8e3d1b
   1:     0x7ffe0e6f570b - core::fmt::write::h3f34d6e08b5a11e8
   2:     0x7ffe0e6acdfa - <std::io::IoSlice as core::fmt::Debug>::fmt::h1d8b4e60e4c9e548
   3:     0x7ffe0e6b9a4b - std::sys::common::alloc::realloc_fallback::h258dcd65da5985d2
   4:     0x7ffe0e6bd3f9 - std::panicking::default_hook::h90b70b966050cb60
   5:     0x7ffe0e6bd07b - std::panicking::default_hook::h90b70b966050cb60
   6:     0x7ffdbcc29425 - rustc_driver[fbeb20e0897b27eb]::describe_lints
   7:     0x7ffe0e6bdd5f - std::panicking::rust_panic_with_hook::h1d50ae3462f62f01
   8:     0x7ffe0e6bdabe - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::h79e1803705c718ce
   9:     0x7ffe0e6ba9ff - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb6eec21cb8e3d1b
  10:     0x7ffe0e6bd770 - rust_begin_unwind
  11:     0x7ffe0e72b3d5 - core::panicking::panic_fmt::haf2d819891c687b2
  12:     0x7ffe0e6f24a0 - <core::panic::panic_info::PanicInfo as core::fmt::Display>::fmt::ha6751ac49168652e
  13:     0x7ffe0e6f244b - <core::panic::panic_info::PanicInfo as core::fmt::Display>::fmt::ha6751ac49168652e
  14:     0x7ffe0e72b399 - core::option::expect_failed::h0da32229c4d02ab1
  15:     0x7ffdba4773aa - <rustc_codegen_llvm[a370bbf5c5532cf9]::context::CodegenCx as rustc_codegen_ssa[b0364e910a0a34e7]::traits::type_::LayoutTypeMethods>::fn_ptr_backend_type
  16:     0x7ffdba418a59 - rustc_interface[5b253cef4d5aad89]::passes::start_codegen
  17:     0x7ffdba448377 - <rustc_codegen_llvm[a370bbf5c5532cf9]::builder::Builder as rustc_codegen_ssa[b0364e910a0a34e7]::traits::builder::BuilderMethods>::unchecked_smul
  18:     0x7ffe0e6d021c - std::sys::windows::thread::Thread::new::hf7aab9c244c58572
  19:     0x7ffe4b3b7614 - BaseThreadInitThunk
  20:     0x7ffe4b9c26a1 - RtlUserThreadStart

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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread '<unnamed>' panicked at '/rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\compiler\rustc_codegen_ssa\src\back\write.rs:1530:21: worker thread panicked', compiler\rustc_middle\src\util\bug.rs:36:26
stack backtrace:
   0:     0x7ffe0e6b9d02 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb6eec21cb8e3d1b
   1:     0x7ffe0e6f570b - core::fmt::write::h3f34d6e08b5a11e8
   2:     0x7ffe0e6acdfa - <std::io::IoSlice as core::fmt::Debug>::fmt::h1d8b4e60e4c9e548
   3:     0x7ffe0e6b9a4b - std::sys::common::alloc::realloc_fallback::h258dcd65da5985d2
   4:     0x7ffe0e6bd3f9 - std::panicking::default_hook::h90b70b966050cb60
   5:     0x7ffe0e6bd07b - std::panicking::default_hook::h90b70b966050cb60
   6:     0x7ffdbcc29425 - rustc_driver[fbeb20e0897b27eb]::describe_lints
   7:     0x7ffe0e6bdd5f - std::panicking::rust_panic_with_hook::h1d50ae3462f62f01
   8:     0x7ffdbefd9c5f - <rustc_middle[1d4803ea9c08b419]::ty::rvalue_scopes::RvalueScopes as core[15ae0b8045847941]::fmt::Debug>::fmt
   9:     0x7ffdbefd999c - <rustc_middle[1d4803ea9c08b419]::ty::rvalue_scopes::RvalueScopes as core[15ae0b8045847941]::fmt::Debug>::fmt
  10:     0x7ffdbef72753 - <rustc_middle[1d4803ea9c08b419]::ty::DestructuredConst as core[15ae0b8045847941]::fmt::Debug>::fmt
  11:     0x7ffdbefc54ad - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  12:     0x7ffdbefc526d - <rustc_middle[1d4803ea9c08b419]::ty::subst::GenericArg as rustc_middle[1d4803ea9c08b419]::ty::context::Lift>::lift_to_tcx
  13:     0x7ffdbefc5222 - <rustc_middle[1d4803ea9c08b419]::ty::subst::GenericArg as rustc_middle[1d4803ea9c08b419]::ty::context::Lift>::lift_to_tcx
  14:     0x7ffdbefc5408 - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  15:     0x7ffdbefc5385 - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  16:     0x7ffdba416ccc - rustc_interface[5b253cef4d5aad89]::passes::start_codegen
  17:     0x7ffdba447e3e - <rustc_codegen_llvm[a370bbf5c5532cf9]::builder::Builder as rustc_codegen_ssa[b0364e910a0a34e7]::traits::builder::BuilderMethods>::unchecked_smul
  18:     0x7ffe0e6d021c - std::sys::windows::thread::Thread::new::hf7aab9c244c58572
  19:     0x7ffe4b3b7614 - BaseThreadInitThunk
  20:     0x7ffe4b9c26a1 - RtlUserThreadStart

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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread 'rustc' panicked at '/rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\compiler\rustc_codegen_ssa\src\back\write.rs:1888:17: panic during codegen/LLVM phase', compiler\rustc_middle\src\util\bug.rs:36:26
stack backtrace:
   0:     0x7ffe0e6b9d02 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb6eec21cb8e3d1b
   1:     0x7ffe0e6f570b - core::fmt::write::h3f34d6e08b5a11e8
   2:     0x7ffe0e6acdfa - <std::io::IoSlice as core::fmt::Debug>::fmt::h1d8b4e60e4c9e548
   3:     0x7ffe0e6b9a4b - std::sys::common::alloc::realloc_fallback::h258dcd65da5985d2
   4:     0x7ffe0e6bd3f9 - std::panicking::default_hook::h90b70b966050cb60
   5:     0x7ffe0e6bd07b - std::panicking::default_hook::h90b70b966050cb60
   6:     0x7ffdbcc29425 - rustc_driver[fbeb20e0897b27eb]::describe_lints
   7:     0x7ffe0e6bdd5f - std::panicking::rust_panic_with_hook::h1d50ae3462f62f01
   8:     0x7ffdbefd9c5f - <rustc_middle[1d4803ea9c08b419]::ty::rvalue_scopes::RvalueScopes as core[15ae0b8045847941]::fmt::Debug>::fmt
   9:     0x7ffdbefd999c - <rustc_middle[1d4803ea9c08b419]::ty::rvalue_scopes::RvalueScopes as core[15ae0b8045847941]::fmt::Debug>::fmt
  10:     0x7ffdbef72753 - <rustc_middle[1d4803ea9c08b419]::ty::DestructuredConst as core[15ae0b8045847941]::fmt::Debug>::fmt
  11:     0x7ffdbefc54ad - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  12:     0x7ffdbefc526d - <rustc_middle[1d4803ea9c08b419]::ty::subst::GenericArg as rustc_middle[1d4803ea9c08b419]::ty::context::Lift>::lift_to_tcx
  13:     0x7ffdbefc5222 - <rustc_middle[1d4803ea9c08b419]::ty::subst::GenericArg as rustc_middle[1d4803ea9c08b419]::ty::context::Lift>::lift_to_tcx
  14:     0x7ffdbefc5408 - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  15:     0x7ffdbefc5385 - rustc_middle[1d4803ea9c08b419]::util::bug::bug_fmt
  16:     0x7ffdba43ec8e - rustc_codegen_llvm[a370bbf5c5532cf9]::llvm_::set_value_name
  17:     0x7ffdba484a58 - <rustc_codegen_llvm[a370bbf5c5532cf9]::context::CodegenCx as rustc_codegen_ssa[b0364e910a0a34e7]::traits::type_::LayoutTypeMethods>::fn_ptr_backend_type
  18:     0x7ffdba420309 - <rustc_codegen_llvm[a370bbf5c5532cf9]::LlvmCodegenBackend as rustc_codegen_ssa[b0364e910a0a34e7]::traits::backend::CodegenBackend>::join_codegen
  19:     0x7ffdba3de2f1 - <rustc_interface[5b253cef4d5aad89]::queries::Linker>::link
  20:     0x7ffdba392b9e - <unknown>
  21:     0x7ffdba39cacb - <rustc_middle[1d4803ea9c08b419]::ty::SymbolName as core[15ae0b8045847941]::fmt::Debug>::fmt
  22:     0x7ffdba39c319 - <rustc_middle[1d4803ea9c08b419]::ty::SymbolName as core[15ae0b8045847941]::fmt::Debug>::fmt
  23:     0x7ffdba39404d - <rustc_middle[1d4803ea9c08b419]::ty::SymbolName as core[15ae0b8045847941]::fmt::Debug>::fmt
  24:     0x7ffe0e6d021c - std::sys::windows::thread::Thread::new::hf7aab9c244c58572
  25:     0x7ffe4b3b7614 - BaseThreadInitThunk
  26:     0x7ffe4b9c26a1 - RtlUserThreadStart

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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

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

Backtrace

<backtrace>

@JangSchopenhauer JangSchopenhauer 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 Apr 3, 2023
@saethlin
Copy link
Member

saethlin commented Apr 3, 2023

Just to clear a few things up

As you can see in my code. I'm rookie at programming.

This is the kind of code we usually see in reports like this. The only thing that looks rookie here is that you don't use rustfmt. rustup component add rustfmt then run cargo fmt. If you want. (Your editor may also have a plugin)

I don't know how to write a report, so I wrote every information that I know.

Perfect. That's how you write a good report. You're doing great, really.

@JangSchopenhauer
Copy link
Author

Thanks a lot for your comment. Really I am.
and from now I'll try to learn about & use rustfmt.

@Noratrieb
Copy link
Member

One thing missing is the command you ran. I assume it's cargo build --release, is that correct?

@JangSchopenhauer
Copy link
Author

does it necessary? until now, I didn't use cargo build --release.

@jyn514 jyn514 changed the title The compiler unexpectedly panicked. this is a bug ICE: 'copy LTO artifacts' panicked at 'no saved object file in work product' Apr 3, 2023
@jyn514
Copy link
Member

jyn514 commented Apr 3, 2023

@Nilstrieb you can see it's the dev profile with ~default settings from the flags:

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

@jyn514 jyn514 added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Apr 3, 2023
@jyn514
Copy link
Member

jyn514 commented Apr 3, 2023

Relevant code:

&module.source.saved_files.get("o").expect("no saved object file in work product"),

@jyn514 jyn514 added A-codegen Area: Code generation A-incr-comp Area: Incremental compilation and removed A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Apr 3, 2023
@Noratrieb Noratrieb added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Jul 29, 2023
@saethlin saethlin added the O-windows Operating system: Windows label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows Operating system: Windows 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