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 static initialisation order fiasco issue for Version variables #10370

Merged
merged 1 commit into from Jan 14, 2022

Conversation

leoetlino
Copy link
Member

Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.

I didn't rename the variables to make reviewing this PR easier but at some point we'll probably want to give clearer names to scm_rev_str and scm_rev_git_str.

Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • ea-pink on mvk-osx-m1: diff
  • rs2-skybox on mvk-osx-m1: diff
  • rs3-bumpmapping on mvk-osx-m1: diff
  • spyro-depth on mvk-osx-m1: diff

automated-fifoci-reporter

@SupervisedThinking
Copy link

Indeed this PR fixes the segfaults after #10307

@lioncash lioncash merged commit e8bbfc2 into dolphin-emu:master Jan 14, 2022
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants