rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.17k stars 888 forks source link

in the windows install rust error #3457

Closed aixi2494 closed 1 year ago

aixi2494 commented 1 year ago

Problem

D:\download>rustup-init.exe
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `2`,
 right: `0`', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\curl-0.4.44\src\lib.rs:103:13
stack backtrace:
   0:     0x7ff645b292e3 - <unknown>
   1:     0x7ff645758ddb - <unknown>
   2:     0x7ff645b04ae1 - <unknown>
   3:     0x7ff645b2df2b - <unknown>
   4:     0x7ff645b2daf7 - <unknown>
   5:     0x7ff645b2d6f5 - <unknown>
   6:     0x7ff645b2e76e - <unknown>
   7:     0x7ff645b2e4f6 - <unknown>
   8:     0x7ff645b2e43f - <unknown>
   9:     0x7ff645b2e414 - <unknown>
  10:     0x7ff645c56615 - <unknown>
  11:     0x7ff645c5686b - <unknown>
  12:     0x7ff645c572e5 - <unknown>
  13:     0x7ff645765a98 - <unknown>
  14:     0x7ff645c681f7 - <unknown>
  15:     0x7ff645765a2b - <unknown>
  16:     0x7ff645c3f83d - <unknown>
  17:     0x7ff645c28401 - <unknown>
  18:     0x7ffd717a7614 - BaseThreadInitThunk
  19:     0x7ffd734c26b1 - RtlUserThreadStart

Steps

  1. download https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
  2. run rustup-init.exe

Possible Solution(s)

No response

Notes

D:\download>curl -V
curl 8.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets

Rustup version

rust install error

Installed toolchains

rust install error
djc commented 1 year ago

Just checking, are you indeed running 64-bit Windows?

So the assertion being tripped here:

assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);

https://github.com/alexcrichton/curl-rust/blob/main/src/lib.rs#L103

Which seems to be suggesting that multiple curl contexts have been initialized in the same process? From some cursory searches it does seem that rustup might be instantiating one curl::easy::Easy per thread (via a thread_local!()) but I don't know enough about the curl crate to say if that might trigger this issue.

aixi2494 commented 1 year ago

Now that the problem is solved, I guess my Visual Studio is incomplete, it will be ready after reinstallation

Visual Studio 不完整了, 需要卸载,重新安装