-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
constexpr
mutex
constructor
#3824
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as resolved.
This comment was marked as resolved.
StephanTLavavej
approved these changes
Jul 7, 2023
Thanks, this looks great! I pushed extremely minor changes. Having thought about this extensively during the previous PR, I think that this change is correct and safe, and it's a good simplification too. |
strega-nil-ms
approved these changes
Jul 7, 2023
This comment was marked as outdated.
This comment was marked as outdated.
Unfortunately, I need to pull this from the merge batch. It's causing the internal build to consistently fail with:
I don't know what's causing this yet. |
StephanTLavavej
approved these changes
Jul 20, 2023
Thanks for fixing this unfixable bug!!! 😻 😻 😻 |
strega-nil
added a commit
to strega-nil/llvm-project
that referenced
this pull request
Aug 18, 2023
It turns out that the STL requires you to place the DLLs into the directory of the executable; else, msvcp140.dll will be taken from C:\Windows\System32 (which is unsupported). This was discovered because of the recent constexpr mutex change; see [microsoft/STL#3824][]. Especially the fuzzer unit tests fail completely with the mutex changes. [microsoft/STL#3824]: microsoft/STL#3824 Differential Revision: https://reviews.llvm.org/D158221
CaseyCarter
added a commit
to CaseyCarter/STL
that referenced
this pull request
Aug 30, 2023
This reverts commit 8d18fec. Conflicts: * stl/inc/xthreads.h * stl/src/cond.cpp * stl/src/mutex.cpp * stl/src/primitives.hpp
14 tasks
This was referenced Jun 11, 2024
tianleiwu
pushed a commit
to microsoft/onnxruntime
that referenced
this pull request
Jun 12, 2024
microsoft/STL#3824 introduces constexpr mutex. An older version of msvcp140.dll will lead to ```A dynamic link library (DLL) initialization routine failed```. This error can be encountered if using conda Python since conda packages msvc dlls and these are older right now. This PR disables the constexpr mutex so that ort package can work with older msvc dlls. Thanks @snnn for the discovery.
baijumeswani
added a commit
to microsoft/onnxruntime
that referenced
this pull request
Jun 20, 2024
microsoft/STL#3824 introduces constexpr mutex. An older version of msvcp140.dll will lead to ```A dynamic link library (DLL) initialization routine failed```. This error can be encountered if using conda Python since conda packages msvc dlls and these are older right now. This PR disables the constexpr mutex so that ort package can work with older msvc dlls. Thanks @snnn for the discovery.
yf711
pushed a commit
to microsoft/onnxruntime
that referenced
this pull request
Jun 21, 2024
microsoft/STL#3824 introduces constexpr mutex. An older version of msvcp140.dll will lead to ```A dynamic link library (DLL) initialization routine failed```. This error can be encountered if using conda Python since conda packages msvc dlls and these are older right now. This PR disables the constexpr mutex so that ort package can work with older msvc dlls. Thanks @snnn for the discovery.
narknon
added a commit
to UE4SS-RE/RE-UE4SS
that referenced
this pull request
Jun 22, 2024
microsoft/STL#3824 microsoft/STL#4000 microsoft/STL#4339 Add escape hatch due to STL change resulting in issues with binary compatibility. https://github.com/microsoft/STL/wiki/Changelog "Fixed bugs: Fixed mutex's constructor to be constexpr. #3824 #4000 #4339 Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule: When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component. You can define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR as an escape hatch."
2 tasks
narknon
added a commit
to UE4SS-RE/RE-UE4SS
that referenced
this pull request
Jun 27, 2024
STL updates Mutex Fix microsoft/STL#3824 microsoft/STL#4000 microsoft/STL#4339 Add escape hatch due to STL change resulting in issues with binary compatibility. https://github.com/microsoft/STL/wiki/Changelog "Fixed bugs: Fixed mutex's constructor to be constexpr. #3824 #4000 #4339 Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule: When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component. You can define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR as an escape hatch."**Description**
barcharcraz
pushed a commit
to barcharcraz/llvm-project
that referenced
this pull request
Nov 1, 2024
See [MSVC-PR-490940][] and [LLVM-D158221][]. It turns out that the STL requires you to place the DLLs into the directory of the executable; else, `msvcp140.dll` will be taken from `C:\Windows\System32` (which is unsupported). This was discovered because of the recent constexpr mutex change; see [microsoft/STL#3824][]. Especially the fuzzer unit tests fail completely with the mutex changes. [MSVC-PR-490940]: https://dev.azure.com/devdiv/DevDiv/_git/msvc/pullrequest/490940 [LLVM-D158221]: https://reviews.llvm.org/D158221 [microsoft/STL#3824]: microsoft/STL#3824
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2285.
Because this might cause problem in complicated (and formally forbidden) scenarios (see discussion in #3770), I chose to make this opt-in via the_USE_CONSTEXPR_MUTEX_CONSTRUCTOR
macro. If_USE_CONSTEXPR_MUTEX_CONSTRUCTOR
is not defined,mutex
will call_Mtx_init_in_situ
as before.For the same reason, I changedstl_critical_section_win7
andstl_condition_variable_win7
back to polymorphic classes, even though their vptrs are no longer accessed. (If_USE_CONSTEXPR_MUTEX_CONSTRUCTOR
is defined, nostl_critical_section_win7
object will be created.)