[SERVER-26248] mongod fails to start on Windows DEBUG (Unoptimized) due to bad static initialization order Created: 22/Sep/16  Updated: 19/Nov/16  Resolved: 22/Sep/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.3.14
Fix Version/s: 3.3.14

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done 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
Participants:
Linked BF Score: 0

 Description   

On Windows DEBUG (Unoptimized) it seems that the k32IncompatibleIndexSpec value is constructed before the k32IncompatibleIndexName variable, which it is using has been initialized, which results in an invalid BSON.

This later on leads to the following exception at startup:

2016-09-22T13:59:31.994-0400 I -        [initandlisten] Assertion: 13111:field not found, expected type 2 E:\workspace\mongo\src\mongo/bson/bsonelement.h 667
2016-09-22T13:59:32.537-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\util\stacktrace_windows.cpp(174)                    mongo::printStackTrace+0x5b
2016-09-22T13:59:32.537-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\util\log.cpp(164)                                   mongo::logContext+0xe2
2016-09-22T13:59:32.544-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\util\assert_util.cpp(239)                           mongo::msgassertedWithLocation+0x183
2016-09-22T13:59:32.544-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\util\assert_util.cpp(229)                           mongo::msgassertedWithLocation+0x4b
2016-09-22T13:59:32.544-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\bson\bsonelement.h(667)                             mongo::BSONElement::chk+0x172
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\bson\bsonelement.h(96)                              mongo::BSONElement::String+0x3a
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\index_builder.cpp(126)                           mongo::IndexBuilder::_build+0xd7
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\index_builder.cpp(110)                           mongo::IndexBuilder::buildInForeground+0x5c
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\commands\feature_compatibility_version.cpp(274)  mongo::FeatureCompatibilityVersion::setIfCleanStartup+0x2ff
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\db.cpp(800)                                      mongo::`anonymous namespace'::_initAndListen+0x1df1
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\db.cpp(828)                                      mongo::`anonymous namespace'::initAndListen+0x4c
2016-09-22T13:59:32.545-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\db.cpp(1180)                                     mongoDbMain+0x274
2016-09-22T13:59:32.546-0400 I CONTROL  [initandlisten] mongod.exe    ...\src\mongo\db\db.cpp(868)                                      wmain+0x78
2016-09-22T13:59:32.546-0400 I CONTROL  [initandlisten] mongod.exe    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(80)        invoke_main+0x34
2016-09-22T13:59:32.546-0400 I CONTROL  [initandlisten] mongod.exe    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(253)       __scrt_common_main_seh+0x127
2016-09-22T13:59:32.546-0400 I CONTROL  [initandlisten] mongod.exe    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(296)       __scrt_common_main+0xe
2016-09-22T13:59:32.546-0400 I CONTROL  [initandlisten] mongod.exe    f:\dd\vctools\crt\vcstartup\src\startup\exe_wmain.cpp(17)         wmainCRTStartup+0x9

This was introduced in this commit: https://github.com/mongodb/mongo/commit/96a21e63bfc1a1cdde01c671d0867310c594ea5a



 Comments   
Comment by Githook User [ 22/Sep/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-26248 Make IndexDescriptor string constants constexpr
Branch: master
https://github.com/mongodb/mongo/commit/63864ff42e0402b65f5fa45635b0a76baf671aa8

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