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

What is causing this crash? #1510

Closed
frederikhors opened this issue Jul 13, 2024 · 6 comments
Closed

What is causing this crash? #1510

frederikhors opened this issue Jul 13, 2024 · 6 comments
Labels
O-windows Operating system: Windows

Comments

@frederikhors
Copy link

cargo-clif.exe run -p app is crashing with:

thread 'rustc' panicked at src\archive.rs:23:9:
not implemented: creating dll imports is not yet supported
stack backtrace:
   Compiling ryu v1.0.18
   0:     0x7ff8c00a4e3d - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ff8c00a4e3d - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff8c00a4e3d - std::sys::backtrace::_print_fmt
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\sys\backtrace.rs:68
   3:     0x7ff8c00a4e3d - std::sys::backtrace::_print::impl$0::fmt
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\sys\backtrace.rs:44
   4:     0x7ff8c00d54a9 - core::fmt::rt::Argument::fmt
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\core\src\fmt\rt.rs:173
   5:     0x7ff8c00d54a9 - core::fmt::write
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\core\src\fmt\mod.rs:1182
   6:     0x7ff8c009b341 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\io\mod.rs:1835
   7:     0x7ff8c00a4c16 - std::sys::backtrace::print
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\sys\backtrace.rs:34
   8:     0x7ff8c00a7e18 - std::panicking::default_hook::closure$1
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\panicking.rs:265
   9:     0x7ff8c00a7ac9 - std::panicking::default_hook
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\panicking.rs:292
  10:     0x7ff8a2b7b115 - memchr
  11:     0x7ff8c00a859b - alloc::boxed::impl$50::call
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\alloc\src\boxed.rs:2078
  12:     0x7ff8c00a859b - std::panicking::rust_panic_with_hook
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\panicking.rs:804
  13:     0x7ff8c00a836f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\panicking.rs:663
  14:     0x7ff8c00a57af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\sys\backtrace.rs:171
  15:     0x7ff8c00a7f86 - std::panicking::begin_panic_handler
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\panicking.rs:661
  16:     0x7ff8c00fde54 - core::panicking::panic_fmt
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\core\src\panicking.rs:74
  17:     0x7ff8bf82830c - <rustc_codegen_cranelift::archive::ArArchiveBuilderBuilder as rustc_codegen_ssa::back::archive::ArchiveBuilderBuilder>::create_dll_import_lib::h138e4a4d05900f0a
  18:     0x7ff8a138f428 - rustc_codegen_ssa[f52e3fb87beb71e3]::back::link::each_linked_rlib
  19:     0x7ff8a138a9f6 - rustc_codegen_ssa[f52e3fb87beb71e3]::back::link::link_binary
  20:     0x7ff8bf85a4c6 - <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::link::hd19571cdbe1c7838
  21:     0x7ff89e895ad8 - <rustc_interface[b7ec6dbec7ff60f5]::queries::Linker>::link
  22:     0x7ff89e846bff - _wpgmptr
  23:     0x7ff89e841f4f - _wpgmptr
  24:     0x7ff89e84bd0b - _wpgmptr
  25:     0x7ff8c00b963d - alloc::boxed::impl$48::call_once
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\alloc\src\boxed.rs:2064
  26:     0x7ff8c00b963d - alloc::boxed::impl$48::call_once
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\alloc\src\boxed.rs:2064
  27:     0x7ff8c00b963d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/35b658fb1071d752d092751d9f17a9fa7b154ec4/library\std\src\sys\pal\windows\thread.rs:52
  28:     0x7ff902f67344 - BaseThreadInitThunk
  29:     0x7ff90387cc91 - RtlUserThreadStart

error: 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: please make sure that you have updated to the latest nightly

note: please attach the file at `C:\Users\Fred\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cc-1.1.2\rustc-ice-2024-07-13T13_09_51-10436.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on -C strip=debuginfo -C panic=abort -Z panic-abort-tests -Z codegen-backend=C:\clif\bin\rustc_codegen_cranelift.dll

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

query stack during panic:
end of query stack
error: could not compile `cc` (lib)
warning: build failed, waiting for other jobs to finish...

src\archive.rs is not my file.

How to know what crate is causing this?

I'm on the latest rust, clif and windows dependencies as of today.

@bjorn3
Copy link
Member

bjorn3 commented Jul 13, 2024

Looks like the cc crate has started using raw-dylib on Windows: rust-lang/cc-rs#1137 cg_clif doesn't know how to build import libraries yet, and as such raw-dylib doesn't work.

@bjorn3 bjorn3 added the O-windows Operating system: Windows label Jul 13, 2024
@frederikhors
Copy link
Author

Oh crap. And now?

@bjorn3
Copy link
Member

bjorn3 commented Jul 13, 2024

rust-lang/ar_archive_writer#15 is a port of LLVM's import library writer to rust allowing it to be used by cg_clif. It was opened a while ago, but I didn't get around to reviewing it until a week ago. It is currently waiting on the author of the PR.

bjorn3 added a commit that referenced this issue Jul 13, 2024
bjorn3 added a commit that referenced this issue Jul 13, 2024
@bjorn3
Copy link
Member

bjorn3 commented Jul 13, 2024

I've pushed a commit to get a regular fatal error rather than a panic when using raw-dylib.

@frederikhors
Copy link
Author

Ok. In the meantime they maybe are reverting that change... rust-lang/cc-rs#1156 (comment)

@bjorn3
Copy link
Member

bjorn3 commented Aug 8, 2024

raw-dylib has been implemented in #1524.

@bjorn3 bjorn3 closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

2 participants