Skip to content

thread 'copy LTO artifacts for 14fjghlwjticu4oo' panicked at 'no saved object file in work product', compiler\rustc_codegen_ssa\src\back\write.rs:890:10 #113869

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
var-che opened this issue Jul 19, 2023 · 3 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

@var-che
Copy link

var-che commented Jul 19, 2023

Code

use std::collections::HashMap;

fn handle(request: &str) -> String {
    let parsed = parse(request);
    let routed = route(parsed);
    format_response(routed)

}

fn parse(request: &str) -> HashMap<String, String> {
    let first_line = request.lines().next().unwrap_or("");
    let words: Vec<&str> = first_line.split_whitespace().collect();

    let mut conv = HashMap::new();

    if let [method, path, _protocol @ ..] = &words[..] {
        conv.insert("method".to_string(), words[0].to_string());
        conv.insert("path".to_string(), words[1].to_string());
    }
   
    conv.insert("resp_body".to_string(), "".to_string());
    conv

    
}

fn route(mut conv: HashMap<String, String>) -> HashMap<String, String> {
    //TODO - edit/create hashmap that has the response body
    //in a immutable way
    // Create a new HashMap with the existing data from conv
    conv.insert("resp_body".to_string(), "This is about us".to_string());
    conv
}

fn format_response(conv: HashMap<String, String>) -> String {
    format!(
        "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nContent-Length: {}\r\n\r\n{}",
        conv.get("resp_body").unwrap_or(&"".to_string()).len(),
        conv.get("resp_body").unwrap_or(&"".to_string())
    )
}


fn main() {
    
}

Meta

rustc --version --verbose:

<version>

Error output

thread 'copy LTO artifacts for 14fjghlwjticu4oo' panicked at 'no saved object file in work product', /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483\compiler\rustc_codegen_ssa\src\back\write.rs:890:10
stack backtrace:
   0:     0x7ffdd7619de2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha63cfe4b75b3ba72
   1:     0x7ffdd7655d0b - core::fmt::write::h5f1cd682e23942b6
   2:     0x7ffdd760ca2a - <std::io::IoSliceMut as core::fmt::Debug>::fmt::h6b970ebe775b9627
   3:     0x7ffdd7619b2b - std::sys::common::alloc::realloc_fallback::h413616b22f3f3818
   4:     0x7ffdd761d459 - std::panicking::default_hook::h0c26739d8a69e80d
   5:     0x7ffdd761d0db - std::panicking::default_hook::h0c26739d8a69e80d
   6:     0x7ffd8fb9d16d - rustc_driver[6d4b93d6bcfc3289]::describe_lints
   7:     0x7ffdd761ddc0 - std::panicking::rust_panic_with_hook::hdf07e8fcc7859773
   8:     0x7ffdd761db1e - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::hac35d15c76f5304d
   9:     0x7ffdd761aadf - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha63cfe4b75b3ba72
  10:     0x7ffdd761d7d0 - rust_begin_unwind
  11:     0x7ffdd768bb85 - core::panicking::panic_fmt::hd2b8fa31b060140f
  12:     0x7ffdd7652ac0 - <core::panic::panic_info::PanicInfo as core::fmt::Display>::fmt::h5377e9fccca41389
  13:     0x7ffdd7652a6b - <core::panic::panic_info::PanicInfo as core::fmt::Display>::fmt::h5377e9fccca41389
  14:     0x7ffdd768bb49 - core::option::expect_failed::hed6ba619d7fd0fcb
  15:     0x7ffd8d3dd742 - <rustc_codegen_llvm[8858754bf01e5222]::llvm_::ffi::Type>::i8p_llcx
  16:     0x7ffd8d3d1009 - <rustc_codegen_llvm[8858754bf01e5222]::LlvmCodegenBackend as rustc_codegen_ssa[81e5edbff33a6ce5]::traits::backend::CodegenBackend>::link     
  17:     0x7ffd8d4173d7 - <rustc_codegen_llvm[8858754bf01e5222]::builder::Builder as rustc_codegen_ssa[81e5edbff33a6ce5]::traits::builder::BuilderMethods>::unchecked_smul
  18:     0x7ffdd762fe9c - std::sys::windows::thread::Thread::new::h92ec69467f05d131
  19:     0x7ffe0e197614 - BaseThreadInitThunk
  20:     0x7ffe0f6e26b1 - RtlUserThreadStart

error: internal compiler error: unexpected panic
Backtrace

<backtrace>

@var-che var-che 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 19, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 19, 2023
@clubby789 clubby789 changed the title Prompt told me to report this, so I did thread 'copy LTO artifacts for 14fjghlwjticu4oo' panicked at 'no saved object file in work product', compiler\rustc_codegen_ssa\src\back\write.rs:890:10 Jul 20, 2023
@clubby789
Copy link
Contributor

I'm not able to reproduce this. Does this happen consistently, and what is the version of rustc (rustc --version --verbose)?

@var-che
Copy link
Author

var-che commented Jul 20, 2023

I was not able to reproduce this as well. I just created new project, pasted that code and it worked.
rustc info
rustc 1.67.1 (d5a82bbd2 2023-02-07) binary: rustc commit-hash: d5a82bbd26e1ad8b7401f6a718a9c57c96905483 commit-date: 2023-02-07 host: x86_64-pc-windows-msvc release: 1.67.1 LLVM version: 15.0.6

@clubby789
Copy link
Contributor

clubby789 commented Jul 20, 2023

As there isn't an MCVE here, I'm going to close this as a duplicate of #109879. You may want to try updating your Rust version to the current stable

@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 29, 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