-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Can't run VS address sanitizer on Windows-2022 runner #8891
Comments
hello, @Reedbeta , I'm a bit confused with the whole idea. You use https://github.com/marketplace/actions/setup-msvc-developer-command-prompt and probably issue should be reported there. What do you think ? |
also, I've added
and libs are in the PATH: https://github.com/ilia-shipitsin/gha-asan-test/actions/runs/7004748447/job/19053131076 |
Hi @ilia-shipitsin, thanks for taking a look. I don't think the setup-msvc-dev action has anything to do with this, I just used it to get the proper directory on PATH. We can try another method of adding the directory to the PATH (not using the action) if you like - but, as you verified, the ASan component is installed and DLLs are indeed present on the PATH. Also note the error code for a missing DLL is a different one, So this seems to be some other issue or incompatibility with the runner configuration. After some googling I found this thread which sounds like similar symptoms, but it was marked fixed more than two years ago. I think this would need someone to connect a debugger on the runner to see more about what's going on. |
I did a check (above) that shown that asan lib present in PATH. |
maybe you will find useful to upload a binary via artifacts and investigate it locally |
also, we installed VS 17.8.0 (the latest one available at the time image created), are you running the same locally ? this week 17.8.1 will be deployed |
I enabled user dump collection https://github.com/ilia-shipitsin/gha-asan-test/blob/main/.github/workflows/build.yml#L22-L54 here's dump: https://github.com/ilia-shipitsin/gha-asan-test/actions/runs/7008887175 windbg says there's something wrong with ASAN. looks like VS regression (?!)
|
I'm not sure we did something wrong on image level. Also, we do not run e2e asan tests assuming those are run on the VS side |
Thanks for getting the crash dump and callstack, that's helpful. It looks like this is a very similar failure to the ones reported previously here and here. I suspect an incompatibility with the version of ASan and the version of Windows on the runner, or some other software on the runner. It probably needs to be addressed with either VS or LLVM. |
Hey @Reedbeta and @ilia-shipitsin, it looks like all of the links to the failures above have Visual Studio 17.7 and not 17.8 (the path shows Is the latest Visual Studio version (linked here) actually correct? |
@zacklj89 , image version and included software should be correct according to those numbers, I assume we hit a regression on 17.8.0 (but I might be wrong). |
I used to have working clang++ -fsanitize=address builds (simple builds) in CI but now they fail because of linker issues. I haven't touched anything and it builds fine on other platforms in CI. |
@uNetworkingAB could you link to one of the linker errors? Also, which image and Visual Studio version are you using? |
Some time after November 1st my Windows CI started failing from -fsanitize like this https://github.com/uNetworking/uWebSockets/actions/runs/7058347522/job/19213731588 and it was working fine before. The compilation is super simple: clang++ -std=c++17 -fsanitize=address Query.cpp -o Query It just has a single Cpp without any complex dependencies: clang++ -std=c++17 -fsanitize=address Query.cpp -o Query |
Hello, Works fine on my windows 11 machine with Enterprise 2022 latest version and I'm not able to reproduce it locally. I copy the asan dll next to the executable file. The job (Exit code 0xc0000142) :
Here is the link: https://github.com/HUD-Software/core/actions/runs/7089755512/job/19295187595 |
I have the exact same problem. Suddenly all my msvc asan builds on gh actions started failing with this dll error. I can't reproduce it locally on Windows 11 with VS 17.8.0 @Reedbeta why close the issue? |
Closed it because based on the conversation it didn't seem like the github team was going to investigate or try to address this here. 🤷🏻♂️ I guess I'll reopen it since a lot of people are hitting this. |
Hey @Reedbeta and @iboB! Very sorry to see this bug bothering you again. |
@erik-bershel, yes. Still fails. Repro from seconds ago: https://github.com/iboB/actions-msvc-asan-bug/actions/runs/7218137272/job/19675605146#step:6:60
Image:
|
There's still something wrong though. If you see my link above, you'll notice that both vcvars and cmake set the paths and toolchain to The thing is that for some reason cmake just refuses to select I'm still not sure what's the problem here, but something is not right |
For future ref: I was finally able to make it work with the |
Yeah, I can't get it to work either, with This is not using the "setup MSVC dev command prompt" action anymore, just invoking CMake out of the box, so something seems messed up with either the VS installation or CMake installation on this image. |
It passes asan locally, so guessing missing runtime library
Seeing the same with just |
@fredemmott see my example, I don't even use anything other than the simplest clang++ use |
Update: with the latest runner image,
Curiously CMake (with the VS2022 generator) is still saying Also in case it's useful for anyone, here's a snippet to list the installed MSVC toolchains on the machine. Maybe someone can figure out how to wire this into setup-msvc-dev so that it always selects the latest installed one.
|
Hello can you please be more specific on what exactly you did to make it work? Sorry I don't understand what you did to fix the problem. I have |
The linker is trying to link the library file that does not exist in the filesystem. Interesting, isn't it? setup-msvc actions do not help of course. Any MSVC expert around maybe? ;-)
Existing similar files:
|
i'm newbie with sanitizer, I'm having a lot of problems with this, I simply want to debug my project with sanatize and I can't i compile with my Makefile with clang++ -fsanatize=address main.cpp -o app.exe -g, run the exe, and nothing happens. |
Setting env variable This env variable was mentioned here: https://learn.microsoft.com/en-us/cpp/sanitizers/asan-runtime?view=msvc-170 |
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 thesetup-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 invokecl.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 to0xc0000142
which isSTATUS_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
Runner images affected
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.
The text was updated successfully, but these errors were encountered: