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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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. |
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. |
We're very close to understanding the root cause - the MSVC-internal build is using fresh STL headers, but a previously installed copy of |
In other words: Thanks for finding a bug in our internal build! |
We'll need to ensure that the VCRedist is unlocked for this. |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
I've had to push an additional commit to avoid a
|
Thanks for fixing this unfixable bug!!! 😻 😻 😻 |
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
This reverts commit 8d18fec. Conflicts: * stl/inc/xthreads.h * stl/src/cond.cpp * stl/src/mutex.cpp * stl/src/primitives.hpp
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.)