Skip to content

Can't run VS address sanitizer on Windows-2022 runner #8891

@Reedbeta

Description

@Reedbeta

Description

(Initially posted in the community discussions, but then I found this repo and thought an issue here might be better.)

I'm having trouble running an executable compiled with Visual Studio with Address Sanitizer enabled, on the Windows runners.

Here's a minimal repro: https://github.com/Reedbeta/gha-asan-test

This is VS's canned hello-world app, which I've modified by enabling ASan in the Debug configuration.

Now, running ASan requires clang_rt.asan_dynamic-x86_64.dll to be on the PATH. This will be the case when running through a VS developer command prompt, so in my GHA setup I've used the setup-msvc-dev action to do this.

I've verified that the clang ASan DLL is present in the expected directory on the runner, i.e. C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64, and I've verified that directory is on the PATH, e.g. I can invoke cl.exe and it's found.

However, running my hello-world app with ASan on the Windows runner fails immediately with no output and an exit code -1073741502, which maps to 0xc0000142 which is STATUS_DLL_INIT_FAILED.

I cannot reproduce this on my own machine (Windows 11 10.0.22621.2715, VS Community 17.7.3, same toolchain version 14.37.32822). For me, the app runs without error.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Image: windows-2022
Version: 20231115.2.0

Failed run: https://github.com/Reedbeta/gha-asan-test/actions/runs/6997736159/job/19035042249

Is it regression?

Unknown

Expected behavior

Executables compiled with ASan should run successfully.

Actual behavior

The executable fails with exit code -1073741502.

Repro steps

Fork https://github.com/Reedbeta/gha-asan-test and run the "Build and Test" action.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions