[SERVER-44290] static order initialization fiasco in version.cpp Created: 28/Oct/19  Updated: 29/Oct/23  Resolved: 30/Oct/19

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

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

Issue Links:
Related
is related to SERVER-44323 Investigate ASAN Static initializatio... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2019-11-18
Participants:

 Description   

The `VersionInfoInterface::instance` function is called during static initialization but relies on static global variable. This causes Windows non-optimized debug builds to fail on startup.

For more information, seeĀ https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use



 Comments   
Comment by Mark Benvenuto [ 30/Oct/19 ]

I do not have the time to investigate why ASAN did not detect it. I am happy to create a ticket if you want one to follow up. There is no BF associated with this issue since it was not found by Evergreen.

Comment by Githook User [ 29/Oct/19 ]

Author:

{'name': 'Mark Benvenuto', 'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com'}

Message: SERVER-44290 Fix static intialization order in version.cpp
Branch: master
https://github.com/mongodb/mongo/commit/7cd19b28dcf4ef3a18508c61407fb900bd8effe7

Comment by Andrew Morrow (Inactive) [ 29/Oct/19 ]

Our ASAN setup is supposed to detect init order fiasco problems: https://github.com/mongodb/mongo/blob/81f52a69c92d27034ef3a9bf411fb463cab7643e/etc/evergreen.yml#L12706. I'd be interested to know why it didn't.

Also, was this a latent defect? If so, why did we just find it now? Or was it a regression? If so, can we link to the ticket associated with the change that introduced it and the associated BF? It will help us guide some process around using regressions to steer the set of tests in the commit queue.

Generated at Thu Feb 08 05:05:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.