[SERVER-30124] Move static function-level variables in populateDocumentWithQueryFields to an anonymous namespace Created: 13/Jul/17  Updated: 30/Oct/23  Resolved: 08/Aug/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.2.17

Type: Bug Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2017-08-21
Participants:
Linked BF Score: 0

 Description   

We suspect that a VS2013 issue with static function-level variable initialization resulted in a crash.
This change only applies to v3.2, because newer versions build with VS2015.



 Comments   
Comment by Githook User [ 08/Aug/17 ]

Author:

{'username': 'jseyster', 'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster'}

Message: SERVER-30124 Move statics from populateDocumentWithQueryFields.

We're seeing a test failure that could be explained by non-thread safe
initialization of function-level static variables in the version of
the C++11 spec used by the VS2013 compiler.

https://blogs.msdn.microsoft.com/oldnewthing/20040308-00/?p=40363

Moving those variables into file scope should ensure that
they get initialized safely.
Branch: v3.2
https://github.com/mongodb/mongo/commit/1583062723785c550874943007e6cdc1b7903e99

Generated at Thu Feb 08 04:22:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.