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

fix: Disabled constexpr mutex constructor to fix Windows build crashes. #100

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

Bonfra04
Copy link
Contributor

@Bonfra04 Bonfra04 commented Aug 2, 2024

Some systems (like the github hosted runners) have recently changed default build system for windows builds and something breaks the entire system.

Seems like an issue in msvcp140!mtx_do_lock+0x9c is the culprit in both traces. After some quick research it seems like maybe the mutex isn't being initialized properly? Though admittedly my knowledge in c++ is limited so I could be mistaken.

As for why this is seems to be behaving differently when being built locally vs on github actions, I believe this may be able to explain it.

  • 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.

--- microsoft/STL changelog
--- MPV issue 892

The proposed fix explained in the issue above also works for this project

@Skyost
Copy link
Owner

Skyost commented Aug 5, 2024

Thanks. Can you please change the PR name to follow conventional commit conventions so that I can merge it please ? 🙂

@Bonfra04 Bonfra04 changed the title Workaround to fix windows builds fix: disable constexpr mutex constructor to fix Windows build crashes Aug 5, 2024
@Skyost Skyost changed the title fix: disable constexpr mutex constructor to fix Windows build crashes fix: Disabled constexpr mutex constructor to fix Windows build crashes. Aug 9, 2024
@Skyost Skyost merged commit a165bdf into Skyost:master Aug 9, 2024
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

Successfully merging this pull request may close these issues.

2 participants