Skip to content

[Windows] Compiling with rust-lld causes STATUS_ACCESS_VIOLATION #12041

Description

@MolotovCherry

Summary

Using rust-lld as the linker breaks Zed. On startup, Zed immediately crashes with a status access violation. Using the default msvc linker appears to work without issue. Unsure whether this is a rust or Zed issue

I originally came across this because I had my config globally set to rust-lld, which unexpectedly caused this.

Edit: Tested with 5ddd343

config.toml

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"

Environment

Visual studio 17.9.7 with Windows 11 SDK (10.0.22621.0) and MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)

cargo 1.78.0 (54d8815d0 2024-03-26)
release: 1.78.0
commit-hash: 54d8815d04fa3816edc207bbc4dd36bf18014dbc
commit-date: 2024-03-26
host: x86_64-pc-windows-msvc
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:Schannel)
os: Windows 10.0.22631 (Windows 11 Professional) [64-bit]

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

Activity

  1. added
    bugDEPRECATED label: use issue type 'Bug' instead
    crashDEPRECATED label: use issue type 'Crash' instead
    on May 19, 2024
  2. osiewicz commented on May 20, 2024

    @osiewicz
    Member

    Does it crash with AV in debug build as well?

  3. MolotovCherry commented on May 20, 2024

    @MolotovCherry
    ContributorAuthor

    Does it crash with AV in debug build as well?

    Yes, it appears to crash in both release and debug builds

  4. IceSentry commented on Jun 10, 2024

    @IceSentry
    Contributor

    I've recently experienced the same issue with a600799

    Changing the linker back to the default msvc linker worked.

  5. paul-hansen commented on Jun 11, 2024

    @paul-hansen

    I've seen this before here: rust-lang/rust#111480
    It's listed as the last open issue blocking using lld as the default linker on Windows: rust-lang/rust#71520

    Note that issue suggests it only happens with lto = "thin" so removing that might be a workaround.

  6. MolotovCherry commented on Jun 14, 2024

    @MolotovCherry
    ContributorAuthor

    The Cargo.toml for release profile certainly has lto = "thin", but that doesn't explain the crash on debug profile which doesn't have it. 🤔

  7. werruww commented on Jun 22, 2024

    @werruww
  8. werruww commented on Jul 5, 2024

    @werruww
  9. MolotovCherry commented on Jul 5, 2024

    @MolotovCherry
    Author
  10. MolotovCherry commented on Aug 24, 2024

    @MolotovCherry
    Author
  11. USTHzhanglu commented on Sep 25, 2024

    @USTHzhanglu

    Very disappointed,use

    [target.x86_64-pc-windows-msvc]
    linker = "link.exe"

    not useful

  12. USTHzhanglu commented on Oct 23, 2024

    @USTHzhanglu
  13. removed
    bugDEPRECATED label: use issue type 'Bug' instead
    crashDEPRECATED label: use issue type 'Crash' instead
    on Jan 31, 2025
  14. notpeter commented on Jan 31, 2025

    @notpeter
    Contributor

    I'm going to go ahead and close this. We do not officially support windows and so the supported compiler/linker requirements are still in flux and will be further nailed down in the future.

    Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:windowshappens only on Windows, not other OS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions