Skip to content
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

ANNOUNCEMENT: Access violation in msvcp140.dll with GitHub Actions #54

Open
adang1345 opened this issue Aug 16, 2024 · 0 comments
Open

Comments

@adang1345
Copy link
Owner

adang1345 commented Aug 16, 2024

If you're building a C++ project on GitHub Actions that uses std::mutex, then you may encounter an access violation when using that project in a delvewheel-repaired wheel. To fix this, add the argument --add-path C:/Windows/System32 to your delvewheel invocation.

In the May 2024 release of the Microsoft Visual C++ standard library, a change was made which can cause an access violation if the version of msvcp140.dll loaded at runtime is older than the version used at build time. Under Microsoft's C++ binary compatibility rules, the version of msvcp140.dll used at runtime must be the same version as or newer than the version used at build time.

delvewheel uses the PATH environment variable to find msvcp140.dll. Unfortunately, the default PATH value on the GitHub Actions Windows runner causes C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.422-5\x64\bin\msvcp140.dll to be found and vendored into the wheel. This version of msvcp140.dll is from Visual Studio 2017 and may be too old. If your C++ project is built with Visual Studio 2022 17.10 or later, then an access violation will happen if std::mutex is used and this version of msvcp140.dll is vendored.

By using the --add-path C:/Windows/System32 argument, you ensure that C:\Windows\System32\msvcp140.dll, which is new, is earlier in the search path. To help with diagnosing similar errors in the future, delvewheel 1.8.0 now outputs a warning if it detects that a vendored version of a Microsoft Visual C++ DLL is older than the version that was used at build time.

@adang1345 adang1345 pinned this issue Aug 16, 2024
greglucas added a commit to greglucas/pyproj that referenced this issue Sep 29, 2024
adang1345/delvewheel#54

Additionally, vcpkg has a download error when running with a bash shell
so we need to add some extra exports as a workaround.
microsoft/vcpkg#41199 (comment)
snowman2 pushed a commit to pyproj4/pyproj that referenced this issue Sep 29, 2024
adang1345/delvewheel#54

Additionally, vcpkg has a download error when running with a bash shell
so we need to add some extra exports as a workaround.
microsoft/vcpkg#41199 (comment)
adang1345 added a commit that referenced this issue Oct 21, 2024
This will help find issues similar to #54
adang1345 added a commit that referenced this issue Oct 21, 2024
This will help find issues similar to #54
adang1345 added a commit that referenced this issue Oct 21, 2024
This will help find issues similar to #54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant