Skip to content

Conversation

@acozzette
Copy link

MSVC seems to have a bug where it does not use constant initialization
for std::atomic, which ends up causing crashes during initialization.
This change introduces a workaround by putting the std::atomic inside a
union, which causes the compiler to use constant initialization for it.

MSVC seems to have a bug where it does not use constant initialization
for std::atomic, which ends up causing crashes during initialization.
This change introduces a workaround by putting the std::atomic inside a
union, which causes the compiler to use constant initialization for it.
@acozzette acozzette requested a review from xfxyjwf June 18, 2018 16:41
@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jun 18, 2018

Can you include #4772 in this PR so we have the test coverage for this?

@acozzette
Copy link
Author

@xfxyjwf Sure, I went ahead and included that change. appveyor.yml is somewhat different between the master and 3.6.x branches, so I couldn't directly cherry-pick your change, but I manually added the same kind of test.

@acozzette acozzette merged commit 885be9c into protocolbuffers:3.6.x Jun 18, 2018
@acozzette acozzette deleted the fix-std-atomic-init branch June 18, 2018 18:38
@xfxyjwf xfxyjwf added the c++ label Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants