Skip to content

Windows 6.2.1 x86_64 toolchain is resulting in exit code -1073741819 #85516

Open

Description

@award999

While debugging a vscode-swift issue swiftlang/vscode-swift#1937 I came to realize something is different with 6.2.1 toolchain on Windows. So we call swift --version and various other SwiftPM commands on extension activation to setup the development environment. With 6.2.1 we get the right STDOUT but exit code -1073741819 which I think indicates STATUS_ACCESS_VIOLATION.

PS > swift --version
Swift version 6.2.1 (swift-6.2.1-RELEASE)
Target: x86_64-unknown-windows-msvc
Build config: +assertions
PS > $LASTEXITCODE
-1073741819

Now I'm reproducing using the x86_64 toolchain on ARM64 Windows because for the longest time ARM64 toolchain did not work on Windows. I tried installing the ARM64 6.2.1 toolchain on Windows and the extension activates fine so I only reproduce with x86_64 toolchain on an ARM64 Windows but that worked as recently as 6.2.0. I downgraded to 6.2.0 and 6.1.3 with no issues, so think legit issue with the x86_64 toolchain for 6.2.1

Activity

  1. award999 commented on Nov 14, 2025

    @award999
    ContributorAuthor
  2. shahmishal commented on Nov 14, 2025

    @shahmishal
    Member
  3. award999 commented on Nov 14, 2025

    @award999
    ContributorAuthor

    Also worth noting this lines up perfectly with our nightly 6.2 Windows job starting to fail https://github.com/swiftlang/vscode-swift/actions/runs/19350317255/job/55360633338. Now IDK if the GitHub actions Windows runner is ARM64 or x86_64 so maybe there is a problem on x86_64 Windows as well

  4. compnerd commented on Nov 14, 2025

    @compnerd
    Member

    This isn't an installer issue, moving to swiftlang/swift

  5. compnerd commented on Nov 14, 2025

    @compnerd
    Member

    I cannot seem to reproduce this:

    Image

    Can you verify that this occurs on x64 hardware natively? Can you provide information about the CPU that you are using?

  6. award999 commented on Nov 14, 2025

    @award999
    ContributorAuthor

    I'm using Parallels on macOS, I can try to track down an x86_64 box

  7. compnerd commented on Nov 14, 2025

    @compnerd
    Member

    @Steelskin was able to reproduce this under Parallels on ARM64. I think that this is likely a WONTFIX, as we should encourage people to use the ARM64 toolchain on ARM64. My suspicion is that the emulation layer does not support some of the instructions in the toolchain which results in the CPU fault resulting in the access violation.

  8. Steelskin commented on Nov 14, 2025

    @Steelskin
    Contributor

    Running swiftc.exe under windbg shows that the access violation is here:

    (3f88.3f8c): Access violation - code c0000005 (first chance)
    mimalloc!mi_free+0x30:
    00007fff`c87d3000 488b11          mov     rdx,qword ptr [rcx] ds:00000000`00000000=????????????????
    

    My guess is that mimalloc does not work properly under the x64 emulation layer scenario.

  9. award999 commented on Nov 17, 2025

    @award999
    ContributorAuthor

    More concerned that vscode CI jobs started to fail with 6.2.1 and that should be x86_64 so I'll see if I can find an x86_64 box to use later in the week to reproduce

  10. award999 commented on Nov 18, 2025

    @award999
    ContributorAuthor

    @compnerd, @matthewbastien has been able to reproduce on an x86_64 windows box

  11. removed their assignment
    on Nov 18, 2025
  12. 6 remaining items

  13. award999 commented on Nov 18, 2025

    @award999
    ContributorAuthor

    This is probably 2 separate issues then, @matthewbastien is only seeing with LLDB, I was seeing swift --version crash

  14. compnerd commented on Nov 18, 2025

    @compnerd
    Member

    Yeah, if it is a python version mismatch on LLDB, we should split this into two separate issues. We need a proper reproduction for the swift driver, but that is suspected to be the emulation layer/hardware compatibility.

  15. matthewbastien commented on Nov 18, 2025

    @matthewbastien
    Member

    can you get the output of path? Did you install Python 3.10.x?

    I had Python 3.9.x installed from a loooong time ago. So, I uninstalled that and installed Python 3.10.11 via Python Install Manager, but encountered the same issue. Here's what my path looks like:

    Image
  16. charles-zablit commented on Nov 18, 2025

    @charles-zablit
    Contributor
  17. compnerd commented on Nov 18, 2025

    @compnerd
    Member

    @matthewbastien seems that your Path does not contain Python. Can you restart your terminal emulator and see if it shows up? If so, I believe that LLDB should startup then. If it does, we should split up this issue into two separate threads.

  18. charles-zablit commented on Nov 19, 2025

    @charles-zablit
    Contributor

    I had Python 3.9.x installed from a loooong time ago. So, I uninstalled that and installed Python 3.10.11 via Python Install Manager, but encountered the same issue. Here's what my path looks like:

    Image

    I see C:\Users\mbastien\AppData\Local\Python\bin in the screenshot.

    @matthewbastien can you please run gcm python310.dll from your Powershell shell? If that returns nothing, python310.dll is not available. Otherwise, the issue is somewhere else.

  19. charles-zablit commented on Nov 19, 2025

    @charles-zablit
    Contributor

    @matthewbastien swiftlang/llvm-project#11779 is caused by the Python version mismatch and has the exact same stack trace.

  20. matthewbastien commented on Nov 19, 2025

    @matthewbastien
    Member

    Yeah, looks like powershell can't find the dll (and most likely LLDB as well):
    Image

    python310.dll does exist in ~/AppData/Local/Python/pythoncore-3.10-64, but that isn't in Path. Only the bin folder that's used by Python Install Manager is there. Do we support Python installations from Python Install Manager, or should I just install Python 3.10 directly?

    Also, the CI for the VS Code Swift extension is failing on Windows with Swift 6.2.1 because of this. In that instance we're using the 6.2.1 image from the swiftlang github actions repo. Does that image need updating to install Python 3.10.x?

  21. charles-zablit commented on Nov 19, 2025

    @charles-zablit
    Contributor

    Do we support Python installations from Python Install Manager, or should I just install Python 3.10 directly?

    We only support a Python installation which is in the PATH. If Python Install Manager does not put python310.dll in the PATH, it's not supported. The only exception to that will be when swiftlang/swift-installer-scripts#447 is merged. It allows us to distribute a minimal Python install with the toolchain on Windows to avoid this unresolved python310.dll error.

    Does that image need updating to install Python 3.10.x?

    Is the bot using the docker image from swift-docker to run? If so, that should be updated already with swiftlang/swift-docker@316ca5e.

  22. award999 commented on Nov 19, 2025

    @award999
    ContributorAuthor

    No we cannot use the swift-docker images, we run directly in the GitHub action agent, and I've checked and the Python version is the same as it's been for a while in that image. I don't want to lose sight that this started failing in our CI job where nothing in the setup is changed, but something about 6.2.1 is different and lldb-dap tests are failing.

    We should probably raise a separate issue for the LLDB issue as we got 2 topics here.

    regarding the original issue about the access violation

    I think that this is likely a WONTFIX

    Is that the official decision that x86_64 toolchain on ARM64 will no longer be a supported setup? For the longest time there were issues with the ARM64 toolchain that meant debugging (and maybe LSP) did not work in VS Code so we'll have to make sure the ARM64 toolchain is in fact working if x86_64 on ARM64 support is being dropped.

  23. compnerd commented on Nov 20, 2025

    @compnerd
    Member

    Is that the official decision that x86_64 toolchain on ARM64 will no longer be a supported setup? For the longest time there were issues with the ARM64 toolchain that meant debugging (and maybe LSP) did not work in VS Code so we'll have to make sure the ARM64 toolchain is in fact working if x86_64 on ARM64 support is being dropped.

    If this is due to PRISM, then yes. PRISM doesn't support each feature of X86, and I don't think that we should be forced to pessimise the compiler for ARM64 compatibility. We have the native ARM64 toolchain so there is a good solution for the developers working on ARM64.

  24. compnerd commented on Feb 28, 2026

    @compnerd
    Member

    Hmm, I wonder what the difference is in the build. Can you grab the detailed build log for vcpkg @liamgmgit? Perhaps we can identify what the difference is and apply that.

  25. compnerd commented on Feb 28, 2026

    @compnerd
    Member

    I don't see the actual CMake invocation, which makes this difficult. It seems that there were a bunch of MinGW dependencies that were pulled in which makes this trickier. Also, I think that we are only interested in the release mode builds (or MinSizeRel).

  26. compnerd commented on Mar 2, 2026

    @compnerd
    Member

    @liamgmgit I don't understand the last message.

    It is likely that they are building mimalloc with a different set of flags, and I would like to understand what that set of flags are. We are not going to be able to change the way that we build - that is codified in https://github.com/swiftlang/swift/blob/main/utils/build.ps1#L2367-L2413. We can however adjust the configuration options based upon what we can learn from the build of mimalloc that vcpkg does. I'd also be willing to switch to using CMake instead of MSBuild if we can get that to properly cross-compile (X64 -> {X64,ARM64}, ARM64 -> {ARM64,X64}).

    CC: @hjyamauchi

  27. al45tair commented on Nov 10, 2026

    @al45tair
    Contributor

    See also #93987, which is a similar issue, fixed in swiftlang/swift-docker#611.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions